summaryrefslogtreecommitdiff
path: root/contrib/bash-completion
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2013-05-21 12:07:41 +0200
committerportix <portix@gmx.net>2013-05-21 12:07:41 +0200
commit53471b775ec2ec5b1401752c2955873f25634b13 (patch)
treedb72bb5d06f29763a885e110ce89e0386056124b /contrib/bash-completion
parent77aa64c8577ad3b66e2943d62c7b07faabb96a72 (diff)
downloaddwb-53471b775ec2ec5b1401752c2955873f25634b13.zip
Error message when including archive fails, bash-completion for --archive
Diffstat (limited to 'contrib/bash-completion')
-rw-r--r--contrib/bash-completion18
1 files changed, 16 insertions, 2 deletions
diff --git a/contrib/bash-completion b/contrib/bash-completion
index 4de384a2..818ff634 100644
--- a/contrib/bash-completion
+++ b/contrib/bash-completion
@@ -78,6 +78,13 @@ __enabled_extension() {
[[ " ${disabled} " != *" ${installed} "* ]] && printf "${installed} "
done)" -- $cur ) )
}
+__archive() {
+ COMPREPLY=( $( compgen -W "$( case $prev in
+ --archive) printf 'a h d e l p s u ';;
+ *) _filedir;;
+ esac)" -- $cur ) )
+}
+
_dwb() {
local cur prev opts lopts
@@ -127,7 +134,7 @@ _dwbem() {
opts="-h -a -b -B -c -d -e -E -i -I -l -L -n -N -r -p -u -U"
lopts="--help --list-all --bind --setbind --config --disable --enable --edit
--install --info --list-installed --setload --no-config --no-confirm
- --remove --proxy --upgrade --update"
+ --remove --proxy --upgrade --update --archive"
extinstops=" -B --setbind -c --config -d --disable -e --enable -E --edit
-L --setload -r --remove -U --update "
@@ -141,6 +148,10 @@ _dwbem() {
__disabled_extension
return 0
}
+ [[ " --archive " == *" ${prev} "* ]] && {
+ __archive
+ return 0
+ }
[[ "${extinstops}" == *" ${prev} "* ]] && {
__installed_extension
return 0
@@ -154,9 +165,12 @@ _dwbem() {
--*)
COMPREPLY=( $( compgen -W "${lopts}" -- $cur ) )
return 0;;
- *)
+ -*)
COMPREPLY=( $( compgen -W "${opts} ${lopts}" -- $cur ) )
return 0;;
+ *)
+ _filedir
+ return 0;;
esac
} &&
complete -F _dwbem dwbem