From: Benno Schulenberg Date: Mon, 22 Dec 2014 21:57:17 +0000 (+0100) Subject: textual: add a docstring to most of the utilities X-Git-Tag: v2.26-rc1~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=451dbcfae1406f526208faf6033d6dcc8ac100da;p=thirdparty%2Futil-linux.git 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 --- diff --git a/disk-utils/addpart.c b/disk-utils/addpart.c index c0f25a539e..73fd1ff4e6 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 324f56bbf5..60a9535243 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 e940e3bed4..efa7a70ef5 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 c6a98e10fe..ad9a863678 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 cf86281bb6..9c3e103358 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 a0f9db1d58..535184e811 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 0a1c6f27be..6b4b69e926 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 c0ed0177db..9d47548848 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 5030a50b10..43569ae710 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 c2c2389728..98e4b050c9 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 8ad6065316..08c4ef0b0b 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 d34e2fd351..b22c73fffa 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 bf5a4abf7e..00c263173f 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 2adbf00bb7..cc6690145e 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 765e3a4067..9a6235b5dc 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 73a1331ede..499dd8f640 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 a7498a4f17..89be2aed67 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