diff options
author | 2018-12-14 02:22:40 +0900 | |
---|---|---|
committer | 2018-12-14 02:22:40 +0900 | |
commit | 3b59e2cbede76f9f63eda844b1905567adbdae5b (patch) | |
tree | 261d15f87dd20d41f1b16f4529e9c5238e9bc696 /shell-completion | |
parent | bash-completion: loginctl: suggest argument for --output option (diff) | |
download | systemd-3b59e2cbede76f9f63eda844b1905567adbdae5b.tar.gz systemd-3b59e2cbede76f9f63eda844b1905567adbdae5b.tar.bz2 systemd-3b59e2cbede76f9f63eda844b1905567adbdae5b.zip |
bash-completion: loginctl: suggest argument for --machine option
Diffstat (limited to 'shell-completion')
-rw-r--r-- | shell-completion/bash/loginctl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/shell-completion/bash/loginctl b/shell-completion/bash/loginctl index c7593ab40..a0d224e9e 100644 --- a/shell-completion/bash/loginctl +++ b/shell-completion/bash/loginctl @@ -29,6 +29,12 @@ __get_all_sessions () { loginctl --no-legend list-sessions | { while read -r a b __get_all_users () { loginctl --no-legend list-users | { while read -r a b; do printf "%s\n" "$b"; done; } ; } __get_all_seats () { loginctl --no-legend list-seats | { while read -r a b; do printf "%s\n" "$a"; done; } ; } +__get_machines() { + local a b + machinectl list --no-legend --no-pager 2>/dev/null | + { while read a b; do echo " $a"; done; }; +} + _loginctl () { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local i verb comps @@ -52,6 +58,9 @@ _loginctl () { --host|-H) comps=$(compgen -A hostname) ;; + --machine|-M) + comps=$( __get_machines ) + ;; --property|-p) comps='' ;; |