Mailinglist Archive: zypp-commit (172 mails)

< Previous Next >
[zypp-commit] <zypper> master : Bash completion: suggest also global options.
  • From: Ján Kupec <jkupec@xxxxxxx>
  • Date: Thu, 12 Feb 2009 09:26:11 +0100
  • Message-id: <E1LXXEv-0005a2-By@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit db01066efced93f936168023771d40276d368613
Author: Josef Reidinger <jreidinger@xxxxxxx>
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@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages