Commit Graph

172 Commits

Author SHA1 Message Date
Karel Zak 3ebe5477db findmnt: add --tree to allow to enable tree output for --mtab
The --mtab output is merge from kernel and utab on all modern systems
(without classic /etc/mtab). It means we have all necessary information
to generate tree output.

For the backward compatibility --mtab is the list by default, the new
option --tree allows to override the default and enable tree always
when the table contains child-parent relations.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-08 14:24:41 +01:00
Karel Zak e0383e3e88 wall: check -g GID
Based on comments from Sami Kerola.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-02 14:11:20 +01:00
Jim Patterson 01544c52f8 wall: add --group option
The wall command on AIX supports a "-g" option to limit the message
to a group of users by gid.  Add compatibility to the Linux version.

Thanks to Sami Kerola <kerolasa@iki.fi> for an initial skeleton
implementation.

[kzak@redhat.com: - rename max to ngroups
                  - add free_group_workspace()
                  - some cosmetic changes]

Reference: http://www.ibm.com/support/knowledgecenter/ssw_aix_61/com.ibm.aix.cmds6/wall.htm
Signed-off-by: Jim Patterson <jimp@wegrok.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-02 13:53:03 +01:00
Richard Yann 219452a47c Fix: list all block device from /dev and all symbolic links to block devices
Before fix "fsck -y /d<tab>" will never show LVM VG from multipath or mapped devices
2016-10-04 14:48:06 +02:00
Sami Kerola 0fc63d38f3 bash-completion: update chrt completion
Add couple missing options, and make the completion overall work better.

That said completion is still incomplete, pardon the pun.  After user has
specified policy then giving a hint what priority needs to be specified is
theoretically possible, but such hint is not given.  There does not seem to
be easy way to know when user wants stops specifying options and move to
defining priority in: chrt [options] [prio] [command|pid].

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-04-04 10:26:03 +02:00
Ruediger Meier d77202afe0 build-sys: install missing bash completions
We haven't installed these files since three years. Hopefully
they will work.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-17 12:18:56 +01:00
Sami Kerola 074676470e bash-completion: lsns: add missing completion file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-03-14 13:15:15 +01:00
Sami Kerola 372221e52b bash-completion: lslogins: add missing completion file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-03-14 13:15:14 +01:00
Sami Kerola 061e41250f bash-completion: ipcmk: add missing completion file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-03-14 13:15:14 +01:00
Sami Kerola 5f57e1420c bash-completion: fsck.cramfs, isosize: find files an argument
Earlier completion suggested only options for the command, this changes
options to be proposed when first character of an argument is dash.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-03-14 13:15:13 +01:00
Andreas Henriksson 42f536ee84 bash-completion: fstrim: use mountpoint, not device
fstrim takes mountpoint as argument but the bash completion
was completing it to a device node.

Addresses: http://bugs.debian.org/804833
Reported-by: Ritesh Raj Sarraf <rrs@debian.org>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2015-11-13 09:52:14 +01:00
Karel Zak 3ccd9664aa bash-completion: add cal --span
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-05 11:34:25 +01:00
Alexander Kuleshov 100a43932c bash-completion: curly brace missed for findmnt
This patch provides fix for bash-completion/fndmt script. There
is curly brace missed in the completion generation for the -M/--mountpoint
option.

In other way we will get following messages:

bash: /etc/bash_completion.d/findmnt: line 91: unexpected EOF while looking for matching `)'
bash: /etc/bash_completion.d/findmnt: line 141: syntax error: unexpected end of file

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
2015-10-02 12:34:23 +02:00
Sami Kerola 24bdce6ea8 bash-completion: update few options changed since v2.26
Attempt to find and update all changes to command line options that has
not been reflected in bash-completion files in between versions v2.26 to
v2.27-rc1.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-03 12:35:18 +02:00
Sami Kerola 158b8d6918 fsck.minix: introduce long options to the command
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:17 +02:00
Sami Kerola b59c5925ce mkfs.minix: introduce long options to the command
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:12 +02:00
Karel Zak 8abdb91211 sfdisk: add --list-free
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-28 15:54:07 +02:00
Karel Zak 9d20ffda79 lsipc: new command to list IPC facilities
Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-07-20 11:48:09 +02:00
Sami Kerola fe63e9032d bash-completion: cal: add --twelve and --color options
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-15 15:51:04 +02:00
Sami Kerola 43a44bfc6d rtcwake: add --list-modes
Commit ece44f19f4 missed freeze mode, which
to a simple patch adding the missing argument but Karel pointed out it
would be better to make the rtcwake to tell what arguments are supported
so that possible changes end up to be automatically correct in bash
completion.

Proposed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola a10ce9a3e5 rtcwake: add human readable --date timestamp format
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Boris Egorov 5e3da11b3e bash-completion: remove unused variables [shellcheck]
Fix shellcheck SC2034 warnings.

Signed-off-by: Boris Egorov <egorov@linux.com>
2015-06-08 12:09:54 +02:00
Boris Egorov bcce334df8 bash-completion: sync lscpu completion with code
Remove unexistent option, add two not listed in completion.

Signed-off-by: Boris Egorov <egorov@linux.com>
2015-06-08 12:09:50 +02:00
Boris Egorov b5b80e5a6d bash-completion: handle comma-separated options
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>
2015-06-08 12:09:48 +02:00
Rainer Gerhards ae6846b842 logger: add --skip-empty-lines to prevent logging empty lines
Empty log messages are generally considered useless. This option
enables to turn them off when processing files (including stdin).

[kzak@redhat.com: - rename --skip-empty-lines to --skip-empty,
                  - add the option to getopt_long(),
                  - add the option to bash-completion]

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-10 11:19:33 +01:00
Rainer Gerhards f68b8aa7f5 logger: permit to send messages larger than 1024 characters
This is an important capability that has been specified in RFC5424.
However, messages larger than 1024 chars are being accepted for years
now by at least rsyslog and syslog-ng.

This patch adds the option --size to permit setting a new max
size, with 1024 being the default.

Note that the size limit is only approximative, as we do not take the
header size in account (RFC talks about total message length).

[[kzak@redhat.com: - add 'S' to getopt_long(),
                   - rename --message-size to --size
                   - add the option to bash-completion]

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-10 11:19:16 +01:00
Ville Skyttä 396a6d7df5 bash-completion: Invoke actual commands to be completed, not basenames
Addresses partially: http://bugs.debian.org/769462
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2014-11-18 13:58:21 +01:00
Sami Kerola e3da3b39b5 bash-completion: use swapon label and uuid listing support
Simplifies the script, and makes swapoff to work for files when get
requests by label or uuid.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-31 10:39:01 +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
Mike Frysinger 346dc42381 bash-completion: fix runuser install
The runuser symlink used to depend on su being enabled, but a refactoring
broke that.  So if you build with runuser enabled but not su, you end up
with a broken symlink.  Rework the logic so it works in both cases.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-10-31 10:38:53 +01:00
Stanislav Brabec fe122a5225 Fix bash-completion Makemodule options 2014-08-11 14:52:04 +02:00
Sami Kerola 2b0c19b03c zramctl: add bash completion script
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-08-11 14:40:14 +02:00
Sami Kerola d9b38f6baf docs: add logger protocol notes to manual page
Inform about rfc5424 support, how to control what it includes to
submission, and that it is the new default when sending syslog messages
to remote server without specifying protocol.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-28 21:15:17 +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
Karel Zak b8446f75d8 bash-completion: update fallocate, fstrim and lsblk
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-25 13:55:56 +02:00
Karel Zak 077698f5d6 bash-completion: update cfdisk
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-25 13:44:08 +02:00
Karel Zak 675821f4bd bash-completion: update fdisk
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-25 13:41:27 +02:00
Karel Zak ac6a37c863 build-sys: cleanup bash-completion/
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-21 14:29:42 +02:00
Karel Zak d6ace0b8dd build-sys: add BUILD_CHRT
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-21 13:35:01 +02:00
Sami Kerola 253e5e7161 setterm: correct usage() bright color argument
This has been wrong since commit 2dc8716.  The bright is a prefix
attribute to other colors.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:54:17 +01:00
Sami Kerola 917465831f setterm: make -msglevel 0 to work as is did earlier
Commit 3393c136 caused regression.  The klogctl() logging range is 1-8,
but the value 0 is special according to setterm.1 manual page.  It turns
on loging, same way as '-msg on' option.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:45:39 +01:00
Sami Kerola 609d48534a setterm: remove devfs and /dev/vcsa0 support
The devfs files /dev/vcc/a* does not need to be supported, and vcsa0 has
not existed in years if ever.

Reference: http://lwn.net/Articles/65197/
Reference: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devices.txt?id=14186fea0cb06bc43181ce239efe0df6f1af260a#n260
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:45:38 +01:00
Sami Kerola fb27f91cac setterm: recommend long options with double hyphen
While the -version style options will work for next unknown number of
years start moving towards user interface that has way of invoking long
options as most of the other commands.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:21:14 +01:00
Sami Kerola 198556b76c cytune: remove from util-linux
Assumption is there are not many who need this tool.  Whom ever they
might be the recommendation is to use the command from old util-linux
release.  Second reason to removal is difficulty to test hardware
specific command when none of the active project members does not seem to
have such.  Basically the command has reached dead end what comes to
maintainability of it.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-12 13:06:59 +02:00
Sami Kerola 4b670c01df logger: allow user to send structured journald messages
This feature is hopefully mostly used to give MESSAGE_ID labels for
messages coming from scripts, making search of messages easy.  The
logger(1) manual page update should give enough information how to use
--journald option.

[kzak@redhat.com: - add missing #ifdefs
                  - use xalloc.h]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-04 13:44:21 +01:00
Karel Zak 782c290c5c fallocate: add --verbose, clean up usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-02-14 14:37:51 +01:00
Rodrigo Campos 24b2a479fd fallocate: Add "--dig-holes" option
This option tries to detect chunk of '\0's and punch a hole, making the file
sparse in-place.

[kzak@redhat.com: - fix coding style, use xalloc.h and err.h]

Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-02-14 11:31:12 +01:00
Tommi Kyntola c36c4a4e4d cal: added -w|--week for showing week numbers
Added week numbers both in ISO-6801 and North America numbering.
The mode is determined by first day of the week, Monday
for ISO and Sunday for North America mode.

ISO week numbers are defined as the first Thursday being part of week 1.
The North America numbering is defined, at least by gcal, as first Sunday
being in the first week.

Signed-off-by: Tommi Kyntola <kynde@iki.fi>
2013-10-22 10:27:03 +02:00
Karel Zak 39d2e7067d Revert "blockdev: Remove the --setbsz (set blocksize) option which has never worked."
This reverts commit b1555acc2f.

It seems that the option is used by kernel guys to test kernel, so
let's keep the option in the blockdev(8) although it's almost useless
in userspace. All we need is to improve docs to make things more
obvious to end users.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-11 11:05:45 +02:00
Richard W.M. Jones b1555acc2f blockdev: Remove the --setbsz (set blocksize) option which has never worked.
This option has never worked.  If you try setting the block size on a
block device, and then read it using --getbsz, you will see that the
block size never changes.

The reason for this is because the block size is specific to the
current file descriptor opening the block device, so the change of
block size only persists for as long as blockdev has the device open,
and is lost once blockdev exits.

Also the block size is not really used anywhere.  Filesystems, for
example, have their own idea of block size and ignore this setting
completely.

(Thanks Masayoshi Mizuma for diagnosing the problem)

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2013-10-08 15:48:00 +02:00
Karel Zak ce3e6b15e2 bash-completion: use '\n' as IFS when ask for filenames
The bash completion for more(1) treats the space-separated pieces of
filenames as different files.

	$ touch foo\ bar
	$ more foo<TAB>
	bar foo

Reported-by: Ángel González <ingenit@zoho.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-30 15:49:00 +02:00
Mike Frysinger 86cfa193ad bash-completion: fix typos in mkfs.bfs logic
There is no "bfs" command.  Change this file to match the other
mkfs files where we have a "mkfs." prefix.

Reported-by: Michał Górny <mgorny@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-09-20 10:04:53 +02:00
Ondrej Oprala ce60272039 last: merge sysvinit last/lastb
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-12 12:07:52 +02:00
Sami Kerola e4b768c75c docs: add lscpu max mhz to manual and bash completion
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-06-07 12:24:44 +02:00
Sami Kerola e1d58c7796 cfdisk: add long options to the command
Includes update to bash completion, and manual as well.

[kzak@redhat.com: - remove <<< syntax from bash-completion script]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-20 13:40:15 +02:00
Sami Kerola cdeb4292e9 hexdump: add long options to the command
Includes update to bash completion, and manual as well.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:00 +02:00
Sami Kerola 930954d87a utmpdump: add option to write to a file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:25:58 +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
Karel Zak 0ff2e587ab build-sys: make wall optional in bash-completion
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10 23:34:23 +02:00
Karel Zak 8d6f0baee9 build-sys: add --disable-fdformat
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10 23:03:20 +02:00
Karel Zak 834fc88cd4 build-sys: add --disable-bfs
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10 22:38:54 +02:00
Karel Zak 78cdc25415 build-sys: add --disable-cytune
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10 22:27:31 +02:00
Bernhard Voelker 741fce3471 bash-completion: add swapoff
[kzak@redhat.com: remove short options]

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10 14:35:49 +02:00
Sami Kerola a6f5836264 bash-completion: swapon: add options and fix argument
The initial bash-completion missed swapon options -L and -U.  Use of
block device was proposed to be more appropriate than a path to a file.

Requested-by: Karel Zak <kzak@redhat.com>
References: http://marc.info/?l=util-linux-ng&m=136517310727426&w=2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:17:15 +02:00
Sami Kerola 6ad488cca9 bash-completion: setarch: use correct list for architectures
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:17:10 +02:00
Ville Skyttä e6d2618786 bash-completion: Symlink runuser symlink to su so it gets loaded on demand.
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>

[kzak@redhat.com: - use '-runuser' in the install hook
		  - use the hook only if runuser is enabled]
2013-04-08 17:10:33 +02: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ä d6b975ef44 bash-completion: Avoid some unnecessary subshells.
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2013-04-08 17:06:53 +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 ece777e9de build-sys: add --disable-bash-completion
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-05 15:54:31 +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