]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
completion: fix 'unbound variables' errors 19991/head
authorLuca Boccassi <luca.boccassi@microsoft.com>
Tue, 22 Jun 2021 13:56:19 +0000 (14:56 +0100)
committerLuca Boccassi <luca.boccassi@microsoft.com>
Tue, 22 Jun 2021 13:56:47 +0000 (14:56 +0100)
Fixes https://github.com/systemd/systemd/issues/19987

17 files changed:
shell-completion/bash/bootctl
shell-completion/bash/busctl
shell-completion/bash/coredumpctl
shell-completion/bash/homectl
shell-completion/bash/hostnamectl
shell-completion/bash/localectl
shell-completion/bash/loginctl
shell-completion/bash/machinectl
shell-completion/bash/networkctl
shell-completion/bash/portablectl
shell-completion/bash/resolvectl
shell-completion/bash/systemctl.in
shell-completion/bash/systemd-analyze
shell-completion/bash/systemd-delta
shell-completion/bash/systemd-id128
shell-completion/bash/timedatectl
shell-completion/bash/udevadm

index 391fa67bfc1c4c155112db1fc9747bc9694b28b8..e61188fee94047126a62a12f0caac7a75ef207a8 100644 (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=''
index 5a4acd337ff31e19aea5cadcae7705dc46402408..1cc41d461870b943dd4ca8897b2584d3b944906a 100644 (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=''
index 5fc11fdbd289acdbbbf28075c47274d986c57408..54b85725158b14ea690e4c8f336224df79e1fcc7 100644 (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=''
index fe909fbb41151343a62714efc2c6c2c610cd81d6..f738bfb37f1e78a90c35c3bd4fe114e59abc1fb7 100644 (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)
index 0f69e23e6f86eeb08ffa9d7ce00c029329cee539..6f1909b599486da86ed89a29dfb7fc765c558b1c 100644 (file)
@@ -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'
index fa0f8fdca1c9709b62a1d4ac163052cb64ce4925..987ae34cc9137b2ce7162c98b8056cd482bb1680 100644 (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)
index f94f191d89e7f8d21396b3b56ec941aac0d73391..2d03fcca3ede5753ec05834a7c0800ef4b5638ad 100644 (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
index bc3a7889b3882e1b0fb880ae1721c49b286a40d9..0227167928a756e5c79f720d5f620e8249297f27 100644 (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
index 1e4d0a2aaef9ccb924e54555e4958728b088c98f..40ac13abf860ab5db1f32b6d0b5478363d9503a4 100644 (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=''
index e18d04c7ea85d3a1e870c72f0e5b109ce5c8604b..a0ccc733adb8462c75e3f8c4dd93722b6ed4c1d3 100644 (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=''
index dae4330d4c5847a02dc5e1c72ec3367d3879dbf3..646a197a13f94e86465d7f62847d365e8bff2c1d 100644 (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
index e6e6ca0d7e03cecd22e0974a2b88b0f3d79b289d..b61f88b012c1ade6db29ba84cf349fdde01134d9 100644 (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
index eded49b50e7d769029c7c1e1eca62e3ab7c7c2d9..36fcf432ff91b92ed675862802cbeca0ee523feb 100644 (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
index 1a24dc07109889ab17271571e173936babb007e4..f94c1285332ad927ac41b07ed6c659b7919a1dd0 100644 (file)
@@ -53,7 +53,7 @@ _systemd-delta() {
         return 0
     fi
 
-    COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
+    COMPREPLY=( $(compgen -W '${comps-}' -- "$cur") )
     return 0
 }
 
index 25110d13091948c1d92e50a6bbf22c515f8e3aad..ad4731de18f8798bb4e33cb7d2c6c567702eef4e 100644 (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=''
index 3e72ce6655e1b80e8cd4cebbe4b3593243d93a8b..29dc27b39cc446283e5d4d4037ff6fc6eeb61f2b 100644 (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'
index d2c325b86866ad4f3623b8ec97a9c753f1f827a5..81036f35883726cac2364d831968487a1b6811dc 100644 (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