[Bash-completion-commits] [SCM] bash-completion branch, master, updated. db7d2833df260ed6aede1583082f6e27a3a89af6
Ville Skyttä
ville.skytta at iki.fi
Tue Nov 3 22:24:44 UTC 2009
The following commit has been merged in the master branch:
commit 41c675e749010bf8a93ad2de6b160bd83b7a0228
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Wed Nov 4 00:16:06 2009 +0200
sed usage portability fixes: avoid semicolon separated statements in one -e.
diff --git a/bash_completion b/bash_completion
index 3bade05..46eda1d 100644
--- a/bash_completion
+++ b/bash_completion
@@ -594,8 +594,8 @@ _pnames()
# Not using "ps axo comm" because under some Linux kernels, it
# truncates command names (see e.g. http://bugs.debian.org/497540#19)
COMPREPLY=( $( compgen -W '$( command ps axo command= | \
- sed -e "s/ .*//; s:.*/::; s/:$//;" \
- -e "s/^[[(-]//; s/[])]$//" \
+ sed -e "s/ .*//" -e "s:.*/::" -e "s/:$//" \
+ -e "s/^[[(-]//" -e "s/[])]$//" \
-e "s/^<defunct>$//")' \
-- "$cur" ) )
}
@@ -767,8 +767,8 @@ _service()
if [[ $COMP_CWORD -eq 1 ]] && [[ $prev == "service" ]]; then
_services
else
- COMPREPLY=( $( compgen -W '`sed -ne "y/|/ /; \
- s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \
+ COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \
+ -ne "s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \
$sysvdir/${prev##*/} 2>/dev/null`' -- "$cur" ) )
fi
diff --git a/contrib/cvs b/contrib/cvs
index 581182a..9aeef52 100644
--- a/contrib/cvs
+++ b/contrib/cvs
@@ -254,7 +254,7 @@ _cvs()
cvsroot)
if [ -r ~/.cvspass ]; then
# Ugly escaping because of bash treating ':' specially
- cvsroots=$( sed 's/^[^ ]* //; s/:/\\:/g' ~/.cvspass )
+ cvsroots=$( sed -e 's/^[^ ]* //' -e 's/:/\\:/g' ~/.cvspass )
COMPREPLY=( $( compgen -W '$cvsroots' -- "$cur" ) )
fi
;;
diff --git a/contrib/gdb b/contrib/gdb
index 8c8cb8d..0cbf1ec 100644
--- a/contrib/gdb
+++ b/contrib/gdb
@@ -21,7 +21,7 @@ _gdb()
# names manually.
IFS=":"
local path_array=( $( echo "$PATH" | \
- sed 's/:\{2,\}/:/g;s/^:\|:$//g' ) )
+ sed -e 's/:\{2,\}/:/g' -e 's/^:\|:$//g' ) )
IFS=$'\n'
COMPREPLY=( $( compgen -d -W '$(find "${path_array[@]}" . \
-mindepth 1 -maxdepth 1 -not -type d -executable \
diff --git a/contrib/gpg b/contrib/gpg
index 76c845a..49bfe04 100644
--- a/contrib/gpg
+++ b/contrib/gpg
@@ -17,7 +17,8 @@ _gpg()
--@(export|@(?(l|nr|nrl)sign|edit)-key))
# return list of public keys
COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \
- sed -ne 's@^pub.*/\([^ ]*\).*$@\1 at p;s@^.*\(<\([^>]*\)>\).*$@\2 at p')" -- "$cur" ))
+ sed -ne 's@^pub.*/\([^ ]*\).*$@\1 at p' \
+ -ne 's@^.*\(<\([^>]*\)>\).*$@\2 at p' )" -- "$cur" ) )
return 0
;;
-@(r|-recipient))
diff --git a/contrib/gpg2 b/contrib/gpg2
index 607797c..eff4b3c 100644
--- a/contrib/gpg2
+++ b/contrib/gpg2
@@ -21,7 +21,8 @@ _gpg2 ()
--@(export|@(?(l|nr|nrl)sign|edit)-key))
# return list of public keys
COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \
- sed -ne 's@^pub.*/\([^ ]*\).*$@\1 at p;s@^.*\(<\([^>]*\)>\).*$@\2 at p')" -- "$cur" ))
+ sed -ne 's@^pub.*/\([^ ]*\).*$@\1 at p' \
+ -ne 's@^.*\(<\([^>]*\)>\).*$@\2 at p' )" -- "$cur" ) )
return 0
;;
-@(r|-recipient))
diff --git a/contrib/sysv-rc b/contrib/sysv-rc
index ac2062b..a11c9b1 100644
--- a/contrib/sysv-rc
+++ b/contrib/sysv-rc
@@ -93,8 +93,8 @@ _invoke_rc_d()
) )
COMPREPLY=( $( compgen -W '${valid_options[@]} ${services[@]}' -- "$cur" ) )
elif [ -x $sysvdir/$prev ]; then
- COMPREPLY=( $( compgen -W '`sed -ne "y/|/ /; \
- s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \
+ COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \
+ -ne "s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \
$sysvdir/$prev`' -- "$cur" ) )
else
COMPREPLY=()
--
bash-completion
More information about the Bash-completion-commits
mailing list