From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: util-linux-owner@vger.kernel.org Received: from cpsmtpb-ews09.kpnxchange.com ([213.75.39.14]:60485 "EHLO cpsmtpb-ews09.kpnxchange.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751011AbaLQUUw (ORCPT ); Wed, 17 Dec 2014 15:20:52 -0500 From: Benno Schulenberg To: util-linux@vger.kernel.org Subject: RFC [patch] adding docstrings Date: Wed, 17 Dec 2014 21:20:31 +0100 Message-Id: <1418847631-8317-1-git-send-email-bensberg@justemail.net> Sender: util-linux-owner@vger.kernel.org List-ID: This patch adds a docstring (a one-line description) to each of the utilities. It was first proposed some months ago by Steven Honeyman (see (http://www.spinics.net/lists/util-linux-ng/msg09994.html). (The utilities cal, su and runuser already had a two- or three-line docstring. For mkfs.cramfs, mkfs.minix, blkid and chrt I've had to improvise -- putting the docstring before the synopis -- in order to avoid making extensive changes to the usage text; those changes will come later.) If you have a favourite tool, please check below and see if you can improve its description. Other improvements and comments are welcome too. Benno --- disk-utils/addpart.c | 4 ++++ disk-utils/blockdev.c | 1 + 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/mkfs.cramfs.c | 1 + disk-utils/mkfs.minix.c | 1 + 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/blkid.c | 1 + 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 ++++- 102 files changed, 347 insertions(+), 14 deletions(-) diff --git a/disk-utils/addpart.c b/disk-utils/addpart.c index c0f25a5..135489b 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/blockdev.c b/disk-utils/blockdev.c index 43aaef6..925fa2e 100644 --- a/disk-utils/blockdev.c +++ b/disk-utils/blockdev.c @@ -181,6 +181,7 @@ static const struct bdc bdcms[] = static void __attribute__ ((__noreturn__)) usage(FILE * out) { size_t i; + fputs("Call block-device ioctls from the command line.\n", out); fprintf(out, _("\nUsage:\n" " %1$s -V\n" " %1$s --report [devices]\n" diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c index 14a75c5..641d0ec 100644 --- a/disk-utils/cfdisk.c +++ b/disk-utils/cfdisk.c @@ -2156,10 +2156,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 e940e3b..9e35b47 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 c6a98e1..eca2b1d 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 cf86281..201d143 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 a0f9db1..6128d99 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 0a1c6f2..caa2cbb 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 c0ed017..b2d140b 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 5030a50..6447368 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 c2c2389..b1f2bed 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 8ad6065..1c6c6f3 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/mkfs.cramfs.c b/disk-utils/mkfs.cramfs.c index 509b50b..66ed01c 100644 --- a/disk-utils/mkfs.cramfs.c +++ b/disk-utils/mkfs.cramfs.c @@ -118,6 +118,7 @@ static void usage(int status) { FILE *stream = status ? stderr : stdout; + fputs("Make a compressed ROM filesystem.\n", stream); fprintf(stream, _("usage: %s [-h] [-v] [-b blksize] [-e edition] [-N endian] [-i file] " "[-n name] dirname outfile\n" diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c index 81b7ae3..40508b6 100644 --- a/disk-utils/mkfs.minix.c +++ b/disk-utils/mkfs.minix.c @@ -148,6 +148,7 @@ static void __attribute__((__noreturn__)) usage(void) { errx(MKFS_EX_USAGE, _("Usage: %s [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]"), program_name); + /*fputs("Make a Minix filesystem.", out);*/ } /* diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index d34e2fd..9719c61 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 bf5a4ab..3873a0a 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 2adbf00..d1a6171 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 765e3a4..2db99ac 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 cff8664..401a41f 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 a7498a4..e0bb670 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