summaryrefslogtreecommitdiff
path: root/shell-completion/bash
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-04-10 22:40:58 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-04-11 19:11:52 -0400
commit20b3f379cfd44e61dd1838a107f1d5363fab5b5d (patch)
tree026941d6a711a91d38e4422c99215c8ecbf6e8b1 /shell-completion/bash
parent296f3c53cb4a87e297c019475f900fb3cca2d781 (diff)
systemctl: allow multiple arguments to --type
This mirrors --property, and is generally useful. New functionality is used in bash completion. In case of zsh completion, new functionality is less useful because of caching. Nevertheless, zsh completion for restart is made to behave more-or-less the same as bash completion. At least sockets can be restarted.
Diffstat (limited to 'shell-completion/bash')
-rw-r--r--shell-completion/bash/systemctl7
1 files changed, 2 insertions, 5 deletions
diff --git a/shell-completion/bash/systemctl b/shell-completion/bash/systemctl
index aba76f6543..f24a145424 100644
--- a/shell-completion/bash/systemctl
+++ b/shell-completion/bash/systemctl
@@ -45,7 +45,7 @@ __get_all_units () { __systemctl $1 list-units --all \
| { while read -r a b; do echo " $a"; done; }; }
__get_active_units () { __systemctl $1 list-units \
| { while read -r a b; do echo " $a"; done; }; }
-__get_inactive_units () { __systemctl $1 list-units --all \
+__get_startable_units () { __systemctl $1 list-units --all -t service,timer,socket,mount,automount,path,snapshot,swap \
| { while read -r a b c d; do [[ $c == "inactive" || $c == "failed " ]] && echo " $a"; done; }; }
__get_failed_units () { __systemctl $1 list-units \
| { while read -r a b c d; do [[ $c == "failed" ]] && echo " $a"; done; }; }
@@ -156,10 +156,7 @@ _systemctl () {
elif __contains_word "$verb" ${VERBS[STARTABLE_UNITS]}; then
comps=$( __filter_units_by_property $mode CanStart yes \
- $( __get_inactive_units $mode \
- | while read -r line; do \
- [[ "$line" =~ \.(device|snapshot)$ ]] || echo " $line"; \
- done ))
+ $( __get_startable_units $mode))
elif __contains_word "$verb" ${VERBS[RESTARTABLE_UNITS]}; then
comps=$( __filter_units_by_property $mode CanStart yes \