ref: refs/heads/master
commit a18b87f001cae2357ee3145200a336c8a396bc14
Author: Josef Reidinger
Date: Wed Feb 11 13:56:12 2009 +0100
Bash completion: partial fix for repos with spaces.
---
src/bash-completion.sh | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/bash-completion.sh b/src/bash-completion.sh
index 5376d8b..14b8181 100644
--- a/src/bash-completion.sh
+++ b/src/bash-completion.sh
@@ -55,17 +55,20 @@ _zypper() {
;;
removerepo)
opts=$(LC_ALL=C $ZYPPER help $prev 2>&1 | sed -e "1,/$magic_string/d" -e 's/.*--/--/' -e 's/ .*//')
- opts="${opts} $(LC_ALL=C $ZYPPER lr | sed -e '1,2 d' -e 's/^[0-9]\+[[:space:]]\+|[[:space:]]*\([^|]\+\)|.*$/\1/' -e 's/[[:space:]]*$//')"
+ opts2=$(LC_ALL=C $ZYPPER lr | sed -e '1,2 d' -e 's/^[0-9]\+[[:space:]]\+|[[:space:]]*\([^|]\+\)|.*$/\1/' -e 's/[[:space:]]*$//' -e 's/ /\\ /g' -e "s/^\(.*\)$/'\1'/")
+ opts="${opts} ${opts2}"
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
;;
renamerepo)
opts=$(LC_ALL=C $ZYPPER help $prev 2>&1 | sed -e "1,/$magic_string/d" -e 's/.*--/--/' -e 's/ .*//')
- opts="${opts} $(LC_ALL=C $ZYPPER lr | sed -e '1,2 d' -e 's/^[0-9]\+[[:space:]]\+|[[:space:]]*\([^|]\+\)|.*$/\1/' -e 's/[[:space:]]*$//')"
+ opts2=$(LC_ALL=C $ZYPPER lr | sed -e '1,2 d' -e 's/^[0-9]\+[[:space:]]\+|[[:space:]]*\([^|]\+\)|.*$/\1/' -e 's/[[:space:]]*$//' -e 's/ /\\ /g' -e "s/^\(.*\)$/'\1'/")
+ opts="${opts} ${opts2}"
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
;;
modifyrepo)
opts=$(LC_ALL=C $ZYPPER help $prev 2>&1 | sed -e "1,/$magic_string/d" -e 's/.*--/--/' -e 's/ .*//')
- opts="${opts} $(LC_ALL=C $ZYPPER lr | sed -e '1,2 d' -e 's/^[0-9]\+[[:space:]]\+|[[:space:]]*\([^|]\+\)|.*$/\1/' -e 's/[[:space:]]*$//')"
+ opts2=$(LC_ALL=C $ZYPPER lr | sed -e '1,2 d' -e 's/^[0-9]\+[[:space:]]\+|[[:space:]]*\([^|]\+\)|.*$/\1/' -e 's/[[:space:]]*$//' -e 's/ /\\ /g' -e "s/^\(.*\)$/'\1'/")
+ opts="${opts} ${opts2}"
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
;;
refresh)
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org