diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-04-10 19:31:58 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-04-10 19:47:21 -0400 |
commit | c2e09812e9c088f1582ce542e43f6b5743b2e4fe (patch) | |
tree | 7b1916c2714487f17c0688e8d673591908843e18 /shell-completion/systemd-zsh-completion.zsh | |
parent | 79c1638303142b81e1b72dd5bde0c656ccf19999 (diff) |
shell-completion: show failed units as candidates for start
Also show disabled units as candidates for reenable,
since it works and one may want to do enable-or-reenable
in one line.
Diffstat (limited to 'shell-completion/systemd-zsh-completion.zsh')
-rw-r--r-- | shell-completion/systemd-zsh-completion.zsh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/shell-completion/systemd-zsh-completion.zsh b/shell-completion/systemd-zsh-completion.zsh index 52a5fdb460..a54e9d727a 100644 --- a/shell-completion/systemd-zsh-completion.zsh +++ b/shell-completion/systemd-zsh-completion.zsh @@ -455,7 +455,7 @@ _filter_units_by_property() { } _systemctl_active_units() {_sys_active_units=( $(__systemctl list-units | { while read a b; do echo " $a"; done; }) )} -_systemctl_inactive_units(){_sys_inactive_units=($(__systemctl list-units --all | { while read a b c d; do [[ $c == "inactive" ]] && echo " $a"; done; }) )} +_systemctl_inactive_units(){_sys_inactive_units=($(__systemctl list-units --all | { while read a b c d; do [[ $c == "inactive" || $c == "failed" ]] && echo " $a"; done; }) )} _systemctl_failed_units() {_sys_failed_units=( $(__systemctl list-units --failed | { while read a b; do echo " $a"; done; }) )} _systemctl_enabled_units() {_sys_enabled_units=( $(__systemctl list-unit-files | { while read a b; do [[ $b == "enabled" ]] && echo " $a"; done; }) )} _systemctl_disabled_units(){_sys_disabled_units=($(__systemctl list-unit-files | { while read a b; do [[ $b == "disabled" ]] && echo " $a"; done; }) )} @@ -475,7 +475,8 @@ for fun in disable reenable ; do (( $+functions[_systemctl_$fun] )) || _systemctl_$fun() { _systemctl_enabled_units - compadd "$@" -a - _sys_enabled_units + _systemctl_disabled_units + compadd "$@" -a - _sys_enabled_units _sys_disabled_units } done |