From f1970cc557907a047da12202cf435ce03ca7b931 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 5 Feb 2020 11:01:36 +0100 Subject: [PATCH] docs: improve size arguments description in --help output Let's add "Arguments:" section to the --help output and describe {K,M,G...}iB suffixes there. Addresses: https://github.com/karelzak/util-linux/pull/917 Co-Author: ed Signed-off-by: Karel Zak --- disk-utils/fdisk.c | 2 +- include/c.h | 5 +++++ misc-utils/blkid.c | 7 ++++++- misc-utils/mcookie.c | 4 ++++ misc-utils/wipefs.c | 3 +++ sys-utils/blkdiscard.c | 3 +++ sys-utils/blkzone.c | 3 +++ sys-utils/fallocate.c | 3 +++ sys-utils/fstrim.c | 4 ++++ sys-utils/ipcmk.c | 4 ++++ sys-utils/zramctl.c | 3 +++ text-utils/hexdump.c | 6 +++++- 12 files changed, 44 insertions(+), 3 deletions(-) diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c index 0502fa33cf..25e38fc387 100644 --- a/disk-utils/fdisk.c +++ b/disk-utils/fdisk.c @@ -878,7 +878,7 @@ int main(int argc, char **argv) { "color", optional_argument, NULL, 'L' }, { "compatibility", optional_argument, NULL, 'c' }, { "cylinders", required_argument, NULL, 'C' }, - { "heads", required_argument, NULL, 'H' }, + { "heads", required_argument, NULL, 'H' }, { "sectors", required_argument, NULL, 'S' }, { "getsz", no_argument, NULL, 's' }, { "help", no_argument, NULL, 'h' }, diff --git a/include/c.h b/include/c.h index 59f88c7c48..64cf5c3fb1 100644 --- a/include/c.h +++ b/include/c.h @@ -363,6 +363,11 @@ static inline int xusleep(useconds_t usec) , " -h, --help", USAGE_OPTSTR_HELP \ , " -V, --version", USAGE_OPTSTR_VERSION +#define USAGE_ARG_SEPARATOR "\n" +#define USAGE_ARG_SIZE(_name) \ + _(" %s arguments may be followed by the suffixes for\n" \ + " GiB, TiB, PiB, EiB, ZiB, and YiB (the \"iB\" is optional)\n"), _name + #define USAGE_MAN_TAIL(_man) _("\nFor more details see %s.\n"), _man #define UTIL_LINUX_VERSION _("%s from %s\n"), program_invocation_short_name, PACKAGE_STRING diff --git a/misc-utils/blkid.c b/misc-utils/blkid.c index 88a90578b0..dba3bb7d7b 100644 --- a/misc-utils/blkid.c +++ b/misc-utils/blkid.c @@ -86,7 +86,6 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_( " -l, --list-one look up only first device with token specified by -t\n"), out); fputs(_( " -L, --label