From 6a3e01d5a9f979f7d6e52665c2bf6c74e2592980 Mon Sep 17 00:00:00 2001 From: Pere Orga Date: Fri, 1 Apr 2011 22:56:30 +0200 Subject: move help text from include/usage.src.h to debianutils/*.c e2fsprogs/*.c editors/*.c loginutils/*.c mailutils/*.c Signed-off-by: Pere Orga Signed-off-by: Denys Vlasenko --- coreutils/length.c.disabled | 9 + debianutils/pipe_progress.c | 4 + debianutils/run_parts.c | 26 +++ debianutils/start_stop_daemon.c | 63 +++++++ debianutils/which.c | 9 + e2fsprogs/chattr.c | 24 +++ e2fsprogs/fsck.c | 14 ++ e2fsprogs/lsattr.c | 11 ++ editors/awk.c | 8 + editors/cmp.c | 9 + editors/diff.c | 22 +++ editors/ed.c | 3 + editors/sed.c | 17 ++ editors/vi.c | 13 ++ include/usage.src.h | 400 ---------------------------------------- loginutils/addgroup.c | 9 + loginutils/adduser.c | 15 ++ loginutils/chpasswd.c | 14 ++ loginutils/cryptpw.c | 39 ++++ loginutils/deluser.c | 12 ++ loginutils/login.c | 10 + loginutils/passwd.c | 12 ++ loginutils/sulogin.c | 7 + loginutils/vlock.c | 7 + mailutils/mime.c | 27 +++ mailutils/popmaildir.c | 34 ++++ 26 files changed, 418 insertions(+), 400 deletions(-) diff --git a/coreutils/length.c.disabled b/coreutils/length.c.disabled index 7f0b48ccd..aee898d22 100644 --- a/coreutils/length.c.disabled +++ b/coreutils/length.c.disabled @@ -5,6 +5,15 @@ /* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */ +//usage:#define length_trivial_usage +//usage: "STRING" +//usage:#define length_full_usage "\n\n" +//usage: "Print STRING's length" +//usage: +//usage:#define length_example_usage +//usage: "$ length Hello\n" +//usage: "5\n" + #include "libbb.h" /* This is a NOFORK applet. Be very careful! */ diff --git a/debianutils/pipe_progress.c b/debianutils/pipe_progress.c index 1e57dc241..2c7444f31 100644 --- a/debianutils/pipe_progress.c +++ b/debianutils/pipe_progress.c @@ -6,6 +6,10 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ + +//usage:#define pipe_progress_trivial_usage NOUSAGE_STR +//usage:#define pipe_progress_full_usage "" + #include "libbb.h" #define PIPE_PROGRESS_SIZE 4096 diff --git a/debianutils/run_parts.c b/debianutils/run_parts.c index b93a5a917..0c2302696 100644 --- a/debianutils/run_parts.c +++ b/debianutils/run_parts.c @@ -30,6 +30,32 @@ * -u MASK umask. Set the umask of the program executed to MASK. */ +//usage:#define run_parts_trivial_usage +//usage: "[-t] "IF_FEATURE_RUN_PARTS_FANCY("[-l] ")"[-a ARG] [-u MASK] DIRECTORY" +//usage:#define run_parts_full_usage "\n\n" +//usage: "Run a bunch of scripts in DIRECTORY\n" +//usage: "\nOptions:" +//usage: "\n -t Print what would be run, but don't actually run anything" +//usage: "\n -a ARG Pass ARG as argument for every program" +//usage: "\n -u MASK Set the umask to MASK before running every program" +//usage: IF_FEATURE_RUN_PARTS_FANCY( +//usage: "\n -l Print names of all matching files even if they are not executable" +//usage: ) +//usage: +//usage:#define run_parts_example_usage +//usage: "$ run-parts -a start /etc/init.d\n" +//usage: "$ run-parts -a stop=now /etc/init.d\n\n" +//usage: "Let's assume you have a script foo/dosomething:\n" +//usage: "#!/bin/sh\n" +//usage: "for i in $*; do eval $i; done; unset i\n" +//usage: "case \"$1\" in\n" +//usage: "start*) echo starting something;;\n" +//usage: "stop*) set -x; shutdown -h $stop;;\n" +//usage: "esac\n\n" +//usage: "Running this yields:\n" +//usage: "$run-parts -a stop=+4m foo/\n" +//usage: "+ shutdown -h +4m" + #include "libbb.h" struct globals { diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c index d2ee95068..30dd9709d 100644 --- a/debianutils/start_stop_daemon.c +++ b/debianutils/start_stop_daemon.c @@ -56,6 +56,69 @@ Misc options: -v,--verbose Verbose */ +//usage:#define start_stop_daemon_trivial_usage +//usage: "[OPTIONS] [-S|-K] ... [-- ARGS...]" +//usage:#define start_stop_daemon_full_usage "\n\n" +//usage: "Search for matching processes, and then\n" +//usage: "-K: stop all matching processes.\n" +//usage: "-S: start a process unless a matching process is found.\n" +//usage: IF_FEATURE_START_STOP_DAEMON_LONG_OPTIONS( +//usage: "\nProcess matching:" +//usage: "\n -u,--user USERNAME|UID Match only this user's processes" +//usage: "\n -n,--name NAME Match processes with NAME" +//usage: "\n in comm field in /proc/PID/stat" +//usage: "\n -x,--exec EXECUTABLE Match processes with this command" +//usage: "\n in /proc/PID/cmdline" +//usage: "\n -p,--pidfile FILE Match a process with PID from the file" +//usage: "\n All specified conditions must match" +//usage: "\n-S only:" +//usage: "\n -x,--exec EXECUTABLE Program to run" +//usage: "\n -a,--startas NAME Zeroth argument" +//usage: "\n -b,--background Background" +//usage: IF_FEATURE_START_STOP_DAEMON_FANCY( +//usage: "\n -N,--nicelevel N Change nice level" +//usage: ) +//usage: "\n -c,--chuid USER[:[GRP]] Change to user/group" +//usage: "\n -m,--make-pidfile Write PID to the pidfile specified by -p" +//usage: "\n-K only:" +//usage: "\n -s,--signal SIG Signal to send" +//usage: "\n -t,--test Match only, exit with 0 if a process is found" +//usage: "\nOther:" +//usage: IF_FEATURE_START_STOP_DAEMON_FANCY( +//usage: "\n -o,--oknodo Exit with status 0 if nothing is done" +//usage: "\n -v,--verbose Verbose" +//usage: ) +//usage: "\n -q,--quiet Quiet" +//usage: ) +//usage: IF_NOT_FEATURE_START_STOP_DAEMON_LONG_OPTIONS( +//usage: "\nProcess matching:" +//usage: "\n -u USERNAME|UID Match only this user's processes" +//usage: "\n -n NAME Match processes with NAME" +//usage: "\n in comm field in /proc/PID/stat" +//usage: "\n -x EXECUTABLE Match processes with this command" +//usage: "\n command in /proc/PID/cmdline" +//usage: "\n -p FILE Match a process with PID from the file" +//usage: "\n All specified conditions must match" +//usage: "\n-S only:" +//usage: "\n -x EXECUTABLE Program to run" +//usage: "\n -a NAME Zeroth argument" +//usage: "\n -b Background" +//usage: IF_FEATURE_START_STOP_DAEMON_FANCY( +//usage: "\n -N N Change nice level" +//usage: ) +//usage: "\n -c USER[:[GRP]] Change to user/group" +//usage: "\n -m Write PID to the pidfile specified by -p" +//usage: "\n-K only:" +//usage: "\n -s SIG Signal to send" +//usage: "\n -t Match only, exit with 0 if a process is found" +//usage: "\nOther:" +//usage: IF_FEATURE_START_STOP_DAEMON_FANCY( +//usage: "\n -o Exit with status 0 if nothing is done" +//usage: "\n -v Verbose" +//usage: ) +//usage: "\n -q Quiet" +//usage: ) + #include /* Override ENABLE_FEATURE_PIDFILE */ diff --git a/debianutils/which.c b/debianutils/which.c index a82641909..15fd598b7 100644 --- a/debianutils/which.c +++ b/debianutils/which.c @@ -10,6 +10,15 @@ * Based on which from debianutils */ +//usage:#define which_trivial_usage +//usage: "[COMMAND]..." +//usage:#define which_full_usage "\n\n" +//usage: "Locate a COMMAND" +//usage: +//usage:#define which_example_usage +//usage: "$ which login\n" +//usage: "/bin/login\n" + #include "libbb.h" int which_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; diff --git a/e2fsprogs/chattr.c b/e2fsprogs/chattr.c index ab52cb009..b1c77faad 100644 --- a/e2fsprogs/chattr.c +++ b/e2fsprogs/chattr.c @@ -19,6 +19,30 @@ * 98/12/29 - Display version info only when -V specified (G M Sipe) */ +//usage:#define chattr_trivial_usage +//usage: "[-R] [-+=AacDdijsStTu] [-v VERSION] [FILE]..." +//usage:#define chattr_full_usage "\n\n" +//usage: "Change file attributes on an ext2 fs\n" +//usage: "\nModifiers:" +//usage: "\n - Remove attributes" +//usage: "\n + Add attributes" +//usage: "\n = Set attributes" +//usage: "\nAttributes:" +//usage: "\n A Don't track atime" +//usage: "\n a Append mode only" +//usage: "\n c Enable compress" +//usage: "\n D Write dir contents synchronously" +//usage: "\n d Don't backup with dump" +//usage: "\n i Cannot be modified (immutable)" +//usage: "\n j Write all data to journal first" +//usage: "\n s Zero disk storage when deleted" +//usage: "\n S Write file contents synchronously" +//usage: "\n t Disable tail-merging of partial blocks with other files" +//usage: "\n u Allow file to be undeleted" +//usage: "\nOptions:" +//usage: "\n -R Recurse" +//usage: "\n -v Set the file's version/generation number" + #include "libbb.h" #include "e2fs_lib.h" diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c index a86a9d96f..b4257a2ad 100644 --- a/e2fsprogs/fsck.c +++ b/e2fsprogs/fsck.c @@ -34,6 +34,20 @@ * It doesn't guess filesystem types from on-disk format. */ +//usage:#define fsck_trivial_usage +//usage: "[-ANPRTV] [-C FD] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]..." +//usage:#define fsck_full_usage "\n\n" +//usage: "Check and repair filesystems\n" +//usage: "\nOptions:" +//usage: "\n -A Walk /etc/fstab and check all filesystems" +//usage: "\n -N Don't execute, just show what would be done" +//usage: "\n -P With -A, check filesystems in parallel" +//usage: "\n -R With -A, skip the root filesystem" +//usage: "\n -T Don't show title on startup" +//usage: "\n -V Verbose" +//usage: "\n -C n Write status information to specified filedescriptor" +//usage: "\n -t TYPE List of filesystem types to check" + #include "libbb.h" /* "progress indicator" code is somewhat buggy and ext[23] specific. diff --git a/e2fsprogs/lsattr.c b/e2fsprogs/lsattr.c index 7d475a969..964e8d026 100644 --- a/e2fsprogs/lsattr.c +++ b/e2fsprogs/lsattr.c @@ -18,6 +18,17 @@ * 98/12/29 - Display version info only when -V specified (G M Sipe) */ +//usage:#define lsattr_trivial_usage +//usage: "[-Radlv] [FILE]..." +//usage:#define lsattr_full_usage "\n\n" +//usage: "List file attributes on an ext2 fs\n" +//usage: "\nOptions:" +//usage: "\n -R Recurse" +//usage: "\n -a Don't hide entries starting with ." +//usage: "\n -d List directory entries instead of contents" +//usage: "\n -l List long flag names" +//usage: "\n -v List the file's version/generation number" + #include "libbb.h" #include "e2fs_lib.h" diff --git a/editors/awk.c b/editors/awk.c index 2eeb9d77a..9d38b1f88 100644 --- a/editors/awk.c +++ b/editors/awk.c @@ -7,6 +7,14 @@ * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//usage:#define awk_trivial_usage +//usage: "[OPTIONS] [AWK_PROGRAM] [FILE]..." +//usage:#define awk_full_usage "\n\n" +//usage: "Options:" +//usage: "\n -v VAR=VAL Set variable" +//usage: "\n -F SEP Use SEP as field separator" +//usage: "\n -f FILE Read program from FILE" + #include "libbb.h" #include "xregex.h" #include diff --git a/editors/cmp.c b/editors/cmp.c index f84a56e3e..3a0f5aa4f 100644 --- a/editors/cmp.c +++ b/editors/cmp.c @@ -10,6 +10,15 @@ /* BB_AUDIT SUSv3 (virtually) compliant -- uses nicer GNU format for -l. */ /* http://www.opengroup.org/onlinepubs/007904975/utilities/cmp.html */ +//usage:#define cmp_trivial_usage +//usage: "[-l] [-s] FILE1 [FILE2" IF_DESKTOP(" [SKIP1 [SKIP2]]") "]" +//usage:#define cmp_full_usage "\n\n" +//usage: "Compare FILE1 with FILE2 (or stdin)\n" +//usage: "\nOptions:" +//usage: "\n -l Write the byte numbers (decimal) and values (octal)" +//usage: "\n for all differing bytes" +//usage: "\n -s Quiet" + #include "libbb.h" static const char fmt_eof[] ALIGN1 = "cmp: EOF on %s\n"; diff --git a/editors/diff.c b/editors/diff.c index 3719bb49f..daa58af9b 100644 --- a/editors/diff.c +++ b/editors/diff.c @@ -76,6 +76,28 @@ * 6n words for files of length n. */ +//usage:#define diff_trivial_usage +//usage: "[-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2" +//usage:#define diff_full_usage "\n\n" +//usage: "Compare files line by line and output the differences between them.\n" +//usage: "This implementation supports unified diffs only.\n" +//usage: "\nOptions:" +//usage: "\n -a Treat all files as text" +//usage: "\n -b Ignore changes in the amount of whitespace" +//usage: "\n -B Ignore changes whose lines are all blank" +//usage: "\n -d Try hard to find a smaller set of changes" +//usage: "\n -i Ignore case differences" +//usage: "\n -L Use LABEL instead of the filename in the unified header" +//usage: "\n -N Treat absent files as empty" +//usage: "\n -q Output only whether files differ" +//usage: "\n -r Recurse" +//usage: "\n -S Start with FILE when comparing directories" +//usage: "\n -T Make tabs line up by prefixing a tab when necessary" +//usage: "\n -s Report when two files are the same" +//usage: "\n -t Expand tabs to spaces in output" +//usage: "\n -U Output LINES lines of context" +//usage: "\n -w Ignore all whitespace" + #include "libbb.h" #if 0 diff --git a/editors/ed.c b/editors/ed.c index b1b6a8d27..41ac88c32 100644 --- a/editors/ed.c +++ b/editors/ed.c @@ -7,6 +7,9 @@ * The "ed" built-in command (much simplified) */ +//usage:#define ed_trivial_usage "" +//usage:#define ed_full_usage "" + #include "libbb.h" typedef struct LINE { diff --git a/editors/sed.c b/editors/sed.c index d3555243f..9ab758bd7 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -58,6 +58,23 @@ Reference http://www.opengroup.org/onlinepubs/007904975/utilities/sed.html */ +//usage:#define sed_trivial_usage +//usage: "[-efinr] SED_CMD [FILE]..." +//usage:#define sed_full_usage "\n\n" +//usage: "Options:" +//usage: "\n -e CMD Add CMD to sed commands to be executed" +//usage: "\n -f FILE Add FILE contents to sed commands to be executed" +//usage: "\n -i Edit files in-place (else sends result to stdout)" +//usage: "\n -n Suppress automatic printing of pattern space" +//usage: "\n -r Use extended regex syntax" +//usage: "\n" +//usage: "\nIf no -e or -f, the first non-option argument is the sed command string." +//usage: "\nRemaining arguments are input files (stdin if none)." +//usage: +//usage:#define sed_example_usage +//usage: "$ echo \"foo\" | sed -e 's/f[a-zA-Z]o/bar/g'\n" +//usage: "bar\n" + #include "libbb.h" #include "xregex.h" diff --git a/editors/vi.c b/editors/vi.c index 602fc61d9..fd8bd0f78 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -21,6 +21,19 @@ * An "ex" line oriented mode- maybe using "cmdedit" */ +//usage:#define vi_trivial_usage +//usage: "[OPTIONS] [FILE]..." +//usage:#define vi_full_usage "\n\n" +//usage: "Edit FILE\n" +//usage: "\nOptions:" +//usage: IF_FEATURE_VI_COLON( +//usage: "\n -c Initial command to run ($EXINIT also available)" +//usage: ) +//usage: IF_FEATURE_VI_READONLY( +//usage: "\n -R Read-only" +//usage: ) +//usage: "\n -H Short help regarding available features" + #include "libbb.h" /* the CRASHME code is unmaintained, and doesn't currently build */ diff --git a/include/usage.src.h b/include/usage.src.h index d8360931f..2c88c46a1 100644 --- a/include/usage.src.h +++ b/include/usage.src.h @@ -40,28 +40,6 @@ INSERT "# acpid -l /var/log/my-acpi-log\n" \ "# acpid -e /proc/acpi/event\n" -#define addgroup_trivial_usage \ - "[-g GID] " IF_FEATURE_ADDUSER_TO_GROUP("[USER] ") "GROUP" -#define addgroup_full_usage "\n\n" \ - "Add a group " IF_FEATURE_ADDUSER_TO_GROUP("or add a user to a group") "\n" \ - "\nOptions:" \ - "\n -g GID Group id" \ - "\n -S Create a system group" \ - -#define adduser_trivial_usage \ - "[OPTIONS] USER" -#define adduser_full_usage "\n\n" \ - "Add a user\n" \ - "\nOptions:" \ - "\n -h DIR Home directory" \ - "\n -g GECOS GECOS field" \ - "\n -s SHELL Login shell" \ - "\n -G GRP Add user to existing group" \ - "\n -S Create a system user" \ - "\n -D Don't assign a password" \ - "\n -H Don't create home directory" \ - "\n -u UID User id" \ - #define adjtimex_trivial_usage \ "[-q] [-o OFF] [-f FREQ] [-p TCONST] [-t TICK]" #define adjtimex_full_usage "\n\n" \ @@ -110,14 +88,6 @@ INSERT "\n -s SRC_IP Sender IP address" \ "\n DST_IP Target IP address" \ -#define awk_trivial_usage \ - "[OPTIONS] [AWK_PROGRAM] [FILE]..." -#define awk_full_usage "\n\n" \ - "Options:" \ - "\n -v VAR=VAL Set variable" \ - "\n -F SEP Use SEP as field separator" \ - "\n -f FILE Read program from FILE" \ - #define beep_trivial_usage \ "-f FREQ -l LEN -d DELAY -r COUNT -n" #define beep_full_usage "\n\n" \ @@ -167,30 +137,6 @@ INSERT "each pair is a pair of arguments. Example:\n" \ "chat '' ATZ OK ATD123456 CONNECT '' ogin: pppuser word: ppppass '~'" \ -#define chattr_trivial_usage \ - "[-R] [-+=AacDdijsStTu] [-v VERSION] [FILE]..." -#define chattr_full_usage "\n\n" \ - "Change file attributes on an ext2 fs\n" \ - "\nModifiers:" \ - "\n - Remove attributes" \ - "\n + Add attributes" \ - "\n = Set attributes" \ - "\nAttributes:" \ - "\n A Don't track atime" \ - "\n a Append mode only" \ - "\n c Enable compress" \ - "\n D Write dir contents synchronously" \ - "\n d Don't backup with dump" \ - "\n i Cannot be modified (immutable)" \ - "\n j Write all data to journal first" \ - "\n s Zero disk storage when deleted" \ - "\n S Write file contents synchronously" \ - "\n t Disable tail-merging of partial blocks with other files" \ - "\n u Allow file to be undeleted" \ - "\nOptions:" \ - "\n -R Recurse" \ - "\n -v Set the file's version/generation number" \ - #define chcon_trivial_usage \ "[OPTIONS] CONTEXT FILE..." \ "\n chcon [OPTIONS] [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE..." \ @@ -284,15 +230,6 @@ INSERT "\n -t N Limit CPU time, process receives" \ "\n a SIGXCPU after N seconds" \ -#define cmp_trivial_usage \ - "[-l] [-s] FILE1 [FILE2" IF_DESKTOP(" [SKIP1 [SKIP2]]") "]" -#define cmp_full_usage "\n\n" \ - "Compare FILE1 with FILE2 (or stdin)\n" \ - "\nOptions:" \ - "\n -l Write the byte numbers (decimal) and values (octal)" \ - "\n for all differing bytes" \ - "\n -s Quiet" \ - #define bbconfig_trivial_usage \ "" #define bbconfig_full_usage "\n\n" \ @@ -355,57 +292,6 @@ INSERT "\n -r Delete crontab" \ "\n FILE Replace crontab by FILE ('-': stdin)" \ -#define cryptpw_trivial_usage \ - "[OPTIONS] [PASSWORD] [SALT]" -/* We do support -s, we just don't mention it */ -#define cryptpw_full_usage "\n\n" \ - "Crypt the PASSWORD using crypt(3)\n" \ - "\nOptions:" \ - IF_LONG_OPTS( \ - "\n -P,--password-fd=N Read password from fd N" \ -/* "\n -s,--stdin Use stdin; like -P0" */ \ - "\n -m,--method=TYPE Encryption method TYPE" \ - "\n -S,--salt=SALT" \ - ) \ - IF_NOT_LONG_OPTS( \ - "\n -P N Read password from fd N" \ -/* "\n -s Use stdin; like -P0" */ \ - "\n -m TYPE Encryption method TYPE" \ - "\n -S SALT" \ - ) \ - -/* mkpasswd is an alias to cryptpw */ - -#define mkpasswd_trivial_usage \ - "[OPTIONS] [PASSWORD] [SALT]" -/* We do support -s, we just don't mention it */ -#define mkpasswd_full_usage "\n\n" \ - "Crypt the PASSWORD using crypt(3)\n" \ - "\nOptions:" \ - IF_LONG_OPTS( \ - "\n -P,--password-fd=N Read password from fd N" \ -/* "\n -s,--stdin Use stdin; like -P0" */ \ - "\n -m,--method=TYPE Encryption method TYPE" \ - "\n -S,--salt=SALT" \ - ) \ - IF_NOT_LONG_OPTS( \ - "\n -P N Read password from fd N" \ -/* "\n -s Use stdin; like -P0" */ \ - "\n -m TYPE Encryption method TYPE" \ - "\n -S SALT" \ - ) \ - -#define delgroup_trivial_usage \ - IF_FEATURE_DEL_USER_FROM_GROUP("[USER] ")"GROUP" -#define delgroup_full_usage "\n\n" \ - "Delete group GROUP from the system" \ - IF_FEATURE_DEL_USER_FROM_GROUP(" or user USER from group GROUP") - -#define deluser_trivial_usage \ - "USER" -#define deluser_full_usage "\n\n" \ - "Delete USER from the system" - #define devmem_trivial_usage \ "ADDRESS [WIDTH [VALUE]]" @@ -435,28 +321,6 @@ INSERT #define dhcprelay_full_usage "\n\n" \ "Relay DHCP requests between clients and server" \ -#define diff_trivial_usage \ - "[-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2" -#define diff_full_usage "\n\n" \ - "Compare files line by line and output the differences between them.\n" \ - "This implementation supports unified diffs only.\n" \ - "\nOptions:" \ - "\n -a Treat all files as text" \ - "\n -b Ignore changes in the amount of whitespace" \ - "\n -B Ignore changes whose lines are all blank" \ - "\n -d Try hard to find a smaller set of changes" \ - "\n -i Ignore case differences" \ - "\n -L Use LABEL instead of the filename in the unified header" \ - "\n -N Treat absent files as empty" \ - "\n -q Output only whether files differ" \ - "\n -r Recurse" \ - "\n -S Start with FILE when comparing directories" \ - "\n -T Make tabs line up by prefixing a tab when necessary" \ - "\n -s Report when two files are the same" \ - "\n -t Expand tabs to spaces in output" \ - "\n -U Output LINES lines of context" \ - "\n -w Ignore all whitespace" \ - #define dmesg_trivial_usage \ "[-c] [-n LEVEL] [-s SIZE]" #define dmesg_full_usage "\n\n" \ @@ -531,9 +395,6 @@ INSERT "\n -t Close tray" \ "\n -T Open/close tray (toggle)" \ -#define ed_trivial_usage "" -#define ed_full_usage "" - #define ether_wake_trivial_usage \ "[-b] [-i iface] [-p aa:bb:cc:dd[:ee:ff]] MAC" #define ether_wake_full_usage "\n\n" \ @@ -679,20 +540,6 @@ INSERT #define freeramdisk_example_usage \ "$ freeramdisk /dev/ram2\n" -#define fsck_trivial_usage \ - "[-ANPRTV] [-C FD] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]..." -#define fsck_full_usage "\n\n" \ - "Check and repair filesystems\n" \ - "\nOptions:" \ - "\n -A Walk /etc/fstab and check all filesystems" \ - "\n -N Don't execute, just show what would be done" \ - "\n -P With -A, check filesystems in parallel" \ - "\n -R With -A, skip the root filesystem" \ - "\n -T Don't show title on startup" \ - "\n -V Verbose" \ - "\n -C n Write status information to specified filedescriptor" \ - "\n -t TYPE List of filesystem types to check" \ - #define fsck_minix_trivial_usage \ "[-larvsmf] BLOCKDEV" #define fsck_minix_full_usage "\n\n" \ @@ -1279,15 +1126,6 @@ INSERT #define logger_example_usage \ "$ logger \"hello\"\n" -#define login_trivial_usage \ - "[-p] [-h HOST] [[-f] USER]" -#define login_full_usage "\n\n" \ - "Begin a new session on the system\n" \ - "\nOptions:" \ - "\n -f Don't authenticate (user already authenticated)" \ - "\n -h Name of the remote host" \ - "\n -p Preserve environment" \ - #define logread_trivial_usage \ "[-f]" #define logread_full_usage "\n\n" \ @@ -1344,17 +1182,6 @@ INSERT "\n -h Print banner page too" \ "\n -V Verbose" \ -#define lsattr_trivial_usage \ - "[-Radlv] [FILE]..." -#define lsattr_full_usage "\n\n" \ - "List file attributes on an ext2 fs\n" \ - "\nOptions:" \ - "\n -R Recurse" \ - "\n -a Don't hide entries starting with ." \ - "\n -d List directory entries instead of contents" \ - "\n -l List long flag names" \ - "\n -v List the file's version/generation number" \ - #define lspci_trivial_usage \ "[-mk]" #define lspci_full_usage "\n\n" \ @@ -1424,21 +1251,6 @@ INSERT "/dev/hda[0-15]\n" #endif -#define makemime_trivial_usage \ - "[OPTIONS] [FILE]..." -#define makemime_full_usage "\n\n" \ - "Create multipart MIME-encoded message from FILEs\n" \ -/* "Transfer encoding is base64, disposition is inline (not attachment)\n" */ \ - "\nOptions:" \ - "\n -o FILE Output. Default: stdout" \ - "\n -a HDR Add header. Examples:" \ - "\n \"From: user@host.org\", \"Date: `date -R`\"" \ - "\n -c CT Content type. Default: text/plain" \ - "\n -C CS Charset. Default: " CONFIG_FEATURE_MIME_CHARSET \ -/* "\n -e ENC Transfer encoding. Ignored. base64 is assumed" */ \ - "\n" \ - "\nOther options are silently ignored" \ - #define man_trivial_usage \ "[-aw] [MANPAGE]..." #define man_full_usage "\n\n" \ @@ -1712,31 +1524,6 @@ INSERT #define parse_full_usage "" */ -#define passwd_trivial_usage \ - "[OPTIONS] [USER]" -#define passwd_full_usage "\n\n" \ - "Change USER's password. If no USER is specified,\n" \ - "changes the password for the current user.\n" \ - "\nOptions:" \ - "\n -a ALG Algorithm to use for password (des, md5)" /* ", sha1)" */ \ - "\n -d Delete password for the account" \ - "\n -l Lock (disable) account" \ - "\n -u Unlock (re-enable) account" \ - -#define chpasswd_trivial_usage \ - IF_LONG_OPTS("[--md5|--encrypted]") IF_NOT_LONG_OPTS("[-m|-e]") -#define chpasswd_full_usage "\n\n" \ - "Read user:password from stdin and update /etc/passwd\n" \ - "\nOptions:" \ - IF_LONG_OPTS( \ - "\n -e,--encrypted Supplied passwords are in encrypted form" \ - "\n -m,--md5 Use MD5 encryption instead of DES" \ - ) \ - IF_NOT_LONG_OPTS( \ - "\n -e Supplied passwords are in encrypted form" \ - "\n -m Use MD5 encryption instead of DES" \ - ) - #define pgrep_trivial_usage \ "[-flnovx] [-s SID|-P PPID|PATTERN]" #define pgrep_full_usage "\n\n" \ @@ -1779,9 +1566,6 @@ INSERT IF_FEATURE_PIDOF_OMIT( \ "$ pidof /bin/sh -o %PPID\n20351 5950") -#define pipe_progress_trivial_usage NOUSAGE_STR -#define pipe_progress_full_usage "" - #define pivot_root_trivial_usage \ "NEW_ROOT PUT_OLD" #define pivot_root_full_usage "\n\n" \ @@ -1802,38 +1586,6 @@ INSERT "\n -s Match session ID (0 for current)" \ "\n -P Match parent process ID" \ -#define popmaildir_trivial_usage \ - "[OPTIONS] MAILDIR [CONN_HELPER ARGS]" -#define popmaildir_full_usage "\n\n" \ - "Fetch content of remote mailbox to local maildir\n" \ - "\nOptions:" \ -/* "\n -b Binary mode. Ignored" */ \ -/* "\n -d Debug. Ignored" */ \ -/* "\n -m Show used memory. Ignored" */ \ -/* "\n -V Show version. Ignored" */ \ -/* "\n -c Use tcpclient. Ignored" */ \ -/* "\n -a Use APOP protocol. Implied. If server supports APOP -> use it" */ \ - "\n -s Skip authorization" \ - "\n -T Get messages with TOP instead of RETR" \ - "\n -k Keep retrieved messages on the server" \ - "\n -t SEC Network timeout" \ - IF_FEATURE_POPMAILDIR_DELIVERY( \ - "\n -F \"PROG ARGS\" Filter program (may be repeated)" \ - "\n -M \"PROG ARGS\" Delivery program" \ - ) \ - "\n" \ - "\nFetch from plain POP3 server:" \ - "\npopmaildir -k DIR nc pop3.server.com 110 = BYTES. Ignored" */ -/* "\n -Z N1-N2 Remove messages from N1 to N2 (dangerous). Ignored" */ -/* "\n -L BYTES Don't retrieve new messages >= BYTES. Ignored" */ -/* "\n -H LINES Type first LINES of a message. Ignored" */ -#define popmaildir_example_usage \ - "$ popmaildir -k ~/Maildir -- nc pop.drvv.ru 110 [ #include diff --git a/loginutils/passwd.c b/loginutils/passwd.c index f3928cecc..8b6a63eec 100644 --- a/loginutils/passwd.c +++ b/loginutils/passwd.c @@ -2,6 +2,18 @@ /* * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ + +//usage:#define passwd_trivial_usage +//usage: "[OPTIONS] [USER]" +//usage:#define passwd_full_usage "\n\n" +//usage: "Change USER's password. If no USER is specified,\n" +//usage: "changes the password for the current user.\n" +//usage: "\nOptions:" +//usage: "\n -a ALG Algorithm to use for password (des, md5)" /* ", sha1)" */ +//usage: "\n -d Delete password for the account" +//usage: "\n -l Lock (disable) account" +//usage: "\n -u Unlock (re-enable) account" + #include "libbb.h" #include diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c index 0e5b59433..28edf067c 100644 --- a/loginutils/sulogin.c +++ b/loginutils/sulogin.c @@ -5,6 +5,13 @@ * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//usage:#define sulogin_trivial_usage +//usage: "[-t N] [TTY]" +//usage:#define sulogin_full_usage "\n\n" +//usage: "Single user login\n" +//usage: "\nOptions:" +//usage: "\n -t N Timeout" + #include "libbb.h" #include diff --git a/loginutils/vlock.c b/loginutils/vlock.c index 3299afa50..efad63ff3 100644 --- a/loginutils/vlock.c +++ b/loginutils/vlock.c @@ -15,6 +15,13 @@ /* Fixed by Erik Andersen to do passwords the tinylogin way... * It now works with md5, sha1, etc passwords. */ +//usage:#define vlock_trivial_usage +//usage: "[-a]" +//usage:#define vlock_full_usage "\n\n" +//usage: "Lock a virtual terminal. A password is required to unlock.\n" +//usage: "\nOptions:" +//usage: "\n -a Lock all VTs" + #include "libbb.h" #ifdef __linux__ diff --git a/mailutils/mime.c b/mailutils/mime.c index 1e393ed31..0aff8b1d7 100644 --- a/mailutils/mime.c +++ b/mailutils/mime.c @@ -7,6 +7,33 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ + +//usage:#define makemime_trivial_usage +//usage: "[OPTIONS] [FILE]..." +//usage:#define makemime_full_usage "\n\n" +//usage: "Create multipart MIME-encoded message from FILEs\n" +/* //usage: "Transfer encoding is base64, disposition is inline (not attachment)\n" */ +//usage: "\nOptions:" +//usage: "\n -o FILE Output. Default: stdout" +//usage: "\n -a HDR Add header. Examples:" +//usage: "\n \"From: user@host.org\", \"Date: `date -R`\"" +//usage: "\n -c CT Content type. Default: text/plain" +//usage: "\n -C CS Charset. Default: " CONFIG_FEATURE_MIME_CHARSET +/* //usage: "\n -e ENC Transfer encoding. Ignored. base64 is assumed" */ +//usage: "\n" +//usage: "\nOther options are silently ignored" + +//usage:#define reformime_trivial_usage +//usage: "[OPTIONS] [FILE]..." +//usage:#define reformime_full_usage "\n\n" +//usage: "Parse MIME-encoded message\n" +//usage: "\nOptions:" +//usage: "\n -x PREFIX Extract content of MIME sections to files" +//usage: "\n -X PROG ARGS Filter content of MIME sections through PROG" +//usage: "\n Must be the last option" +//usage: "\n" +//usage: "\nOther options are silently ignored" + #include "libbb.h" #include "mail.h" diff --git a/mailutils/popmaildir.c b/mailutils/popmaildir.c index 6b733441f..642657919 100644 --- a/mailutils/popmaildir.c +++ b/mailutils/popmaildir.c @@ -9,6 +9,40 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ + +//usage:#define popmaildir_trivial_usage +//usage: "[OPTIONS] MAILDIR [CONN_HELPER ARGS]" +//usage:#define popmaildir_full_usage "\n\n" +//usage: "Fetch content of remote mailbox to local maildir\n" +//usage: "\nOptions:" +/* //usage: "\n -b Binary mode. Ignored" */ +/* //usage: "\n -d Debug. Ignored" */ +/* //usage: "\n -m Show used memory. Ignored" */ +/* //usage: "\n -V Show version. Ignored" */ +/* //usage: "\n -c Use tcpclient. Ignored" */ +/* //usage: "\n -a Use APOP protocol. Implied. If server supports APOP -> use it" */ +//usage: "\n -s Skip authorization" +//usage: "\n -T Get messages with TOP instead of RETR" +//usage: "\n -k Keep retrieved messages on the server" +//usage: "\n -t SEC Network timeout" +//usage: IF_FEATURE_POPMAILDIR_DELIVERY( +//usage: "\n -F \"PROG ARGS\" Filter program (may be repeated)" +//usage: "\n -M \"PROG ARGS\" Delivery program" +//usage: ) +//usage: "\n" +//usage: "\nFetch from plain POP3 server:" +//usage: "\npopmaildir -k DIR nc pop3.server.com 110 = BYTES. Ignored" */ +/* //usage: "\n -Z N1-N2 Remove messages from N1 to N2 (dangerous). Ignored" */ +/* //usage: "\n -L BYTES Don't retrieve new messages >= BYTES. Ignored" */ +/* //usage: "\n -H LINES Type first LINES of a message. Ignored" */ +//usage: +//usage:#define popmaildir_example_usage +//usage: "$ popmaildir -k ~/Maildir -- nc pop.drvv.ru 110 [