ref: refs/heads/master
commit db01066efced93f936168023771d40276d368613
Author: Josef Reidinger
Date: Thu Feb 12 09:26:11 2009 +0100
Bash completion: suggest also global options.
---
src/bash-completion.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/bash-completion.sh b/src/bash-completion.sh
index 50c5a33..c550820 100644
--- a/src/bash-completion.sh
+++ b/src/bash-completion.sh
@@ -48,7 +48,8 @@ _zypper() {
if [[ "$command" =~ "zypper" ]]; then
opts=$ZYPPER_CMDLIST
-#TODO generate also global options
+ opts2=$(LC_ALL=C $ZYPPER help 2>&1 | sed -e "1,/Global Options:/d" -e "/Commands:/,$ d" -e 's/.*--/--/' -e 's/[,[:space:]].*//' -e '/^$/d')
+ opts="${opts} ${opts2}"
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0;
fi
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org