bash-completion: make completions to work when bash set -u is in use

User who want to avoid refering to none-existing variables got earlier the
following error.

$ set -u
$ findmnt --output <tab>bash: OUTPUT: unbound variable

Here is short explanation of this setting.

$ help set
 -u  Treat unset variables as an error when substituting.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2017-06-30 23:13:58 +01:00
parent 5d70066c1a
commit abbcec4fc9
No known key found for this signature in database
GPG Key ID: A9553245FDE9B739
14 changed files with 14 additions and 14 deletions

View File

@ -59,7 +59,7 @@ _blkid_module()
prefix="${cur%$realcur}"
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace

View File

@ -49,7 +49,7 @@ _fdisk_module()
"
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace

View File

@ -12,7 +12,7 @@ _fincore_module()
OUTPUT_ALL='PAGES SIZE FILE RES'
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace

View File

@ -55,7 +55,7 @@ _findmnt_module()
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace

View File

@ -33,7 +33,7 @@ _losetup_module()
SIZELIMIT DIO"
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace

View File

@ -35,7 +35,7 @@ _lsipc_module()
"
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace

View File

@ -20,7 +20,7 @@ _lslocks_module()
OUTPUT_ALL="COMMAND PID TYPE SIZE MODE M START END PATH BLOCKER"
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace

View File

@ -12,7 +12,7 @@ _lsmem_module()
OUTPUT_ALL='RANGE SIZE STATE REMOVABLE BLOCK NODE'
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace

View File

@ -15,7 +15,7 @@ _partx_module()
prefix="${cur%$realcur}"
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace

View File

@ -17,7 +17,7 @@ _prlimit_module()
OUTPUT_ALL="DESCRIPTION RESOURCE SOFT HARD UNITS"
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace

View File

@ -28,7 +28,7 @@ _sfdisk_module()
"
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace

View File

@ -18,7 +18,7 @@ _swapon_module()
OUTPUT_ALL="NAME TYPE SIZE USED PRIO UUID LABEL"
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace

View File

@ -29,7 +29,7 @@ _wdctl_module()
OUTPUT_ALL="FLAG DESCRIPTION STATUS BOOT-STATUS DEVICE"
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace

View File

@ -18,7 +18,7 @@ _zramctl_module()
MIGRATED MOUNTPOINT"
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace