summaryrefslogtreecommitdiff
path: root/shell-completion
diff options
context:
space:
mode:
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/bash/systemctl7
-rw-r--r--shell-completion/systemd-zsh-completion.zsh2
2 files changed, 3 insertions, 6 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 \
diff --git a/shell-completion/systemd-zsh-completion.zsh b/shell-completion/systemd-zsh-completion.zsh
index a54e9d727a..8b60859c23 100644
--- a/shell-completion/systemd-zsh-completion.zsh
+++ b/shell-completion/systemd-zsh-completion.zsh
@@ -536,7 +536,7 @@ for fun in restart reload-or-restart ; do
_systemctl_all_units
compadd "$@" - $( _filter_units_by_property CanStart yes \
${_sys_all_units[*]} | while read line; do \
- [[ "$line" =~ \.(device|snapshot|socket|timer)$ ]] || echo " $line"; \
+ [[ "$line" =~ \.device$ ]] || echo " $line"; \
done )
}
done