From 0cc69f13c2355831e8f07962c072c09ca35fd5f3 Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Tue, 6 Jan 2015 19:31:39 +0100 Subject: Add edit subcommand to netctl --- contrib/bash-completion | 4 ++-- contrib/zsh-completion | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'contrib') diff --git a/contrib/bash-completion b/contrib/bash-completion index 0e5804f..4f73fab 100644 --- a/contrib/bash-completion +++ b/contrib/bash-completion @@ -23,10 +23,10 @@ _netctl() case $COMP_CWORD in 1) - COMPREPLY=( $(compgen -W "--help --version list store restore stop-all start stop restart switch-to status enable disable is-enabled reenable" -- "$cur") ) + COMPREPLY=( $(compgen -W "--help --version list store restore stop-all start stop restart switch-to status enable disable reenable is-enabled edit" -- "$cur") ) ;; 2) - [[ ${COMP_WORDS[COMP_CWORD-1]} = @(start|stop|restart|switch-to|status|enable|disable|is-enabled|reenable) ]] && + [[ ${COMP_WORDS[COMP_CWORD-1]} = @(start|stop|restart|switch-to|status|enable|disable|reenable|is-enabled|edit) ]] && mapfile -t COMPREPLY < <(IFS=$'\n'; compgen -W "$(_netctl_profiles)" -- "$cur") ;; esac diff --git a/contrib/zsh-completion b/contrib/zsh-completion index 8e88437..05c506f 100644 --- a/contrib/zsh-completion +++ b/contrib/zsh-completion @@ -11,7 +11,7 @@ _wireless_interfaces() { (( $+function[_netctl_command] )) || _netctl_command() { - [[ $words[1] = (start|stop|restart|switch-to|status|enable|disable|is-enabled|reenable) ]] && + [[ $words[1] = (start|stop|restart|switch-to|status|enable|disable|reenable|is-enabled|edit) ]] && compadd "${(f)$(find -L /etc/netctl -maxdepth 1 -type f -not -name '.*' -not -name '*~' -not -name '*.conf' -not -name '*.service' -printf "%f\n")}" } @@ -30,8 +30,9 @@ _netctl_commands() { 'status:Show runtime status of a profile' 'enable:Enable the systemd unit for a profile' 'disable:Disable the systemd unit for a profile' - 'is-enabled:Check whether a profile is enabled' 'reenable:Reenable the systemd unit for a profile' + 'is-enabled:Check whether a profile is enabled' + 'edit:Edit a profile' ) _describe "netctl commands" _commands } -- cgit v1.2.3-24-g4f1b