summaryrefslogtreecommitdiffstats
path: root/shell-completion
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-06-22 15:56:19 +0200
committerLuca Boccassi <luca.boccassi@microsoft.com>2021-06-22 15:56:47 +0200
commit36ec026830c6978be8bd39f3c6d1d7822495e07f (patch)
tree6d0fa55ac2901264012977d7cde0dd9baf703ba4 /shell-completion
parentcompletion/systemd-delta,-resolve: autocomplete with parameters (diff)
downloadsystemd-36ec026830c6978be8bd39f3c6d1d7822495e07f.tar.xz
systemd-36ec026830c6978be8bd39f3c6d1d7822495e07f.zip
completion: fix 'unbound variables' errors
Fixes https://github.com/systemd/systemd/issues/19987
Diffstat (limited to 'shell-completion')
-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 5fc11fdbd2..54b8572515 100644
--- a/shell-completion/bash/coredumpctl
+++ b/shell-completion/bash/coredumpctl
@@ -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=''
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 0f69e23e6f..6f1909b599 100644
--- a/shell-completion/bash/hostnamectl
+++ b/shell-completion/bash/hostnamectl
@@ -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'
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 f94f191d89..2d03fcca3e 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 1e4d0a2aae..40ac13abf8 100644
--- a/shell-completion/bash/networkctl
+++ b/shell-completion/bash/networkctl
@@ -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=''
diff --git a/shell-completion/bash/portablectl b/shell-completion/bash/portablectl
index e18d04c7ea..a0ccc733ad 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 e6e6ca0d7e..b61f88b012 100644
--- a/shell-completion/bash/systemctl.in
+++ b/shell-completion/bash/systemctl.in
@@ -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
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 d2c325b868..81036f3588 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