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>
pull/486/head
Sami Kerola 5 years ago
parent 5d70066c1a
commit abbcec4fc9
No known key found for this signature in database
GPG Key ID: A9553245FDE9B739
  1. 2
      bash-completion/blkid
  2. 2
      bash-completion/fdisk
  3. 2
      bash-completion/fincore
  4. 2
      bash-completion/findmnt
  5. 2
      bash-completion/losetup
  6. 2
      bash-completion/lsipc
  7. 2
      bash-completion/lslocks
  8. 2
      bash-completion/lsmem
  9. 2
      bash-completion/partx
  10. 2
      bash-completion/prlimit
  11. 2
      bash-completion/sfdisk
  12. 2
      bash-completion/swapon
  13. 2
      bash-completion/wdctl
  14. 2
      bash-completion/zramctl

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

Loading…
Cancel
Save