From 84d5eddb25930ee8a5ff96536ca6f707d793eb24 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 13 Dec 2020 22:34:05 +0100 Subject: [PATCH] help text: replace [OPTIONS] with actual options (if not too long) function old new delta packed_usage 33620 33665 +45 Signed-off-by: Denys Vlasenko --- coreutils/cp.c | 2 +- coreutils/ln.c | 4 ++-- coreutils/nl.c | 2 +- coreutils/paste.c | 2 +- editors/patch.c | 2 +- editors/vi.c | 2 +- loginutils/cryptpw.c | 10 +--------- modutils/insmod.c | 2 +- networking/ipcalc.c | 2 +- procps/fuser.c | 2 +- procps/pidof.c | 2 +- sysklogd/logger.c | 2 +- util-linux/fstrim.c | 8 -------- util-linux/umount.c | 8 ++++---- 14 files changed, 17 insertions(+), 33 deletions(-) diff --git a/coreutils/cp.c b/coreutils/cp.c index cfeb19fc4..9b9b8f7bf 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c @@ -38,7 +38,7 @@ /* http://www.opengroup.org/onlinepubs/007904975/utilities/cp.html */ //usage:#define cp_trivial_usage -//usage: "[OPTIONS] SOURCE... DEST" +//usage: "[-arPLHpfilsTu] SOURCE... DEST" //usage:#define cp_full_usage "\n\n" //usage: "Copy SOURCE(s) to DEST\n" //usage: "\n -a Same as -dpR" diff --git a/coreutils/ln.c b/coreutils/ln.c index 5591e8335..2dcf79c07 100644 --- a/coreutils/ln.c +++ b/coreutils/ln.c @@ -21,14 +21,14 @@ /* http://www.opengroup.org/onlinepubs/007904975/utilities/ln.html */ //usage:#define ln_trivial_usage -//usage: "[OPTIONS] TARGET... LINK|DIR" +//usage: "[-sfnbtv] [-S SUF] TARGET... LINK|DIR" //usage:#define ln_full_usage "\n\n" //usage: "Create a link LINK or DIR/TARGET to the specified TARGET(s)\n" //usage: "\n -s Make symlinks instead of hardlinks" //usage: "\n -f Remove existing destinations" //usage: "\n -n Don't dereference symlinks - treat like normal file" //usage: "\n -b Make a backup of the target (if exists) before link operation" -//usage: "\n -S suf Use suffix instead of ~ when making backup files" +//usage: "\n -S SUF Use suffix instead of ~ when making backup files" //usage: "\n -T Treat LINK as a file, not DIR" //usage: "\n -v Verbose" //usage: diff --git a/coreutils/nl.c b/coreutils/nl.c index aea019c56..800b73c26 100644 --- a/coreutils/nl.c +++ b/coreutils/nl.c @@ -19,7 +19,7 @@ //usage:#define nl_full_usage "\n\n" //usage: "Write FILEs to standard output with line numbers added\n" //usage: "\n -b STYLE Which lines to number - a: all, t: nonempty, n: none" -//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^TODO: support "pBRE": number only lines thatmatch regexp BRE" +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^TODO: support "pBRE": number only lines that match regexp BRE" ////usage: "\n -f STYLE footer lines" ////usage: "\n -h STYLE header lines" ////usage: "\n -d CC use CC for separating logical pages" diff --git a/coreutils/paste.c b/coreutils/paste.c index 11743297a..fd2aa5027 100644 --- a/coreutils/paste.c +++ b/coreutils/paste.c @@ -18,7 +18,7 @@ //kbuild:lib-$(CONFIG_PASTE) += paste.o //usage:#define paste_trivial_usage -//usage: "[OPTIONS] [FILE]..." +//usage: "[-d LIST] [-s] [FILE]..." //usage:#define paste_full_usage "\n\n" //usage: "Paste lines from each input file, separated with tab\n" //usage: "\n -d LIST Use delimiters from LIST, not tab" diff --git a/editors/patch.c b/editors/patch.c index aaa253591..110176630 100644 --- a/editors/patch.c +++ b/editors/patch.c @@ -31,7 +31,7 @@ //kbuild:lib-$(CONFIG_PATCH) += patch.o //usage:#define patch_trivial_usage -//usage: "[OPTIONS] [ORIGFILE [PATCHFILE]]" +//usage: "[-RNE] [-p N] [-i DIFF] [ORIGFILE [PATCHFILE]]" //usage:#define patch_full_usage "\n\n" //usage: " -p N Strip N leading components from file names" //usage: "\n -i DIFF Read DIFF instead of stdin" diff --git a/editors/vi.c b/editors/vi.c index 1dd0b6fb6..01597fa5e 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -166,7 +166,7 @@ //kbuild:lib-$(CONFIG_VI) += vi.o //usage:#define vi_trivial_usage -//usage: "[OPTIONS] [FILE]..." +//usage: IF_FEATURE_VI_COLON("[-c CMD] ")IF_FEATURE_VI_READONLY("[-R] ")"[FILE]..." //usage:#define vi_full_usage "\n\n" //usage: "Edit FILE\n" //usage: IF_FEATURE_VI_COLON( diff --git a/loginutils/cryptpw.c b/loginutils/cryptpw.c index fbb7f0515..645f1bb09 100644 --- a/loginutils/cryptpw.c +++ b/loginutils/cryptpw.c @@ -32,22 +32,14 @@ //kbuild:lib-$(CONFIG_MKPASSWD) += cryptpw.o //usage:#define cryptpw_trivial_usage -//usage: "[OPTIONS] [PASSWORD] [SALT]" +//usage: "[-s] [-p N] [-m TYPE] [-S SALT] [PASSWORD] [SALT]" /* We do support -s, we just don't mention it */ //usage:#define cryptpw_full_usage "\n\n" //usage: "Print crypt(3) hashed PASSWORD\n" -//usage: IF_LONG_OPTS( -//usage: "\n -P,--password-fd N Read password from fd N" -/* //usage: "\n -s,--stdin Use stdin; like -P0" */ -//usage: "\n -m,--method TYPE "CRYPT_METHODS_HELP_STR -//usage: "\n -S,--salt SALT" -//usage: ) -//usage: IF_NOT_LONG_OPTS( //usage: "\n -P N Read password from fd N" /* //usage: "\n -s Use stdin; like -P0" */ //usage: "\n -m TYPE "CRYPT_METHODS_HELP_STR //usage: "\n -S SALT" -//usage: ) #include "libbb.h" diff --git a/modutils/insmod.c b/modutils/insmod.c index bd79a0f26..8f7163e25 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c @@ -26,7 +26,7 @@ //usage:#if !ENABLE_MODPROBE_SMALL //usage:#define insmod_trivial_usage -//usage: IF_FEATURE_2_4_MODULES("[OPTIONS] MODULE") +//usage: IF_FEATURE_2_4_MODULES("[-fkvqLx] MODULE") //usage: IF_NOT_FEATURE_2_4_MODULES("FILE") //usage: IF_FEATURE_CMDLINE_MODULE_OPTIONS(" [SYMBOL=VALUE]...") //usage:#define insmod_full_usage "\n\n" diff --git a/networking/ipcalc.c b/networking/ipcalc.c index 09b146872..e82e35dd5 100644 --- a/networking/ipcalc.c +++ b/networking/ipcalc.c @@ -36,7 +36,7 @@ //kbuild:lib-$(CONFIG_IPCALC) += ipcalc.o //usage:#define ipcalc_trivial_usage -//usage: "[OPTIONS] ADDRESS" +//usage: "[-bnm"IF_FEATURE_IPCALC_FANCY("phs")"] ADDRESS" //usage: IF_FEATURE_IPCALC_FANCY("[/PREFIX]") " [NETMASK]" //usage:#define ipcalc_full_usage "\n\n" //usage: "Calculate and display network settings from IP address\n" diff --git a/procps/fuser.c b/procps/fuser.c index 418f57b57..191746751 100644 --- a/procps/fuser.c +++ b/procps/fuser.c @@ -19,7 +19,7 @@ //kbuild:lib-$(CONFIG_FUSER) += fuser.o //usage:#define fuser_trivial_usage -//usage: "[OPTIONS] FILE or PORT/PROTO" +//usage: "[-msk46] [-SIGNAL] FILE or PORT/PROTO" //usage:#define fuser_full_usage "\n\n" //usage: "Find processes which use FILEs or PORTs\n" //usage: "\n -m Find processes which use same fs as FILEs" diff --git a/procps/pidof.c b/procps/pidof.c index 5595e3421..b81709a81 100644 --- a/procps/pidof.c +++ b/procps/pidof.c @@ -39,7 +39,7 @@ //usage:#if (ENABLE_FEATURE_PIDOF_SINGLE || ENABLE_FEATURE_PIDOF_OMIT) //usage:#define pidof_trivial_usage -//usage: "[OPTIONS] [NAME]..." +//usage: IF_FEATURE_PIDOF_SINGLE("[-s] ")IF_FEATURE_PIDOF_OMIT("[-o PID] ")"[NAME]..." //usage:#define USAGE_PIDOF "\n" //usage:#else //usage:#define pidof_trivial_usage diff --git a/sysklogd/logger.c b/sysklogd/logger.c index 4d692d6fc..9422b6ea7 100644 --- a/sysklogd/logger.c +++ b/sysklogd/logger.c @@ -21,7 +21,7 @@ //kbuild:lib-$(CONFIG_LOGGER) += syslogd_and_logger.o //usage:#define logger_trivial_usage -//usage: "[OPTIONS] [MESSAGE]" +//usage: "[-s] [-t TAG] [-p PRIO] [MESSAGE]" //usage:#define logger_full_usage "\n\n" //usage: "Write MESSAGE (or stdin) to syslog\n" //usage: "\n -s Log to stderr as well as the system log" diff --git a/util-linux/fstrim.c b/util-linux/fstrim.c index 8d29a6d54..6d673002f 100644 --- a/util-linux/fstrim.c +++ b/util-linux/fstrim.c @@ -20,18 +20,10 @@ //usage:#define fstrim_trivial_usage //usage: "[OPTIONS] MOUNTPOINT" //usage:#define fstrim_full_usage "\n\n" -//usage: IF_LONG_OPTS( -//usage: " -o,--offset OFFSET Offset in bytes to discard from" -//usage: "\n -l,--length LEN Bytes to discard" -//usage: "\n -m,--minimum MIN Minimum extent length" -//usage: "\n -v,--verbose Print number of discarded bytes" -//usage: ) -//usage: IF_NOT_LONG_OPTS( //usage: " -o OFFSET Offset in bytes to discard from" //usage: "\n -l LEN Bytes to discard" //usage: "\n -m MIN Minimum extent length" //usage: "\n -v Print number of discarded bytes" -//usage: ) #include "libbb.h" #include diff --git a/util-linux/umount.c b/util-linux/umount.c index 63a3bf504..23da32868 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c @@ -41,16 +41,16 @@ //kbuild:lib-$(CONFIG_UMOUNT) += umount.o //usage:#define umount_trivial_usage -//usage: "[OPTIONS] FILESYSTEM|DIRECTORY" +//usage: "[-rlf"IF_FEATURE_MTAB_SUPPORT("m")IF_FEATURE_MOUNT_LOOP("d")IF_FEATURE_UMOUNT_ALL("a")"] [-t FSTYPE] FILESYSTEM|DIRECTORY" //usage:#define umount_full_usage "\n\n" -//usage: "Unmount file systems\n" +//usage: "Unmount filesystems\n" //usage: IF_FEATURE_UMOUNT_ALL( -//usage: "\n -a Unmount all file systems" IF_FEATURE_MTAB_SUPPORT(" in /etc/mtab") +//usage: "\n -a Unmount all filesystems" IF_FEATURE_MTAB_SUPPORT(" in /etc/mtab") //usage: ) //usage: IF_FEATURE_MTAB_SUPPORT( //usage: "\n -n Don't erase /etc/mtab entries" //usage: ) -//usage: "\n -r Try to remount devices as read-only if mount is busy" +//usage: "\n -r Remount devices read-only if mount is busy" //usage: "\n -l Lazy umount (detach filesystem)" //usage: "\n -f Force umount (i.e., unreachable NFS server)" //usage: IF_FEATURE_MOUNT_LOOP(