summaryrefslogtreecommitdiffstats
path: root/bash-completion/lsblk
diff options
context:
space:
mode:
Diffstat (limited to 'bash-completion/lsblk')
-rw-r--r--bash-completion/lsblk10
1 files changed, 5 insertions, 5 deletions
diff --git a/bash-completion/lsblk b/bash-completion/lsblk
index 4fef8fc84..bd86f9f79 100644
--- a/bash-completion/lsblk
+++ b/bash-completion/lsblk
@@ -20,15 +20,15 @@ _lsblk_module()
prefix="${cur%$realcur}"
for I in /sys/dev/block/*; do
J=${I##*/}
- MAJOR_ALL="$MAJOR_ALL ${J%%:*}"
+ MAJOR_ALL="${MAJOR_ALL:-""} ${J%%:*}"
done
- for WORD in $MAJOR_ALL; do
+ for WORD in ${MAJOR_ALL:-""}; do
if ! [[ $prefix == *"$WORD"* ]]; then
- MAJOR="$WORD $MAJOR"
+ MAJOR="$WORD ${MAJOR:-""}"
fi
done
compopt -o nospace
- COMPREPLY=( $(compgen -P "$prefix" -W "$MAJOR" -S ',' -- $realcur) )
+ COMPREPLY=( $(compgen -P "$prefix" -W "${MAJOR:-""}" -S ',' -- $realcur) )
return 0
;;
'-o'|'--output')
@@ -37,7 +37,7 @@ _lsblk_module()
prefix="${cur%$realcur}"
for WORD in $LSBLK_COLS_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
- LSBLK_COLS="$WORD $LSBLK_COLS"
+ LSBLK_COLS="$WORD ${LSBLK_COLS:-""}"
fi
done
compopt -o nospace