From 965c476fd5cd10885a7708f0c111c51e697d6694 Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Sat, 1 Mar 2014 21:10:38 +0100 Subject: Update bash-completion for netctl-auto --- contrib/bash-completion | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'contrib') 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 -- cgit v1.2.3-24-g4f1b