X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=shell-completion%2Fbash%2Floginctl;h=e7adb93f97b03599692f6ebc9fea2caa73b4a2fb;hp=3104b305fa49b55c5e344b67272730ed4c96e4b1;hb=0eb3cc88504b5d8f740764047ac5162b67992386;hpb=a72d698d0d9ff9c158155b44cdc77376df31a317 diff --git a/shell-completion/bash/loginctl b/shell-completion/bash/loginctl index 3104b305f..e7adb93f9 100644 --- a/shell-completion/bash/loginctl +++ b/shell-completion/bash/loginctl @@ -24,9 +24,9 @@ __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]} @@ -70,7 +70,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]}