Commit Graph

7 Commits

Author SHA1 Message Date
Sami Kerola 5adb0c9066 bash-completion: release preparations
6e103c7690 blkzone: Add --force option
9cd88771ef fdisk: add --lock and LOCK_BLOCK_DEVICE
921ceaca31 wipefs: add --lock and LOCK_BLOCK_DEVICE
c3ef1268a0 sfdisk: add --lock and LOCK_BLOCK_DEVICE
b8671fe763 mkswap: add --lock and LOCK_BLOCK_DEVICE
ec8f712157 cfdisk: add --lock and LOCK_BLOCK_DEVICE
f2229320a9 fdisk: add --noauto-pt
7f1f0584c2 nsenter: add support for the time namespace
dd52c4fa01 lsirq: add -n option
ee5a160250 sfdisk: add --relocate command
99d78b2fef fdisk: add --list-details
65e27d545c sfdisk: add --disk-id to change disk UUID/ID
34fed3ff17 blkdiscard: use O_EXCL, add --force

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-06-15 11:35:40 +02:00
Kevin Locke 0c8865f843 bash-completion: Add non-canonical device fallback
It is desirable for bash-completion to complete block devices via
symlinks (e.g. under /dev/disk) and with non-canonical locations (e.g.
./sda if $PWD is /dev, and /chroot/dev/sda).

Unfortunately, this is a non-trivial task due to how bash-completion
works.  It is necessary to un-escape the last partial argument, search,
then escape the results, ideally handling tilde and variable
expansion/completion.  See [_get_comp_words_by_ref] and [_filedir] in
the bash-completion project for details.

Given the development costs of a complete and correct implementation,
the annoyance/frustration which would result from an incomplete/buggy
implementation, and the trade-offs between under- and over-completion,
this commit adds fallback to bash default completion if the argument
does not match any canonical device names.  This correctly completes in
the cases mentioned above, although it incorrectly completes on
non-block-device files as well.

[_filedir]: https://github.com/scop/bash-completion/blob/2.9/bash_completion#L552
[_get_comp_words_by_ref]: https://github.com/scop/bash-completion/blob/2.9/bash_completion#L365

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2019-09-19 08:17:09 -06:00
Sami Kerola d092911bcd
bash-completion: update sys-utils
blkdiscard:

	Add --step [1] and --zeroout [2] options.

	Commit [1]: c472a7e35a
	Commit [2]: 7154cc8926

chmem:

	Commit: 30e1ea8ba1

dmesg:

	Add --time-format.

	Commit: babf605d2c

fallocate:

	Add --insert-range [1], --collapse-range [2], --zero-range [3], and
	--posix [4] options.  Also make the options to be in same order as
	usage() output.

	Commit [1]: b439065634
	Commit [2]: 83cc932d74
	Commit [3]: 1fd4f609ee
	Commit [4]: 833f9a7aae
	Command [5]: fallocate --help | awk '/--/ {print "\t\t\t\t" $2}'

flock:

	Add --no-fork option.

	Commit: 703251401c

hwclock:

	Add --udate-drift [1], remove --badyear [2], and use the same
	argument for --date as in manual page[3].

	Commit [1]: f276d71a3e
	Commit [2]: f6374e1fb3
	Commit [3]: cc5ec6936e

ldattach:

	Add --intro-command and --pause.

	Commit: 8596f63914

losetup:

	Add --nooverlap [1], --json [2], --noheadings and --raw [3] options,
	and direct io aka DIO output field [4].

	Commit [1]: 9a94b634a3
	Commit [2]: 4827093d4b
	Commit [3]: 9f56106df6
	Commit [4]: faeef4d2e9

lscpu:

	Add --json [1] and --physical [2] options.  Add DRAWER [3] to output
	fields.

	Commit [1]: 19a5510b96
	Commit [2]: 0d2b5d2a72
	Commit [3]: b3adf6ef66

lsipc:

	Update output columns (earlier field names were almost completely
	incorrect).  Remove --colon-separate and --print0 [1] options.  Add
	--time-format, --bytes, --numeric-perms [2], and --list [3] options.

	Commit [1]: 2a7150ac2e
	Commit [2]: 9d20ffda79
	Commit [3]: 2916afa3f5

lsmem:

	Commit: cad2d1ac92

lsns:

	Add cgroup --type argument.

	Commit: 2b8889c44b

mount:

	Use /proc and kernel module listing for --type argument list.  Some
	of the items in the lists do not make much sense, but this is still
	better than a static list provided by package maintainer.

mountpoint:

	Remove fixme item that was left in place when this completion was
	originally wrote.

nsenter:

	Add --cgroup [1], --setuid, --setgid [2], --preserve-credentials
	[3] and, --all [4] option.

	Commit [1]: f9e7b66dbd
	Commit [2]: 6b9e5bf670
	Commit [3]: e99a6626d6
	Commit [4]: 974cc006f1

rtcwake:

	Add --auto [1], --adjfile [2], and --list-modes [3] options.

	Commit [1]: 49ebda9b89
	Commit [2]: 3a2f3e82bb
	Commit [3]: 43a44bfc6d

setarch:

	Add --list [1] option.

	Commit [1]: 5edb0ea6bb

setsid:

	Add --wait option.

	Commit: 0dde19974b

umount:

	Use /proc and kernel module listing for --type argument list.

unshare:

	Add --cgroup [1], --fork [2], --mount-proc [3], --map-root-user,
	--setgroups [4], and --propagation [5] options.

	Commit [1]: f9e7b66dbd
	Commit [2]: 5088ec338f
	Commit [3]: 6728ca101e
	Commit [4]: fbceefded6
	Commit [5]: f0f22e9c6f

zramctl:

	Add new output fields MEM-LIMIT, MEM-USED, and MIGRATED.

	Commit: bffc9174b8

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-04-17 18:26:37 +01:00
Sami Kerola 53154dae39 bash-completion: stop being clever when listing block devices
Various commands such as blkid, cfdisk, fdisk, delpart, and so on listed
only partitions and missed for example disks and volume groups.  The
right thing to do is to list all block devices in all for all commands
performing operations with them.  This might occasionally list unexpected
devices that I think is lesser bad than missing some.

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764488
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-31 10:39:00 +01:00
Ville Skyttä 0d5b9b8ab1 bash-completion: Don't offer short options where corresponding long one exists.
Users who know the short options can just hit the short option instead
of tab, and it's not likely that it would be helpful to present a list
of single character options to users who don't know them, doing so
just unnecessarily trashes the list of suggestions.

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2013-04-08 17:06:56 +02:00
Ville Skyttä d4f9b8d74c bash-completion: Don't offer any more completions after help or version.
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2013-04-08 17:06:52 +02:00
Karel Zak 20da58084a bash-completion: rename shell-completion -> bash-completion
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-05 14:58:07 +02:00