Commit Graph

10 Commits

Author SHA1 Message Date
Etienne Mollier 2c12297400 bash-completion/umount: shell charaters escape
This patch brings support for automatic dangerous shell characters
escape in umount autocompletion.  Due to the very peculiar way for
bash to handle autocompletion routines, proper escaping of the shell
sequences only worked properly inside a function: _umount_point_list,
which will add to the user's namespace at the next umount attempt of
autocompleting mount point.

It also translates calls of gensub to the portable alternatives sub
and gsub, in order to allow the use of various awk implementations
(mawk, Gnu, Busybox, etc), and as such kind of undoes a recent change
to enforce the use of Gnu awk. The whole story landed into the Debian
BTS initially:

	https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=933934

PS: It's been a few months since the patch is available, sorry for the
    delay; I only got myself a Github account quite recently...

Signed-off-by: Étienne Mollier <etienne.mollier@mailoo.org>
2020-05-21 17:44:22 +02:00
Wolfram Sang 76f969fe6f bash-completion: umount explicitly needs gawk
gensub() is a gawk extension, so use it explicitly. Otherwise users will
get an error if their 'awk' defaults to something else.

Fixes: 3ebfc8d37 ("bash-completion: umount support relative path and ~ as home shorthands")
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-04-29 12:27:14 +02:00
Sami Kerola 3ebfc8d370
bash-completion: umount support relative path and ~ as home shorthands
Addresses: https://github.com/karelzak/util-linux/issues/703
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-01-12 19:29:37 +00:00
Karel Zak d482a0bd5c bash-completion: cleanup mount and umount --namespace
* use only PATHs rather than PIDs to namespaces

* add --namespace to umount too

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-10-05 11:48:04 +02:00
Sami Kerola 5feae697b0
bash-completion: catch up with option changes
Check what has changed in usage functions in between v2.32..a77bd80d5 and
update bash-completion files accordingly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-10-04 21:36:22 +01:00
Karel Zak 75f03badd7 bash-completion: (umount) use findmnt, escape a space in paths
# mount /dev/sdc1 /mnt/test/foo\ bar
 # umount <tab>

has to return "/mnt/test/foo\ bar".

Changes:

 * don't use mount | awk output, we have findmnt
 * force compgen use \n as entries separator

Addresses: https://github.com/karelzak/util-linux/issues/539
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-11-16 16:27:32 +01: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
Benno Schulenberg 6070a9853a various: erase all traces of the long-obsolete ext filesystem
The same argument as for xiafs: dead for over ten years.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-28 11:16:58 +02:00
Benno Schulenberg 556c9c4842 various: erase all traces of the long-obsolete xiafs
The xiafs filesystem was removed from the kernel fifteen years ago,
and any kernel that contained it reached end of life ten years ago.
It's time to stop mentioning it in the mount man page and elsewhere.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-28 11:16:57 +02:00
Sami Kerola 2211b13ed8 bash-completion: add mount and umount
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:25:54 +02:00