* '2017wk16' of git://github.com/kerolasa/lelux-utiliteetit:
chfn, chsh: use readline(3) to receive user input
findfs: use getopt_long() to parse options
logger: make month names, login name, and tag read-only objects
sulogin: reduce vulnerability surface
partx: add --list-types option
libblkid: add blkid_partitions_get_name()
docs: try to convince open(2) O_DIRECT rather than using raw device
blkid: add long options
lsipc: fix options parsing and sync with man page
This change attempts to make tab completion more reasonable by alloging
memorizable option names. That also has positive impact to manual page, in
which referrals to other options are now easier to understand.
All short options are kept exactly as they were to avoid ABI breakage. The
only exception is -f option that getopt(3) recognized, but was not found
from anywhere else. The -f has been part of blkid since the initial commit.
Commit: 51410fc6de
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
$ lsblk --discard --perms
NAME DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO NAME SIZE OWNER GROUP MODE
sdb 0 0B 0B 0 sdb 74.5G root disk brw-rw----
└─sdb1 0 0B 0B 0 └─sdb1 74.5G root disk brw-rw----
sda 0 512B 2G 0 sda 223.6G root disk brw-rw----
├─sda4 0 512B 2G 0 ├─sda4 50G root disk brw-rw----
├─sda2 0 512B 2G 0 ├─sda2 200M root disk brw-rw----
├─sda5 0 512B 2G 0 ├─sda5 35.1G root disk brw-rw----
├─sda3 0 512B 2G 0 ├─sda3 130.3G root disk brw-rw----
├─sda1 0 512B 2G 0 ├─sda1 200M root disk brw-rw----
└─sda6 0 512B 2G 0 └─sda6 7.8G root disk brw-rw----
... see NAME column.
It's fine to support duplicated columns when requested by user (e.g.
-o NAME,NAME,SIZE), but it does not make sense for the default output
when multiple command options specified.
Signed-off-by: Karel Zak <kzak@redhat.com>
It seems better to avoid "int" at all from sizes calculations to make
the code more robust for future changes.
Signed-off-by: Karel Zak <kzak@redhat.com>
* '2017wk11' of git://github.com/kerolasa/lelux-utiliteetit:
blkid: add control struct
blkid: simplify version option handling
tests: add static keyword where needed [smatch scan]
tests: do not use plain 0 as NULL [smatch scan]
libsmartcols: fix test variable shadowing
Without obvious reason blkid has managed to be part of this project for
pretty long time without getting translations. Lets change that. In same
go use the usual error printing facilities instead of fprintf(stderr, ...);
[kzak@redhat.com: - use errtryh(),
- cleanup "unsupported output format"]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
Some say people read do-while statements are easily as while statements and
get wrong impression. This happens because do-whiles are not common.
Adding braces should make it easier to read the code.
Reference: http://www.spinics.net/lists/linux-kernel-janitors/msg02018.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer
Since many 'struct option' has used zero as NULL make them more readable in
same go by reindenting, and using named argument requirements.
Reference: https://lwn.net/Articles/93577/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
[kzak@redhat.com: - rename --dry-run to --no-act]
Signed-off-by: Alexander F Rødseth <xyproto@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
The current code supports <name>@<digit> only, but we also need
<name>@<digit>.<digit>[. ...]
RFC5424: 7.2.2 enterpriseId:
In general, only the IANA-assigned private enterprise number is
needed (a single number). An enterprise might decide to use
sub-identifiers below its private enterprise number. If sub-
identifiers are used, they MUST be separated by periods and be
represented as decimal numbers. An example for that would be
"32473.1.2".
Addresses: https://github.com/karelzak/util-linux/issues/406
Signed-off-by: Karel Zak <kzak@redhat.com>
The correct abbreviation of identifier is is "ID" (as used in
many pages), not "id" (as used in a few pages).
Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
In the majority of pages, pathnames are formatted as Italic,
which is the norm. However, there are several cases where they
are formatted as bold. This patch fixes a number of those
exceptions.
Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
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>