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 solution can become messy when you have too many options listed,
because it repeats all of them. For example, after invoking completion
with this input:
$ partx --output END,SECTORS,SCHEME,START,
You got these completions:
END,SECTORS,SCHEME,START,FLAGS, END,SECTORS,SCHEME,START,NR,
END,SECTORS,SCHEME,START,TYPE,
END,SECTORS,SCHEME,START,NAME, END,SECTORS,SCHEME,START,SIZE,
END,SECTORS,SCHEME,START,UUID,
Nevertheless, it works even with numbers (listed options properly
excluded from completion). Try to invoke completion after
'chcpu --disable ' or 'lsblk --exclude ' to see it in action.
Few issues remained:
* completion interrupts after encountering ':' in listed option,
like in 'MAJ:MIN' in lsblk, losetup.
* lscpu completion is broken: it inserts space after '--extended',
but lscpu assumes there is no space after this option. It also
doesn't complete '--parse' option.
* some completion options are outdated (for example, lscpu MMHZ). We
need to sync them with code. Fix for lscpu follows.
Signed-off-by: Boris Egorov <egorov@linux.com>