diff options
| author | Sami Kerola <kerolasa@iki.fi> | 2017-06-30 23:13:58 +0100 |
|---|---|---|
| committer | Sami Kerola <kerolasa@iki.fi> | 2017-07-15 22:05:42 +0100 |
| commit | abbcec4fc9c8d7fb835b4eafd1bc9d82acbf0056 (patch) | |
| tree | ce554d5e4e09146e5df0cfaa6c014afbf9b09357 /bash-completion | |
| parent | 5d70066c1a8d92d10202f9a1e0ea9eb9feb1c6a5 (diff) | |
| download | util-linux-abbcec4fc9c8d7fb835b4eafd1bc9d82acbf0056.tar.gz | |
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>
Diffstat (limited to 'bash-completion')
| -rw-r--r-- | bash-completion/blkid | 2 | ||||
| -rw-r--r-- | bash-completion/fdisk | 2 | ||||
| -rw-r--r-- | bash-completion/fincore | 2 | ||||
| -rw-r--r-- | bash-completion/findmnt | 2 | ||||
| -rw-r--r-- | bash-completion/losetup | 2 | ||||
| -rw-r--r-- | bash-completion/lsipc | 2 | ||||
| -rw-r--r-- | bash-completion/lslocks | 2 | ||||
| -rw-r--r-- | bash-completion/lsmem | 2 | ||||
| -rw-r--r-- | bash-completion/partx | 2 | ||||
| -rw-r--r-- | bash-completion/prlimit | 2 | ||||
| -rw-r--r-- | bash-completion/sfdisk | 2 | ||||
| -rw-r--r-- | bash-completion/swapon | 2 | ||||
| -rw-r--r-- | bash-completion/wdctl | 2 | ||||
| -rw-r--r-- | bash-completion/zramctl | 2 |
14 files changed, 14 insertions, 14 deletions
diff --git a/bash-completion/blkid b/bash-completion/blkid index eb2ecf3fe0..57b34c3f45 100644 --- a/bash-completion/blkid +++ b/bash-completion/blkid @@ -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 diff --git a/bash-completion/fdisk b/bash-completion/fdisk index ef6c5beb4b..855de1468d 100644 --- a/bash-completion/fdisk +++ b/bash-completion/fdisk @@ -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 diff --git a/bash-completion/fincore b/bash-completion/fincore index 4988f198bf..3639763b56 100644 --- a/bash-completion/fincore +++ b/bash-completion/fincore @@ -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 diff --git a/bash-completion/findmnt b/bash-completion/findmnt index 5583fbf6c5..bdfa5de5ce 100644 --- a/bash-completion/findmnt +++ b/bash-completion/findmnt @@ -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 diff --git a/bash-completion/losetup b/bash-completion/losetup index 7fee1d0ae2..b58d8de948 100644 --- a/bash-completion/losetup +++ b/bash-completion/losetup @@ -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 diff --git a/bash-completion/lsipc b/bash-completion/lsipc index ffe44b7d1f..a40fe42860 100644 --- a/bash-completion/lsipc +++ b/bash-completion/lsipc @@ -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 diff --git a/bash-completion/lslocks b/bash-completion/lslocks index 4ca1e6b6e5..acc7b1ff6d 100644 --- a/bash-completion/lslocks +++ b/bash-completion/lslocks @@ -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 diff --git a/bash-completion/lsmem b/bash-completion/lsmem index 85cf3e01a6..8f7a46ec30 100644 --- a/bash-completion/lsmem +++ b/bash-completion/lsmem @@ -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 diff --git a/bash-completion/partx b/bash-completion/partx index 929000013c..2368336edd 100644 --- a/bash-completion/partx +++ b/bash-completion/partx @@ -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 diff --git a/bash-completion/prlimit b/bash-completion/prlimit index fff7a85c52..f5e00bb167 100644 --- a/bash-completion/prlimit +++ b/bash-completion/prlimit @@ -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 diff --git a/bash-completion/sfdisk b/bash-completion/sfdisk index c00e8c799b..9401f89ac0 100644 --- a/bash-completion/sfdisk +++ b/bash-completion/sfdisk @@ -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 diff --git a/bash-completion/swapon b/bash-completion/swapon index fc80af5eb7..4a53ec5aca 100644 --- a/bash-completion/swapon +++ b/bash-completion/swapon @@ -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 diff --git a/bash-completion/wdctl b/bash-completion/wdctl index 811b5e3ccb..f1a870ef69 100644 --- a/bash-completion/wdctl +++ b/bash-completion/wdctl @@ -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 diff --git a/bash-completion/zramctl b/bash-completion/zramctl index 8c7767ce02..672d8102ad 100644 --- a/bash-completion/zramctl +++ b/bash-completion/zramctl @@ -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 |
