1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

Merge pull request #19991 from bluca/bash_compl_unbound_vars

completion: fix 'unbound variables' errors
This commit is contained in:
Yu Watanabe 2021-06-23 01:44:30 +09:00 committed by GitHub
commit de806cd6b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 21 additions and 21 deletions

View File

@ -69,7 +69,7 @@ _bootctl() {
fi
done
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
comps=''

View File

@ -140,7 +140,7 @@ _busctl() {
n=$(($COMP_CWORD - $i))
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
comps=''

View File

@ -83,7 +83,7 @@ _coredumpctl() {
fi
done
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[LIST]} ${VERBS[DUMP]}; then
comps=''

View File

@ -170,7 +170,7 @@ _homectl() {
fi
done
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[NAME]}; then
comps=$(__get_homes)

View File

@ -39,7 +39,7 @@ _hostnamectl() {
[ARG]='-H --host -M --machine --json'
)
if __contains_word "$prev" ${OPTS[ARG]} ${OPTS[ARGUNKNOWN]}; then
if __contains_word "$prev" ${OPTS[ARG]}; then
case $prev in
--host|-H)
comps=$(compgen -A hostname)
@ -77,7 +77,7 @@ _hostnamectl() {
fi
done
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[CHASSIS]}; then
comps='desktop laptop convertible server tablet handset watch embedded vm container'

View File

@ -67,7 +67,7 @@ _localectl() {
fi
done
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[VARIANTS]}; then
comps=$(command localectl list-x11-keymap-layouts)

View File

@ -93,7 +93,7 @@ _loginctl () {
fi
done
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps="${VERBS[*]}"
elif __contains_word "$verb" ${VERBS[SESSIONS]}; then

View File

@ -95,7 +95,7 @@ _machinectl() {
return 0
fi
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then

View File

@ -69,7 +69,7 @@ _networkctl() {
return 0
fi
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
comps=''

View File

@ -79,7 +79,7 @@ _portablectl() {
n=$(($COMP_CWORD - $i))
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
comps=''

View File

@ -87,7 +87,7 @@ _resolvectl() {
fi
done
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps="${VERBS[*]}"
elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[DOMAIN]}; then

View File

@ -254,7 +254,7 @@ _systemctl () {
cur_orig="$(printf '%q' $cur)"
fi
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps="${VERBS[*]}"
elif __contains_word "$verb" ${VERBS[ALL_UNITS]}; then

View File

@ -93,12 +93,12 @@ _systemd_analyze() {
return 0
fi
if [[ -z $verb && $cur = -* ]]; then
if [[ -z ${verb-} && $cur = -* ]]; then
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
return 0
fi
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then

View File

@ -48,12 +48,12 @@ _systemd-delta() {
return 0
fi
if [[ "$cur" = -* ]]; then
if [[ "$cur" = -* ]] || [[ -z ${comps-} ]]; then
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
return 0
fi
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
COMPREPLY=( $(compgen -W '${comps-}' -- "$cur") )
return 0
}

View File

@ -61,7 +61,7 @@ _systemd_id128() {
fi
done
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
comps=''

View File

@ -71,7 +71,7 @@ _systemd-resolve() {
return 0
fi
if [[ "$cur" = -* ]]; then
if [[ "$cur" = -* ]] || [[ -z ${comps-} ]]; then
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
return 0
fi

View File

@ -76,7 +76,7 @@ _timedatectl() {
fi
done
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[BOOLEAN]}; then
comps='true false'

View File

@ -73,7 +73,7 @@ _udevadm() {
fi
done
if [[ -z $verb ]]; then
if [[ -z ${verb-} ]]; then
if [[ "$cur" = -* ]]; then
COMPREPLY=( $(compgen -W '${OPTS[COMMON]} ${OPTS[DEBUG]}' -- "$cur") )
else