]> git.ipfire.org Git - thirdparty/util-linux.git/commit - bash-completion/mkswap
bash-completion: Standardize fsck/mkfs file/device
authorKevin Locke <kevin@kevinlocke.name>
Thu, 19 Sep 2019 13:27:31 +0000 (07:27 -0600)
committerKevin Locke <kevin@kevinlocke.name>
Thu, 19 Sep 2019 13:27:31 +0000 (07:27 -0600)
commit559888c873a196c790137bbeee678dc5212c4430
treee08a0763838b1fc608c46c22bf01345cdd4c292d
parentd978ec31f71308f2c9a7e0eae121165b33bd3237
bash-completion: Standardize fsck/mkfs file/device

Some of the fsck and mkfs commands complete differently than the others,
and differently than the desired behavior.[1]  Standardize on completing
with $(lsblk -pnro name):

* fsck: Don't complete completes on all block devices and device links
  under /dev immediately (which is excessive and prone to search
  problems).
* mkfs, mkfs.bfs: Don't complete "/path/to/file" literally.  I assume
  this was copy/pasted from example code, since it does not appear to be
  a valid argument unless it is a valid path, which is rare.
* fsck.cramfs, mkfs, mkfs.bfs, mkfs.cramfs, mkswap: Don't complete on
  all filenames initially.  The desired behavior is to complete
  filenames only if there are no canonical matches.[1]

Note: A subsequent commit will add the desired fallback behavior.

[1]: https://github.com/karelzak/util-linux/issues/842#issuecomment-523450243

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
bash-completion/fsck
bash-completion/fsck.cramfs
bash-completion/mkfs
bash-completion/mkfs.bfs
bash-completion/mkfs.cramfs
bash-completion/mkswap