summaryrefslogtreecommitdiff
path: root/shell-completion
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-01-10 18:10:05 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-01-10 23:18:16 +0900
commit035dd8c0a345eb8e07c3b4bf6b61633f242641aa (patch)
treee784c582d0b59f7fe976e587d25cd6289dddfc83 /shell-completion
parentf568dcd1013877b65d9b0ef4333d4cfdba19819c (diff)
bash-completion: systemctl: add missing options and verbs
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/bash/systemctl.in14
1 files changed, 8 insertions, 6 deletions
diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in
index 5a353f7107..080deeaace 100644
--- a/shell-completion/bash/systemctl.in
+++ b/shell-completion/bash/systemctl.in
@@ -126,10 +126,10 @@ _systemctl () {
local -A OPTS=(
[STANDALONE]='--all -a --reverse --after --before --defaults --force -f --full -l --global
--help -h --no-ask-password --no-block --no-legend --no-pager --no-reload --no-wall --now
- --quiet -q --privileged -P --system --user --version --runtime --recursive -r --firmware-setup
- --show-types -i --ignore-inhibitors --plain --failed'
+ --quiet -q --system --user --version --runtime --recursive -r --firmware-setup
+ --show-types -i --ignore-inhibitors --plain --failed --value --fail --dry-run --wait'
[ARG]='--host -H --kill-who --property -p --signal -s --type -t --state --job-mode --root
- --preset-mode -n --lines -o --output -M --machine'
+ --preset-mode -n --lines -o --output -M --machine --message'
)
if __contains_word "--user" ${COMP_WORDS[*]}; then
@@ -203,14 +203,15 @@ _systemctl () {
[TARGET_AND_UNITS]='add-wants add-requires'
[MASKED_UNITS]='unmask'
[JOBS]='cancel'
- [ENVS]='set-environment unset-environment'
+ [ENVS]='set-environment unset-environment import-environment'
[STANDALONE]='daemon-reexec daemon-reload default
emergency exit halt hibernate hybrid-sleep kexec list-jobs
list-sockets list-timers list-units list-unit-files poweroff
reboot rescue show-environment suspend get-default
- is-system-running'
+ is-system-running preset-all'
[FILE]='link switch-root'
[TARGETS]='set-default'
+ [MACHINES]='list-machines'
)
for ((i=0; i < COMP_CWORD; i++)); do
@@ -294,12 +295,13 @@ _systemctl () {
elif __contains_word "$verb" ${VERBS[ENVS]}; then
comps=$( __systemctl $mode show-environment \
- | while read -r line; do echo " ${line%%=*}=";done )
+ | while read -r line; do echo " ${line%%=*}="; done )
compopt -o nospace
elif __contains_word "$verb" ${VERBS[FILE]}; then
comps=$( compgen -A file -- "$cur" )
compopt -o filenames
+
elif __contains_word "$verb" ${VERBS[TARGETS]}; then
comps=$( __systemctl $mode list-unit-files --type target --full --all \
| { while read -r a b; do echo " $a"; done; } )