Updates from both Vladimir and Larry
[oweals/busybox.git] / usage.h
diff --git a/usage.h b/usage.h
index 772585b540ae8b90a685fe23710f6dfd67d1fc72..63c00c674e80df7618c2d6921e29264f154e4546 100644 (file)
--- a/usage.h
+++ b/usage.h
@@ -1,7 +1,20 @@
+#define adjtimex_trivial_usage \
+       "[-q] [-o offset] [-f frequency] [-p timeconstant] [-t tick]"
+#define adjtimex_full_usage \
+       "Reads and optionally sets system timebase parameters.\n" \
+       "See adjtimex(2).\n\n" \
+       "Options:\n" \
+       "\t-q\t\tquiet mode - do not print\n" \
+       "\t-o offset\ttime offset, microseconds\n" \
+       "\t-f frequency\tfrequency adjust, integer kernel units (65536 is 1ppm)\n" \
+       "\t\t\t(positive values make the system clock run fast)\n" \
+       "\t-t tick\t\tmicroseconds per tick, usually 10000\n" \
+       "\t-p timeconstant\n"
+
 #define ar_trivial_usage \
-       "-[ovR]{ptx} archive filenames"
+       "-[ovR]{ptx} ARCHIVE FILES"
 #define ar_full_usage \
-       "Extract or list files from an ar archive.\n\n" \
+       "Extract or list FILES from an ar archive.\n\n" \
        "Options:\n" \
        "\t-o\t\tpreserve original dates\n" \
        "\t-p\t\textract to stdout\n" \
        "-r--r--r--    1 root     root            0 Apr 12 18:25 /tmp/foo\n"
 
 #define chown_trivial_usage \
-       "[OPTION]...  OWNER[<.|:>[GROUP] FILE..."
+       "[ -Rh ]...  OWNER[<.|:>[GROUP]] FILE..."
 #define chown_full_usage \
        "Change the owner and/or group of each FILE to OWNER and/or GROUP.\n" \
        "\nOptions:\n" \
-       "\t-R\tChanges files and directories recursively."
+       "\t-R\tChanges files and directories recursively.\n" \
+       "\t-h\tDo not dereference symbolic links."
 #define chown_example_usage \
        "$ ls -l /tmp/foo\n" \
        "-r--r--r--    1 andersen andersen        0 Apr 12 18:25 /tmp/foo\n" \
 #define cmp_trivial_usage \
        "FILE1 [FILE2]"
 #define cmp_full_usage \
+       "\t-s\tquiet mode - do not print\n" \
        "Compare files."
 
 #define cp_trivial_usage \
   #define USAGE_NOT_HUMAN_READABLE(a) a
 #endif
 #define df_trivial_usage \
-       "[-" USAGE_HUMAN_READABLE("hm") USAGE_NOT_HUMAN_READABLE("") "k] [filesystem ...]"
+       "[-" USAGE_HUMAN_READABLE("hm") USAGE_NOT_HUMAN_READABLE("") "k] [FILESYSTEM ...]"
 #define df_full_usage \
        "Print the filesystem space used and space available.\n\n" \
        "Options:\n" \
        "\t-s SIZE\t\tUse a buffer of size SIZE"
 
 #define dos2unix_trivial_usage \
-       "[option] [file]"
+       "[option] [FILE]"
 #define dos2unix_full_usage \
-       "Converts a text file to/from dos format to unix format.\n\n" \
+       "Converts FILE from dos format to unix format.  When no option\n" \
+       "is given, the input is converted to the opposite output format.\n" \
+       "When no file is given, uses stdin for input and stdout for output." \
        "Options:\n" \
        "\t-u\toutput will be in UNIX format\n" \
        "\t-d\toutput will be in DOS format\n\n" \
-       "- when no option is given then input format will be automaticaly detected\n" \
-       "  and converted to the oposite format on output\n" \
-       "- when no file is given, then stdin is used as input and stdout as output"
 
 #define dpkg_trivial_usage \
        "[-i|-r|--unpack|--configure] my.deb"
 #define dpkg_full_usage \
-       "WORK IN PROGRESS, only usefull for debian-installer"
+       "WORK IN PROGRESS, only useful for debian-installer"
 
 #define dpkg_deb_trivial_usage \
-       "[-cexX] file directory"
+       "[-cefItxX] FILE [argument]"
 #define dpkg_deb_full_usage \
        "Perform actions on debian packages (.debs)\n\n" \
        "Options:\n" \
-       "\t-c\tList contents of filesystem tree (verbose)\n" \
-       "\t-l\tList contents of filesystem tree (.list format)\n" \
-       "\t-e\tExtract control files to directory\n" \
+       "\t-c\tList contents of filesystem tree\n" \
+       "\t-e\tExtract control files to [argument] directory\n" \
+       "\t-f\tDisplay control field name starting with [argument]\n" \
+       "\t-I\tDisplay the control filenamed [argument]\n" \
+       "\t-t\tExtract filesystem tree to stdout in tar format\n" \
        "\t-x\tExctract packages filesystem tree to directory\n" \
        "\t-X\tVerbose extract"
 #define dpkg_deb_example_usage \
 #define echo_example_usage \
        "$ echo "Erik is cool"\n" \
        "Erik is cool\n" \
-       "$  echo -e "Erik\nis\ncool"\n" \
+       "$  echo -e "Erik\\nis\\ncool"\n" \
        "Erik\n" \
        "is\n" \
        "cool\n" \
-       "$ echo "Erik\nis\ncool"\n" \
-       "Erik\nis\ncool\n"
+       "$ echo "Erik\\nis\\ncool"\n" \
+       "Erik\\nis\\ncool\n"
+
+#define env_trivial_usage \
+       "[-iu] [-] [name=value]... [command]"
+#define env_full_usage \
+       "Prints the current environment or runs a program after setting\n" \
+       "up the specified environment.\n\n" \
+       "Options:\n" \
+       "\t-, -i\tstart with an empty environment\n" \
+       "\t-u\tremove variable from the environment\n"
 
 #define expr_trivial_usage \
        "EXPRESSION"
        "the current directory; default EXPRESSION is '-print'\n" \
        "\nEXPRESSION may consist of:\n" \
        "\t-follow\t\tDereference symbolic links.\n" \
-       "\t-name PATTERN\tFile name (leading directories removed) matches PATTERN." \
+       "\t-name PATTERN\tFile name (leading directories removed) matches PATTERN.\n" \
+       "\t-print\t\tPrint (default and assumed).\n" \
        USAGE_FIND_TYPE( \
        "\n\t-type X\t\tFiletype matches X (where X is one of: f,d,l,b,c,...)" \
 ) USAGE_FIND_PERM( \
         "done\n"
 
 #define grep_trivial_usage \
-       "[-ihHnqvs] pattern [files...]"
+       "[-ihHnqvs] PATTERN [FILEs...]"
 #define grep_full_usage \
        "Search for PATTERN in each FILE or standard input.\n\n" \
        "Options:\n" \
        "\t-H\tprefix output lines with filename where match was found\n" \
        "\t-h\tsuppress the prefixing filename on output\n" \
        "\t-i\tignore case distinctions\n" \
+       "\t-l\tlist names of files that match\n" \
        "\t-n\tprint line number with output lines\n" \
        "\t-q\tbe quiet. Returns 0 if result was found, 1 otherwise\n" \
        "\t-v\tselect non-matching lines\n" \
        "\t-c\tWrite output to standard output instead of FILE.gz\n" \
        "\t-d\tdecompress"
 #define gzip_example_usage \
-       "$ ls -la /tmp/BusyBox*\n" \
-       "-rw-rw-r--    1 andersen andersen  1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar\n" \
-       "$ gzip /tmp/BusyBox-0.43.tar\n" \
-       "$ ls -la /tmp/BusyBox*\n" \
-       "-rw-rw-r--    1 andersen andersen   554058 Apr 14 17:49 /tmp/BusyBox-0.43.tar.gz\n"
+       "$ ls -la /tmp/busybox*\n" \
+       "-rw-rw-r--    1 andersen andersen  1761280 Apr 14 17:47 /tmp/busybox.tar\n" \
+       "$ gzip /tmp/busybox.tar\n" \
+       "$ ls -la /tmp/busybox*\n" \
+       "-rw-rw-r--    1 andersen andersen   554058 Apr 14 17:49 /tmp/busybox.tar.gz\n"
 
 #define halt_trivial_usage \
        ""
        "Print out a unique 32-bit identifier for the machine."
 
 #define hostname_trivial_usage \
-       "[OPTION] {hostname | -F file}"
+       "[OPTION] {hostname | -F FILE}"
 #define hostname_full_usage \
        "Get or set the hostname or DNS domain name. If a hostname is given\n" \
-       "(or a file with the -F parameter), the host name will be set.\n\n" \
+       "(or FILE with the -F parameter), the host name will be set.\n\n" \
        "Options:\n" \
        "\t-s\t\tShort\n" \
        "\t-i\t\tAddresses for the hostname\n" \
        "\t-F, --file FILE\tUse the contents of FILE to specify the hostname"
 #define hostname_example_usage \
        "$ hostname\n" \
-       "slag \n"
+       "sage \n"
 
 #define id_trivial_usage \
        "[OPTIONS]... [USERNAME]"
 "\n" \
 "      ::sysinit:/etc/init.d/rcS\n" \
 "      ::askfirst:/bin/sh\n" \
+"      ::ctrlaltdel:/sbin/reboot\n" \
+"      ::shutdown:/sbin/swapoff -a\n" \
+"      ::shutdown:/bin/umount -a -r\n" \
 "\n" \
 "if it detects that /dev/console is _not_ a serial console, it will also run:\n" \
 "\n" \
 "      tty2::askfirst:/bin/sh\n" \
+"      tty3::askfirst:/bin/sh\n" \
+"      tty4::askfirst:/bin/sh\n" \
 "\n" \
 "If you choose to use an /etc/inittab file, the inittab entry format is as follows:\n" \
 "\n" \
 "      <action>: \n" \
 "\n" \
 "              Valid actions include: sysinit, respawn, askfirst, wait, \n" \
-"              once, and ctrlaltdel.\n" \
+"              once, ctrlaltdel, and shutdown.\n" \
 "\n" \
 "              The available actions can be classified into two groups: actions\n" \
 "              that are run only once, and actions that are re-run when the specified\n" \
 "                      'wait' actions, like  'sysinit' actions, cause init to wait until\n" \
 "                      the specified task completes.  'once' actions are asyncronous,\n" \
 "                      therefore, init does not wait for them to complete.  'ctrlaltdel'\n" \
-"                      actions are run immediately before init causes the system to reboot\n" \
-"                      (unmounting filesystems with a 'ctrlaltdel' action is a very good\n" \
-"                      idea).\n" \
+"                      actions are run when the system detects that someone on the system\n" \
+"                       console has pressed the CTRL-ALT-DEL key combination.  Typically one\n" \
+"                       wants to run 'reboot' at this point to cause the system to reboot.\n" \
+"                      Finally the 'shutdown' action specifies the actions to taken when\n" \
+"                       init is told to reboot.  Unmounting filesystems and disabling swap\n" \
+"                       is a very good here\n" \
 "\n" \
 "              Run repeatedly actions:\n" \
 "\n" \
 "      #::respawn:/sbin/getty 57600 ttyS2\n" \
 "      \n" \
 "      # Stuff to do before rebooting\n" \
-"      ::ctrlaltdel:/bin/umount -a -r\n" \
-"      ::ctrlaltdel:/sbin/swapoff -a\n"
+"      ::ctrlaltdel:/sbin/reboot\n" \
+"      ::shutdown:/bin/umount -a -r\n" \
+"      ::shutdown:/sbin/swapoff -a\n"
 
 #define insmod_trivial_usage \
        "[OPTION]... MODULE [symbol=value]..."
 #define length_full_usage \
        "Prints out the length of the specified STRING."
 #define length_example_usage \
-       "$ length "Hello"\n" \
+       "$ length Hello\n" \
        "5\n"
 
 #define ln_trivial_usage \
 #define mkdir_trivial_usage \
        "[OPTION] DIRECTORY..."
 #define mkdir_full_usage \
-       "Create the DIRECTORY(ies), if they do not already exist\n\n" \
+       "Create the DIRECTORY(ies) if they do not already exist\n\n" \
        "Options:\n" \
        "\t-m\tset permission mode (as in chmod), not rwxrwxrwx - umask\n" \
        "\t-p\tno error if existing, make parent directories as needed"
 #else
   #define USAGE_MOUNT_LOOP(a)
 #endif
-#ifdef BB_MTAB
+#ifdef BB_FEATURE_MTAB_SUPPORT
   #define USAGE_MTAB(a) a
 #else
   #define USAGE_MTAB(a)
 #endif
 #define mount_trivial_usage \
-       "[flags] device directory [-o options,more-options]"
+       "[flags] DEVICE NODE [-o options,more-options]"
 #define mount_full_usage \
        "Mount a filesystem\n\n" \
        "Flags:\n"  \
        "\tsuid/nosuid:\tAllow set-user-id-root programs / disallow them.\n" \
        "\tremount:\tRe-mount a mounted filesystem, changing its flags.\n" \
        "\tro/rw:\t\tMount for read-only / read-write.\n" \
+       "\tbind:\t\tUse the linux 2.4.x \"bind\" feature.\n" \
        "\nThere are EVEN MORE flags that are specific to each filesystem.\n" \
-       "You'll have to see the written documentation for those."
+       "You'll have to see the written documentation for those filesystems."
 #define mount_example_usage \
        "$ mount\n" \
        "/dev/hda3 on / type minix (rw)\n" \
        "Name:       debian\n" \
        "Address:    127.0.0.1\n" 
 
-#ifdef BB_FEATURE_SIMPLE_PING
+#ifndef BB_FEATURE_FANCY_PING
 #define ping_trivial_usage "host"
 #define ping_full_usage    "Send ICMP ECHO_REQUEST packets to network hosts"
 #else
        "round-trip min/avg/max = 20.1/20.1/20.1 ms\n" 
 
 #define pivot_root_trivial_usage \
-       "new_root put_old"
+       "NEW_ROOT PUT_OLD"
 #define pivot_root_full_usage \
-       "Move the current root file system to put_old and make new_root\n" \
+       "Move the current root file system to PUT_OLD and make NEW_ROOT\n" \
        "the new root file system."
 
 #define poweroff_trivial_usage \
        "Formats and prints ARGUMENT(s) according to FORMAT,\n" \
        "Where FORMAT controls the output exactly as in C printf."
 #define printf_example_usage \
-       "$ printf "Val=%d\n" 5\n" \
+       "$ printf "Val=%d\\n" 5\n" \
        "Val=5\n" 
 
 #define ps_trivial_usage \
 #define reset_full_usage \
        "Resets the screen."
 
-#ifdef BB_FEATURE_RM_INTERACTIVE
-  #define USAGE_RM_INTERACTIVE(a) a
-#else
-  #define USAGE_RM_INTERACTIVE(a)
-#endif
 #define rm_trivial_usage \
        "[OPTION]... FILE..."
 #define rm_full_usage \
        "Remove (unlink) the FILE(s).  You may use '--' to\n" \
        "indicate that all following arguments are non-options.\n\n" \
        "Options:\n" \
-       USAGE_RM_INTERACTIVE("\t-i\t\talways prompt before removing each destinations\n") \
+       "\t-i\t\talways prompt before removing each destination" \
        "\t-f\t\tremove existing destinations, never prompt\n" \
        "\t-r or -R\tremove the contents of directories recursively"
 #define rm_example_usage \
        "[2 second delay results]\n"
 
 
+#ifdef BB_FEATURE_SORT_UNIQUE
+  #define USAGE_SORT_UNIQUE(a) a
+#else
+  #define USAGE_SORT_UNIQUE(a)
+#endif
 #ifdef BB_FEATURE_SORT_REVERSE
   #define USAGE_SORT_REVERSE(a) a
 #else
   #define USAGE_SORT_REVERSE(a)
 #endif
 #define sort_trivial_usage \
-       "[-n]" USAGE_SORT_REVERSE(" [-r]") " [FILE]..."
+       "[-n" USAGE_SORT_REVERSE("r") USAGE_SORT_UNIQUE("u") "] [FILE]..."
 #define sort_full_usage \
-       "Sorts lines of text in the specified files"
+       "Sorts lines of text in the specified files\n\n"\
+       "Options:\n" \
+       USAGE_SORT_UNIQUE("\t-u\tsuppress duplicate lines\n") \
+       USAGE_SORT_REVERSE("\t-r\tsort in reverse order\n") \
+       "\t-n\tsort numerics"
 #define sort_example_usage \
-       "$ echo -e "e\nf\nb\nd\nc\na" | sort\n" \
+       "$ echo -e \"e\\nf\\nb\\nd\\nc\\na\" | sort\n" \
        "a\n" \
        "b\n" \
        "c\n" \
        "f\n"
 
 #define stty_trivial_usage \
-       "[-a|g] [-F device] [SETTING]..."
+       "[-a|g] [-F DEVICE] [SETTING]..."
 #define stty_full_usage \
        "Without arguments, prints baud rate, line discipline," \
        "\nand deviations from stty sane." \
        "\n\nOptions:" \
-       "\n\t-F device\topen device instead of stdin" \
+       "\n\t-F DEVICE\topen device instead of stdin" \
        "\n\t-a\t\tprint all current settings in human-readable form" \
        "\n\t-g\t\tprint in stty-readable form" \
-       "\n\t[SETTING]\tsee documentation"
+       "\n\t[SETTING]\tsee manpage"
 
 #define swapoff_trivial_usage \
-       "[OPTION] [device]"
+       "[OPTION] [DEVICE]"
 #define swapoff_full_usage \
-       "Stop swapping virtual memory pages on the given device.\n\n" \
+       "Stop swapping virtual memory pages on DEVICE.\n\n" \
        "Options:\n" \
        "\t-a\tStop swapping on all swap devices"
 
 #define swapon_trivial_usage \
-       "[OPTION] [device]"
+       "[OPTION] [DEVICE]"
 #define swapon_full_usage \
-       "Start swapping virtual memory pages on the given device.\n\n" \
+       "Start swapping virtual memory pages on DEVICE.\n\n" \
        "Options:\n" \
        "\t-a\tStart swapping on all swap devices"
 
        "$ syslogd -R 192.168.1.1:601\n"
 
 
-#ifdef BB_FEATURE_SIMPLE_TAIL
+#ifndef BB_FEATURE_FANCY_TAIL
   #define USAGE_UNSIMPLE_TAIL(a)
 #else
   #define USAGE_UNSIMPLE_TAIL(a) a
 #endif
 #define tar_trivial_usage \
        "-[" USAGE_TAR_CREATE("c") "xtvO] " \
-       USAGE_TAR_EXCLUDE("[--exclude File] [-X File]") \
-       "[-f tarFile] [FILE(s)] ..."
+       USAGE_TAR_EXCLUDE("[--exclude FILE] [-X FILE]") \
+       "[-f TARFILE] [FILE(s)] ..."
 #define tar_full_usage \
        "Create, extract, or list files from a tar file.\n\n" \
        "Main operation mode:\n" \
        "\tx\t\textract\n" \
        "\tt\t\tlist\n" \
        "\nFile selection:\n" \
-       "\tf\t\tname of tarfile or \"-\" for stdin\n" \
+       "\tf\t\tname of TARFILE or \"-\" for stdin\n" \
        "\tO\t\textract to stdout\n" \
        USAGE_TAR_EXCLUDE( \
        "\texclude\t\tfile to exclude\n" \
        "Hello\n"
 
 #define telnet_trivial_usage \
-       "host [port]"
+       "HOST [PORT]"
 #define telnet_full_usage \
        "Telnet is used to establish interactive communication with another\n"\
        "computer over a network using the TELNET protocol."
         USAGE_TFTP_PUT(        \
        "\tput\tPut local file SOURCE to server DEST.\n" \
        ) \
-       "\nWhen nameing a server, use the syntax \"server:file\"."
+       "\nWhen naming a server, use the syntax \"server:file\"."
 
 #define touch_trivial_usage \
-       "[-c] file [file ...]"
+       "[-c] FILE [FILE ...]"
 #define touch_full_usage \
-       "Update the last-modified date on the given file[s].\n\n" \
+       "Update the last-modified date on the given FILE[s].\n\n" \
        "Options:\n" \
        "\t-c\tDo not create any files"
 #define touch_example_usage \
   #define USAGE_MOUNT_FORCE(a)
 #endif
 #define umount_trivial_usage \
-       "[flags] filesystem|directory"
+       "[flags] FILESYSTEM|DIRECTORY"
 #define umount_full_usage \
        "Unmount file systems\n" \
-       "\nFlags:\n" "\t-a:\tUnmount all file systems" \
-       USAGE_MTAB(" in /etc/mtab\n\t-n:\tDon't erase /etc/mtab entries") \
-       "\n\t-r:\tTry to remount devices as read-only if mount is busy" \
-       USAGE_MOUNT_FORCE("\n\t-f:\tForce filesystem umount (i.e. unreachable NFS server)") \
-       USAGE_MOUNT_LOOP("\n\t-l:\tDo not free loop device (if a loop device has been used)")
+       "\nFlags:\n" "\t-a\tUnmount all file systems" \
+       USAGE_MTAB(" in /etc/mtab\n\t-n\tDon't erase /etc/mtab entries") \
+       "\n\t-r\tTry to remount devices as read-only if mount is busy" \
+       USAGE_MOUNT_FORCE("\n\t-f\tForce umount (i.e. unreachable NFS server)") \
+       USAGE_MOUNT_LOOP("\n\t-l\tDo not free loop device (if a loop device has been used)")
 #define umount_example_usage \
        "$ umount /dev/hdc1 \n"
 
        "\t-d\tonly print duplicate lines\n" \
        "\t-u\tonly print unique lines"
 #define uniq_example_usage \
-       "$ echo -e "a\na\nb\nc\nc\na" | sort | uniq\n" \
+       "$ echo -e \"a\\na\\nb\\nc\\nc\\na\" | sort | uniq\n" \
        "a\n" \
        "b\n" \
        "c\n"
 
 #define unix2dos_trivial_usage \
-       "[option] [file]"
+       "[option] [FILE]"
 #define unix2dos_full_usage \
-       "See 'dos2unix --help' for help!"
+       "Converts FILE from unix format to dos format.  When no option\n" \
+       "is given, the input is converted to the opposite output format.\n" \
+       "When no file is given, uses stdin for input and stdout for output." \
+       "Options:\n" \
+       "\t-u\toutput will be in UNIX format\n" \
+       "\t-d\toutput will be in DOS format\n\n" \
 
 #define update_trivial_usage \
        "[options]"
 #define uuencode_full_usage \
        "Uuencode a file.\n\n" \
        "Options:\n" \
-       "\t-m\tuse base64 encoding as of RFC1521"
+       "\t-m\tuse base64 encoding per RFC1521"
 #define uuencode_example_usage \
        "$ uuencode busybox busybox\n" \
        "begin 755 busybox\n" \
        "$ uudecode busybox busybox > busybox.uu\n" \
        "$\n"
 
+#define vi_trivial_usage \
+       "[OPTION] [FILE]..."
+#define vi_full_usage \
+       "edit FILE.\n\n" \
+       "Options:\n" \
+       "\t-R\tRead-only- do not write to the file." 
+
 #define watchdog_trivial_usage \
        "DEV"
 #define watchdog_full_usage \
        "     31      46    1365 /etc/passwd\n" 
 
 #define wget_trivial_usage \
-       "[-c] [-O file] url"
+       "[-c|--continue] [-q|--quiet] [-O|--output-document file] [--header 'header: value'] url"
 #define wget_full_usage \
-       "wget retrieves files via HTTP\n\n" \
+       "wget retrieves files via HTTP or FTP\n\n" \
        "Options:\n" \
        "\t-c\tcontinue retrieval of aborted transfers\n" \
+       "\t-q\tquiet mode - do not print\n" \
        "\t-O\tsave to filename ('-' for stdout)"
 
 #define which_trivial_usage \