ref: refs/heads/master
commit f1d22d759d3229879595b9022c195c3e7b26efb6
Author: Josef Reidinger
Date: Wed Feb 11 13:57:55 2009 +0100
Bash completion: complete also short options.
---
src/bash-completion.sh | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/bash-completion.sh b/src/bash-completion.sh
index 14b8181..4dd50a5 100644
--- a/src/bash-completion.sh
+++ b/src/bash-completion.sh
@@ -10,7 +10,7 @@ _zypper() {
local magic_string="Command options:"
local opts cur prev prevprev
if test ${#ZYPPER_CMDLIST[*]} = 0; then
- for foo in $(LC_ALL=C $ZYPPER -h | sed -e "1,/Commands:/d" | awk -F ' ' '{print $1}' | sed -e 's/,//' -e 's/[[:upper:]].*//'); do
+ for foo in $(LC_ALL=C $ZYPPER -h | sed -e "1,/Commands:/d" | awk -F ' ' '{print $1} {print $2}' | sed -e 's/,//' -e 's/[[:upper:]].*//'); do
ZYPPER_CMDLIST="$ZYPPER_CMDLIST $foo"
done
fi
@@ -71,6 +71,10 @@ _zypper() {
opts="${opts} ${opts2}"
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
;;
+ services)
+ opts=$(LC_ALL=C $ZYPPER help $prev 2>&1 | sed -e "1,/$magic_string/d" -e 's/.*--/--/' -e 's/ .*//')
+ COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
+ ;;
refresh)
opts=$(LC_ALL=C $ZYPPER help $prev 2>&1 | sed -e "1,/$magic_string/d" -e 's/.*--/--/' -e 's/ .*//')
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org