summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-06-22 14:56:19 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-07-20 17:54:10 +0200
commit173d07a916f0a76a69b0ef4a26c0df5111cf9c70 (patch)
tree68a6b3800a4d0ebcd7c12b8ccbe1594937cbf144
parentb9b3d623fc919757d48f89394c0c325355eefde9 (diff)
downloadsystemd-173d07a916f0a76a69b0ef4a26c0df5111cf9c70.tar.gz
completion: fix 'unbound variables' errors
Fixes https://github.com/systemd/systemd/issues/19987 (cherry picked from commit 36ec026830c6978be8bd39f3c6d1d7822495e07f) (cherry picked from commit fe13c0bd40bc5ccdda61b8b474194920543a617b)
-rw-r--r--shell-completion/bash/bootctl2
-rw-r--r--shell-completion/bash/busctl2
-rw-r--r--shell-completion/bash/coredumpctl2
-rw-r--r--shell-completion/bash/homectl2
-rw-r--r--shell-completion/bash/hostnamectl2
-rw-r--r--shell-completion/bash/localectl2
-rw-r--r--shell-completion/bash/loginctl2
-rw-r--r--shell-completion/bash/machinectl2
-rw-r--r--shell-completion/bash/networkctl2
-rw-r--r--shell-completion/bash/portablectl2
-rw-r--r--shell-completion/bash/resolvectl2
-rw-r--r--shell-completion/bash/systemctl.in2
-rw-r--r--shell-completion/bash/systemd-analyze4
-rw-r--r--shell-completion/bash/systemd-delta2
-rw-r--r--shell-completion/bash/systemd-id1282
-rw-r--r--shell-completion/bash/timedatectl2
-rw-r--r--shell-completion/bash/udevadm2
17 files changed, 18 insertions, 18 deletions
diff --git a/shell-completion/bash/bootctl b/shell-completion/bash/bootctl
index 391fa67bfc..e61188fee9 100644
--- a/shell-completion/bash/bootctl
+++ b/shell-completion/bash/bootctl
@@ -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=''
diff --git a/shell-completion/bash/busctl b/shell-completion/bash/busctl
index 5a4acd337f..1cc41d4618 100644
--- a/shell-completion/bash/busctl
+++ b/shell-completion/bash/busctl
@@ -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=''
diff --git a/shell-completion/bash/coredumpctl b/shell-completion/bash/coredumpctl
index 20886932e2..7b50ed610d 100644
--- a/shell-completion/bash/coredumpctl
+++ b/shell-completion/bash/coredumpctl
@@ -80,7 +80,7 @@ _coredumpctl() {
fi
done
- if [[ -z $verb ]]; then
+ if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[LIST]} ${VERBS[DUMP]}; then
comps=''
diff --git a/shell-completion/bash/homectl b/shell-completion/bash/homectl
index fe909fbb41..f738bfb37f 100644
--- a/shell-completion/bash/homectl
+++ b/shell-completion/bash/homectl
@@ -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)
diff --git a/shell-completion/bash/hostnamectl b/shell-completion/bash/hostnamectl
index e3765c315c..71655cded4 100644
--- a/shell-completion/bash/hostnamectl
+++ b/shell-completion/bash/hostnamectl
@@ -50,7 +50,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'
diff --git a/shell-completion/bash/localectl b/shell-completion/bash/localectl
index fa0f8fdca1..987ae34cc9 100644
--- a/shell-completion/bash/localectl
+++ b/shell-completion/bash/localectl
@@ -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)
diff --git a/shell-completion/bash/loginctl b/shell-completion/bash/loginctl
index ac85519c10..c15cc458fb 100644
--- a/shell-completion/bash/loginctl
+++ b/shell-completion/bash/loginctl
@@ -93,7 +93,7 @@ _loginctl () {
fi
done
- if [[ -z $verb ]]; then
+ if [[ -z ${verb-} ]]; then
comps="${VERBS[*]}"
elif __contains_word "$verb" ${VERBS[SESSIONS]}; then
diff --git a/shell-completion/bash/machinectl b/shell-completion/bash/machinectl
index bc3a7889b3..0227167928 100644
--- a/shell-completion/bash/machinectl
+++ b/shell-completion/bash/machinectl
@@ -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
diff --git a/shell-completion/bash/networkctl b/shell-completion/bash/networkctl
index ab2a5f7015..d145015bf4 100644
--- a/shell-completion/bash/networkctl
+++ b/shell-completion/bash/networkctl
@@ -56,7 +56,7 @@ _networkctl() {
return 0
fi
- if [[ -z $verb ]]; then
+ if [[ -z ${verb-} ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
comps=''
diff --git a/shell-completion/bash/portablectl b/shell-completion/bash/portablectl
index fe3d925d78..0b3368c7dc 100644
--- a/shell-completion/bash/portablectl
+++ b/shell-completion/bash/portablectl
@@ -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=''
diff --git a/shell-completion/bash/resolvectl b/shell-completion/bash/resolvectl
index dae4330d4c..646a197a13 100644
--- a/shell-completion/bash/resolvectl
+++ b/shell-completion/bash/resolvectl
@@ -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
diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in
index b26381a324..ae1ed48590 100644
--- a/shell-completion/bash/systemctl.in
+++ b/shell-completion/bash/systemctl.in
@@ -249,7 +249,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
diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze
index eded49b50e..36fcf432ff 100644
--- a/shell-completion/bash/systemd-analyze
+++ b/shell-completion/bash/systemd-analyze
@@ -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
diff --git a/shell-completion/bash/systemd-delta b/shell-completion/bash/systemd-delta
index 1a24dc0710..f94c128533 100644
--- a/shell-completion/bash/systemd-delta
+++ b/shell-completion/bash/systemd-delta
@@ -53,7 +53,7 @@ _systemd-delta() {
return 0
fi
- COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
+ COMPREPLY=( $(compgen -W '${comps-}' -- "$cur") )
return 0
}
diff --git a/shell-completion/bash/systemd-id128 b/shell-completion/bash/systemd-id128
index 25110d1309..ad4731de18 100644
--- a/shell-completion/bash/systemd-id128
+++ b/shell-completion/bash/systemd-id128
@@ -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=''
diff --git a/shell-completion/bash/timedatectl b/shell-completion/bash/timedatectl
index 3e72ce6655..29dc27b39c 100644
--- a/shell-completion/bash/timedatectl
+++ b/shell-completion/bash/timedatectl
@@ -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'
diff --git a/shell-completion/bash/udevadm b/shell-completion/bash/udevadm
index 8b1b962f2d..e1c1997ffe 100644
--- a/shell-completion/bash/udevadm
+++ b/shell-completion/bash/udevadm
@@ -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