From 451dbcfae1406f526208faf6033d6dcc8ac100da Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 22 Dec 2014 22:57:17 +0100 Subject: textual: add a docstring to most of the utilities This adds a concise description of a tool to its usage text. A first form of this patch was proposed by Steven Honeyman (see http://www.spinics.net/lists/util-linux-ng/msg09994.html). Signed-off-by: Benno Schulenberg --- disk-utils/addpart.c | 4 ++++ disk-utils/cfdisk.c | 4 +++- disk-utils/delpart.c | 4 ++++ disk-utils/fdformat.c | 3 +++ disk-utils/fdisk.c | 3 +++ disk-utils/fsck.c | 3 +++ disk-utils/fsck.cramfs.c | 4 ++++ disk-utils/fsck.minix.c | 4 ++++ disk-utils/isosize.c | 4 ++++ disk-utils/mkfs.bfs.c | 4 ++++ disk-utils/mkfs.c | 4 ++++ disk-utils/mkswap.c | 3 +++ disk-utils/partx.c | 3 +++ disk-utils/raw.c | 4 ++++ disk-utils/resizepart.c | 4 ++++ disk-utils/sfdisk.c | 3 +++ disk-utils/swaplabel.c | 4 ++++ login-utils/chfn.c | 4 ++++ login-utils/chsh.c | 4 ++++ login-utils/last.c | 3 +++ login-utils/login.c | 2 ++ login-utils/lslogins.c | 3 +++ login-utils/newgrp.c | 4 ++++ login-utils/nologin.c | 4 +++- login-utils/sulogin.c | 3 +++ login-utils/utmpdump.c | 3 +++ login-utils/vipw.c | 4 ++++ misc-utils/findfs.c | 4 ++++ misc-utils/findmnt.c | 3 +++ misc-utils/getopt.c | 3 +++ misc-utils/kill.c | 3 +++ misc-utils/logger.c | 3 +++ misc-utils/look.c | 4 ++++ misc-utils/lsblk.c | 4 ++++ misc-utils/lslocks.c | 3 +++ misc-utils/mcookie.c | 3 +++ misc-utils/namei.c | 4 ++++ misc-utils/rename.c | 4 ++++ misc-utils/uuidd.c | 3 +++ misc-utils/uuidgen.c | 3 +++ misc-utils/whereis.c | 3 +++ misc-utils/wipefs.c | 4 ++++ schedutils/chrt.c | 2 +- schedutils/ionice.c | 3 +++ schedutils/taskset.c | 4 ++++ sys-utils/blkdiscard.c | 4 ++++ sys-utils/chcpu.c | 3 +++ sys-utils/ctrlaltdel.c | 4 ++++ sys-utils/dmesg.c | 4 ++++ sys-utils/eject.c | 4 +++- sys-utils/fallocate.c | 5 ++++- sys-utils/flock.c | 4 ++++ sys-utils/fsfreeze.c | 4 ++++ sys-utils/fstrim.c | 4 ++++ sys-utils/hwclock.c | 3 +++ sys-utils/ipcmk.c | 5 ++++- sys-utils/ipcrm.c | 6 +++++- sys-utils/ipcs.c | 6 +++++- sys-utils/ldattach.c | 5 ++++- sys-utils/losetup.c | 3 +++ sys-utils/lscpu.c | 3 +++ sys-utils/mount.c | 3 +++ sys-utils/mountpoint.c | 3 +++ sys-utils/nsenter.c | 3 +++ sys-utils/pivot_root.c | 4 ++++ sys-utils/prlimit.c | 3 +++ sys-utils/readprofile.c | 5 ++++- sys-utils/renice.c | 4 ++++ sys-utils/rtcwake.c | 3 +++ sys-utils/setarch.c | 4 ++++ sys-utils/setpriv.c | 3 +++ sys-utils/setsid.c | 3 +++ sys-utils/swapoff.c | 4 +++- sys-utils/swapon.c | 4 +++- sys-utils/switch_root.c | 4 ++++ sys-utils/tunelp.c | 3 +++ sys-utils/umount.c | 3 +++ sys-utils/unshare.c | 3 +++ sys-utils/wdctl.c | 4 +++- sys-utils/zramctl.c | 3 +++ term-utils/agetty.c | 4 ++++ term-utils/mesg.c | 4 ++++ term-utils/script.c | 3 +++ term-utils/scriptreplay.c | 3 +++ term-utils/setterm.c | 4 ++++ term-utils/wall.c | 4 ++++ term-utils/write.c | 3 +++ text-utils/col.c | 3 +++ text-utils/colcrt.c | 4 ++++ text-utils/colrm.c | 4 ++++ text-utils/column.c | 4 ++++ text-utils/hexdump.c | 4 ++++ text-utils/line.c | 4 ++++ text-utils/more.c | 4 ++++ text-utils/pg.c | 4 ++++ text-utils/rev.c | 4 ++++ text-utils/tailf.c | 3 +++ text-utils/ul.c | 5 ++++- 98 files changed, 343 insertions(+), 14 deletions(-) diff --git a/disk-utils/addpart.c b/disk-utils/addpart.c index c0f25a539..73fd1ff4e 100644 --- a/disk-utils/addpart.c +++ b/disk-utils/addpart.c @@ -13,6 +13,10 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out) fputs(USAGE_HEADER, out); fprintf(out, _(" %s \n"), program_invocation_short_name); + + fputs(USAGE_SEPARATOR, out); + fputs(_("Tell the kernel about the existence of a specified partition.\n"), out); + fputs(USAGE_OPTIONS, out); fputs(USAGE_HELP, out); fputs(USAGE_VERSION, out); diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c index 324f56bbf..60a953524 100644 --- a/disk-utils/cfdisk.c +++ b/disk-utils/cfdisk.c @@ -2163,10 +2163,12 @@ static int ui_run(struct cfdisk *cf) static void __attribute__ ((__noreturn__)) usage(FILE *out) { fputs(USAGE_HEADER, out); - fprintf(out, _(" %1$s [options] \n"), program_invocation_short_name); + fputs(USAGE_SEPARATOR, out); + fputs(_("Display or manipulate a disk partition table.\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -L --color[=] colorize output (auto, always or never)\n"), out); fputs(_(" -z --zero start with zeroed partition table\n"), out); diff --git a/disk-utils/delpart.c b/disk-utils/delpart.c index e940e3bed..efa7a70ef 100644 --- a/disk-utils/delpart.c +++ b/disk-utils/delpart.c @@ -13,6 +13,10 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out) fputs(USAGE_HEADER, out); fprintf(out, _(" %s \n"), program_invocation_short_name); + + fputs(USAGE_SEPARATOR, out); + fputs(_("Tell the kernel to forget about a specified partition.\n"), out); + fputs(USAGE_OPTIONS, out); fputs(USAGE_HELP, out); fputs(USAGE_VERSION, out); diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c index c6a98e10f..ad9a86367 100644 --- a/disk-utils/fdformat.c +++ b/disk-utils/fdformat.c @@ -143,6 +143,9 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out) fprintf(out, _(" %s [options] \n"), program_invocation_short_name); + fputs(USAGE_SEPARATOR, out); + fputs(_("Do a low-level formatting of a floppy disk.\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -f, --from start at the track N (default 0)\n"), out); fputs(_(" -t, --to stop at the track N\n"), out); diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c index cf86281bb..9c3e10335 100644 --- a/disk-utils/fdisk.c +++ b/disk-utils/fdisk.c @@ -636,6 +636,9 @@ static void __attribute__ ((__noreturn__)) usage(FILE *out) " %1$s [options] -l [] list partition table(s)\n"), program_invocation_short_name); + fputs(USAGE_SEPARATOR, out); + fputs(_("Display or manipulate a disk partition table.\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -b, --sector-size physical and logical sector size\n"), out); fputs(_(" -c, --compatibility[=] mode is 'dos' or 'nondos' (default)\n"), out); diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c index a0f9db1d5..535184e81 100644 --- a/disk-utils/fsck.c +++ b/disk-utils/fsck.c @@ -1355,6 +1355,9 @@ static void __attribute__((__noreturn__)) usage(FILE *out) fprintf(out, _(" %s [options] -- [fs-options] [ ...]\n"), program_invocation_short_name); + fputs(USAGE_SEPARATOR, out); + fputs(_("Check and repair a Linux filesystem.\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -A check all filesystems\n"), out); fputs(_(" -C [] display progress bar; file descriptor is for GUIs\n"), out); diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c index 0a1c6f27b..6b4b69e92 100644 --- a/disk-utils/fsck.cramfs.c +++ b/disk-utils/fsck.cramfs.c @@ -106,6 +106,10 @@ static void __attribute__((__noreturn__)) usage(int status) fputs(USAGE_HEADER, stream); fprintf(stream, _(" %s [options] \n"), program_invocation_short_name); + + fputs(USAGE_SEPARATOR, stream); + fputs(_("Check and repair a compressed ROM filesystem.\n"), stream); + fputs(USAGE_OPTIONS, stream); fputs(_(" -a for compatibility only, ignored\n"), stream); fputs(_(" -v, --verbose be more verbose\n"), stream); diff --git a/disk-utils/fsck.minix.c b/disk-utils/fsck.minix.c index c0ed0177d..9d4754884 100644 --- a/disk-utils/fsck.minix.c +++ b/disk-utils/fsck.minix.c @@ -193,6 +193,10 @@ usage(void) { fputs(USAGE_HEADER, stderr); fprintf(stderr, _(" %s [options] \n"), program_invocation_short_name); + + fputs(USAGE_SEPARATOR, stderr); + fputs(_("Check the consistency of a Minix filesystem.\n"), stderr); + fputs(USAGE_OPTIONS, stderr); fputs(_(" -l list all filenames\n"), stderr); fputs(_(" -a automatic repair\n"), stderr); diff --git a/disk-utils/isosize.c b/disk-utils/isosize.c index 5030a50b1..43569ae71 100644 --- a/disk-utils/isosize.c +++ b/disk-utils/isosize.c @@ -169,6 +169,10 @@ static void __attribute__((__noreturn__)) usage(FILE *out) fprintf(out, _(" %s [options] \n"), program_invocation_short_name); + + fputs(USAGE_SEPARATOR, out); + fputs(_("Show the length of an ISO-9660 filesystem.\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -d, --divisor= divide the amount of bytes by \n"), out); fputs(_(" -x, --sectors show sector count and size\n"), out); diff --git a/disk-utils/mkfs.bfs.c b/disk-utils/mkfs.bfs.c index c2c238972..98e4b050c 100644 --- a/disk-utils/mkfs.bfs.c +++ b/disk-utils/mkfs.bfs.c @@ -72,6 +72,10 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out) fprintf(out, _("Usage: %s [options] device [block-count]\n"), program_invocation_short_name); + + fputs(USAGE_SEPARATOR, out); + fputs(_("Make an SCO bfs filesystem.\n"), out); + fprintf(out, _("\nOptions:\n" " -N, --inodes=NUM specify desired number of inodes\n" " -V, --vname=NAME specify volume name\n" diff --git a/disk-utils/mkfs.c b/disk-utils/mkfs.c index 8ad606531..08c4ef0b0 100644 --- a/disk-utils/mkfs.c +++ b/disk-utils/mkfs.c @@ -47,6 +47,10 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out) fputs(USAGE_HEADER, out); fprintf(out, _(" %s [options] [-t ] [fs-options] []\n"), program_invocation_short_name); + + fputs(USAGE_SEPARATOR, out); + fputs(_("Make a Linux filesystem.\n"), out); + fputs(USAGE_OPTIONS, out); fprintf(out, _(" -t, --type= filesystem type; when unspecified, ext2 is used\n")); fprintf(out, _(" fs-options parameters for the real filesystem builder\n")); diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index d34e2fd35..b22c73fff 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -149,6 +149,9 @@ static void __attribute__ ((__noreturn__)) usage(FILE *out) " %s [options] device [size]\n"), program_invocation_short_name); + fputs(USAGE_SEPARATOR, out); + fputs(_("Set up a Linux swap area.\n"), out); + fprintf(out, _( "\nOptions:\n" " -c, --check check bad blocks before creating the swap area\n" diff --git a/disk-utils/partx.c b/disk-utils/partx.c index bf5a4abf7..00c263173 100644 --- a/disk-utils/partx.c +++ b/disk-utils/partx.c @@ -713,6 +713,9 @@ static void __attribute__((__noreturn__)) usage(FILE *out) _(" %s [-a|-d|-s|-u] [--nr | ] \n"), program_invocation_short_name); + fputs(USAGE_SEPARATOR, out); + fputs(_("Tell the kernel about the presence and numbering of partitions.\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -a, --add add specified partitions or all of them\n"), out); fputs(_(" -d, --delete delete specified partitions or all of them\n"), out); diff --git a/disk-utils/raw.c b/disk-utils/raw.c index 2adbf00bb..cc6690145 100644 --- a/disk-utils/raw.c +++ b/disk-utils/raw.c @@ -54,6 +54,10 @@ static void __attribute__ ((__noreturn__)) usage(int err) " %1$s -q %2$srawN\n" " %1$s -qa\n"), program_invocation_short_name, _PATH_RAWDEVDIR); + + fputs(USAGE_SEPARATOR, out); + fputs(_("Bind a raw character device to a block device.\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -q, --query set query mode\n"), out); fputs(_(" -a, --all query all raw devices\n"), out); diff --git a/disk-utils/resizepart.c b/disk-utils/resizepart.c index 765e3a406..9a6235b5d 100644 --- a/disk-utils/resizepart.c +++ b/disk-utils/resizepart.c @@ -18,6 +18,10 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out) fputs(USAGE_HEADER, out); fprintf(out, _(" %s \n"), program_invocation_short_name); + + fputs(USAGE_SEPARATOR, out); + fputs(_("Tell the kernel about the new size of a partition.\n"), out); + fputs(USAGE_OPTIONS, out); fputs(USAGE_HELP, out); fputs(USAGE_VERSION, out); diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index 73a1331ed..499dd8f64 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -1310,6 +1310,9 @@ static void __attribute__ ((__noreturn__)) usage(FILE *out) _(" %1$s [options] [[-N] ]\n" " %1$s [options] \n"), program_invocation_short_name); + fputs(USAGE_SEPARATOR, out); + fputs(_("Display or manipulate a disk partition table.\n"), out); + fputs(_("\nCommands:\n"), out); fputs(_(" -a, --activate [ ...] list or set bootable MBR partitions\n"), out); fputs(_(" -d, --dump dump partition table (usable for later input)\n"), out); diff --git a/disk-utils/swaplabel.c b/disk-utils/swaplabel.c index a7498a4f1..89be2aed6 100644 --- a/disk-utils/swaplabel.c +++ b/disk-utils/swaplabel.c @@ -116,6 +116,10 @@ static void __attribute__((__noreturn__)) usage(FILE *out) fputs(USAGE_HEADER, out); fprintf(out, _(" %s [options] \n"), program_invocation_short_name); + + fputs(USAGE_SEPARATOR, out); + fputs(_("Display or change the label or UUID of a swap area.\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -L, --label