From 53471b775ec2ec5b1401752c2955873f25634b13 Mon Sep 17 00:00:00 2001 From: portix Date: Tue, 21 May 2013 12:07:41 +0200 Subject: Error message when including archive fails, bash-completion for --archive --- contrib/bash-completion | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'contrib/bash-completion') 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 -- cgit v1.2.3