X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=shell-completion%2Fbash%2Floginctl;h=7a083d28756cde70594649ea676402b589bebdec;hp=b0816a3b868ed39a29412f211d7b9fcd05aa1549;hb=4f3c1682029450f5d93cb282343035d0cf3dd407;hpb=86cb0691b71873c6fe30a103dc98153e2d9ab507 diff --git a/shell-completion/bash/loginctl b/shell-completion/bash/loginctl index b0816a3b8..7a083d287 100644 --- a/shell-completion/bash/loginctl +++ b/shell-completion/bash/loginctl @@ -24,18 +24,19 @@ __contains_word () { done } -__get_all_sessions () { loginctl list-sessions | { while read -r a b; do printf "%s\n" "$a"; done; } ; } -__get_all_users () { loginctl list-users | { while read -r a b; do printf "%s\n" "$b"; done; } ; } -__get_all_seats () { loginctl list-seats | { while read -r a b; do printf "%s\n" "$a"; done; } ; } +__get_all_sessions () { loginctl --no-legend list-sessions | { while read -r a b; do printf "%s\n" "$a"; done; } ; } +__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; } ; } _loginctl () { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local i verb comps local -A OPTS=( - [STANDALONE]='--all -a --help -h --no-pager --privileged -P --version' - [ARG]='--host -H --kill-who --property -p --signal -s' - ) + [STANDALONE]='--all -a --help -h --no-pager --privileged -P --version + --no-legend --no-ask-password -l --full' + [ARG]='--host -H --kill-who --property -p --signal -s --machine' + ) if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in @@ -70,7 +71,7 @@ _loginctl () { [ATTACH]='attach' ) - for ((i=0; i <= COMP_CWORD; i++)); do + for ((i=0; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then verb=${COMP_WORDS[i]}