summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2014-03-01 21:10:38 +0100
committerJouke Witteveen <j.witteveen@gmail.com>2014-03-01 22:16:51 +0100
commit965c476fd5cd10885a7708f0c111c51e697d6694 (patch)
treef120e08ec34de39f0b1173d9783b35497ba5d39c
parente5ac40075728c92775ce974dcdaf1a60a9533e4b (diff)
downloadnetctl-965c476fd5cd10885a7708f0c111c51e697d6694.tar.gz
netctl-965c476fd5cd10885a7708f0c111c51e697d6694.tar.xz
Update bash-completion for netctl-auto
-rw-r--r--contrib/bash-completion9
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/bash-completion b/contrib/bash-completion
index 5a2dd12..e4fd50a 100644
--- a/contrib/bash-completion
+++ b/contrib/bash-completion
@@ -39,8 +39,13 @@ _netctl_auto()
local cur=${COMP_WORDS[COMP_CWORD]}
case $COMP_CWORD in
- 1) COMPREPLY=( $(compgen -W "start stop" -- "$cur") );;
- 2) COMPREPLY=( $(compgen -W "$(_wireless_interfaces)" -- "$cur") );;
+ 1)
+ COMPREPLY=( $(compgen -W "--help --version list current switch-to enable disable enable-all disable-all" -- "$cur") )
+ ;;
+ 2)
+ [[ ${COMP_WORDS[COMP_CWORD-1]} = @(switch-to|enable|disable) ]] &&
+ mapfile -t COMPREPLY < <(IFS=$'\n'; compgen -W "$(_netctl_profiles)" -- "$cur")
+ ;;
esac
} &&
complete -F _netctl_auto netctl-auto