diff options
Diffstat (limited to 'include/usage.h')
-rw-r--r-- | include/usage.h | 97 |
1 files changed, 72 insertions, 25 deletions
diff --git a/include/usage.h b/include/usage.h index 8fc12f151..bbc0babfc 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -98,9 +98,11 @@ | |||
98 | "\t-y\tDisplay the entire year." | 98 | "\t-y\tDisplay the entire year." |
99 | 99 | ||
100 | #define cat_trivial_usage \ | 100 | #define cat_trivial_usage \ |
101 | "[FILE]..." | 101 | "[-u] [FILE]..." |
102 | #define cat_full_usage \ | 102 | #define cat_full_usage \ |
103 | "Concatenates FILE(s) and prints them to stdout." | 103 | "Concatenates FILE(s) and prints them to stdout.\n\n" \ |
104 | "Options:\n" \ | ||
105 | "\t-u\tignored since unbuffered i/o is always used" | ||
104 | #define cat_example_usage \ | 106 | #define cat_example_usage \ |
105 | "$ cat /proc/uptime\n" \ | 107 | "$ cat /proc/uptime\n" \ |
106 | "110716.72 17.67" | 108 | "110716.72 17.67" |
@@ -397,20 +399,34 @@ | |||
397 | #define dpkg_deb_example_usage \ | 399 | #define dpkg_deb_example_usage \ |
398 | "$ dpkg-deb -X ./busybox_0.48-1_i386.deb /tmp\n" | 400 | "$ dpkg-deb -X ./busybox_0.48-1_i386.deb /tmp\n" |
399 | 401 | ||
402 | #ifdef CONFIG_FEATURE_DU_DEFALT_BLOCKSIZE_1K | ||
403 | #define USAGE_DU_DEFALT_BLOCKSIZE_1k(a) a | ||
404 | #define USAGE_NOT_DU_DEFALT_BLOCKSIZE_1k(a) | ||
405 | #else | ||
406 | #define USAGE_DU_DEFALT_BLOCKSIZE_1k(a) | ||
407 | #define USAGE_NOT_DU_DEFALT_BLOCKSIZE_1k(a) a | ||
408 | #endif | ||
409 | |||
400 | #define du_trivial_usage \ | 410 | #define du_trivial_usage \ |
401 | "[-lsx" USAGE_HUMAN_READABLE("hm") USAGE_NOT_HUMAN_READABLE("") "k] [FILE]..." | 411 | "[-aHLdclsx" USAGE_HUMAN_READABLE("hm") "k] [FILE]..." |
402 | #define du_full_usage \ | 412 | #define du_full_usage \ |
403 | "Summarizes disk space used for each FILE and/or directory.\n" \ | 413 | "Summarizes disk space used for each FILE and/or directory.\n" \ |
404 | "Disk space is printed in units of 1024 bytes.\n\n" \ | 414 | "Disk space is printed in units of " \ |
405 | "Options:\n" \ | 415 | USAGE_DU_DEFALT_BLOCKSIZE_1k("1024") USAGE_NOT_DU_DEFALT_BLOCKSIZE_1k("512") \ |
416 | " bytes.\n\n" \ | ||
417 | "Options:\n" \ | ||
418 | "\t-a\tshow sizes of files in addition to directories\n" \ | ||
419 | "\t-H\tfollow symbolic links that are FILE command line args\n" \ | ||
420 | "\t-L\tfollow all symbolic links encountered\n" \ | ||
421 | "\t-d N\tlimit output to directories (and files with -a) of depth < N\n" \ | ||
422 | "\t-c\toutput a grand total\n" \ | ||
406 | "\t-l\tcount sizes many times if hard linked\n" \ | 423 | "\t-l\tcount sizes many times if hard linked\n" \ |
407 | "\t-s\tdisplay only a total for each argument" \ | 424 | "\t-s\tdisplay only a total for each argument\n" \ |
408 | USAGE_HUMAN_READABLE( \ | ||
409 | "\n\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n" \ | ||
410 | "\t-m\tprint sizes in megabytes\n" \ | ||
411 | "\t-x\tskip directories on different filesystems\n" \ | 425 | "\t-x\tskip directories on different filesystems\n" \ |
412 | "\t-k\tprint sizes in kilobytes(default)") USAGE_NOT_HUMAN_READABLE( \ | 426 | USAGE_HUMAN_READABLE( \ |
413 | "\n\t-k\tprint sizes in kilobytes(compatibility)") | 427 | "\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n" \ |
428 | "\t-m\tprint sizes in megabytes\n" ) \ | ||
429 | "\t-k\tprint sizes in kilobytes" USAGE_DU_DEFALT_BLOCKSIZE_1k("(default)") | ||
414 | #define du_example_usage \ | 430 | #define du_example_usage \ |
415 | "$ du\n" \ | 431 | "$ du\n" \ |
416 | "16 ./CVS\n" \ | 432 | "16 ./CVS\n" \ |
@@ -451,25 +467,31 @@ | |||
451 | "8|125||l4|||0|0|0|955637629|998367|0\n" \ | 467 | "8|125||l4|||0|0|0|955637629|998367|0\n" \ |
452 | "6|245|tty1|1|LOGIN||0|0|0|955637630|998974|0\n" \ | 468 | "6|245|tty1|1|LOGIN||0|0|0|955637630|998974|0\n" \ |
453 | "6|246|tty2|2|LOGIN||0|0|0|955637630|999498|0\n" \ | 469 | "6|246|tty2|2|LOGIN||0|0|0|955637630|999498|0\n" \ |
454 | "7|336|pts/0|vt00andersen|andersen|:0.0|0|0|0|955637763|0|0\n" | 470 | "7|336|pts/0|vt00|andersen|:0.0|0|0|0|955637763|0|0\n" |
471 | |||
472 | #ifdef CONFIG_FEATURE_FANCY_ECHO | ||
473 | #define USAGE_FANCY_ECHO(a) a | ||
474 | #else | ||
475 | #define USAGE_FANCY_ECHO(a) | ||
476 | #endif | ||
455 | 477 | ||
456 | #define echo_trivial_usage \ | 478 | #define echo_trivial_usage \ |
457 | "[-neE] [ARG ...]" | 479 | USAGE_FANCY_ECHO("[-neE] ") "[ARG ...]" |
458 | #define echo_full_usage \ | 480 | #define echo_full_usage \ |
459 | "Prints the specified ARGs to stdout\n\n" \ | 481 | "Prints the specified ARGs to stdout\n\n" \ |
460 | "Options:\n" \ | 482 | USAGE_FANCY_ECHO("Options:\n" \ |
461 | "\t-n\tsuppress trailing newline\n" \ | 483 | "\t-n\tsuppress trailing newline\n" \ |
462 | "\t-e\tinterpret backslash-escaped characters (i.e., \\t=tab)\n" \ | 484 | "\t-e\tinterpret backslash-escaped characters (i.e., \\t=tab)\n" \ |
463 | "\t-E\tdisable interpretation of backslash-escaped characters" | 485 | "\t-E\tdisable interpretation of backslash-escaped characters") |
464 | #define echo_example_usage \ | 486 | #define echo_example_usage \ |
465 | "$ echo "Erik is cool"\n" \ | 487 | "$ echo "Erik is cool"\n" \ |
466 | "Erik is cool\n" \ | 488 | "Erik is cool\n" \ |
467 | "$ echo -e "Erik\\nis\\ncool"\n" \ | 489 | USAGE_FANCY_ECHO("$ echo -e "Erik\\nis\\ncool"\n" \ |
468 | "Erik\n" \ | 490 | "Erik\n" \ |
469 | "is\n" \ | 491 | "is\n" \ |
470 | "cool\n" \ | 492 | "cool\n" \ |
471 | "$ echo "Erik\\nis\\ncool"\n" \ | 493 | "$ echo "Erik\\nis\\ncool"\n" \ |
472 | "Erik\\nis\\ncool\n" | 494 | "Erik\\nis\\ncool\n") |
473 | 495 | ||
474 | #define env_trivial_usage \ | 496 | #define env_trivial_usage \ |
475 | "[-iu] [-] [name=value]... [command]" | 497 | "[-iu] [-] [name=value]... [command]" |
@@ -757,6 +779,12 @@ | |||
757 | #define halt_full_usage \ | 779 | #define halt_full_usage \ |
758 | "Halt the system." | 780 | "Halt the system." |
759 | 781 | ||
782 | #ifdef CONFIG_FEATURE_FANCY_HEAD | ||
783 | #define USAGE_FANCY_HEAD(a) a | ||
784 | #else | ||
785 | #define USAGE_FANCY_HEAD(a) | ||
786 | #endif | ||
787 | |||
760 | #define head_trivial_usage \ | 788 | #define head_trivial_usage \ |
761 | "[OPTION] [FILE]..." | 789 | "[OPTION] [FILE]..." |
762 | #define head_full_usage \ | 790 | #define head_full_usage \ |
@@ -764,7 +792,11 @@ | |||
764 | "With more than one FILE, precede each with a header giving the\n" \ | 792 | "With more than one FILE, precede each with a header giving the\n" \ |
765 | "file name. With no FILE, or when FILE is -, read standard input.\n\n" \ | 793 | "file name. With no FILE, or when FILE is -, read standard input.\n\n" \ |
766 | "Options:\n" \ | 794 | "Options:\n" \ |
767 | "\t-n NUM\t\tPrint first NUM lines instead of first 10" | 795 | "\t-n NUM\t\tPrint first NUM lines instead of first 10" \ |
796 | USAGE_FANCY_HEAD( \ | ||
797 | "\n\t-c NUM\t\toutput the first NUM bytes\n" \ | ||
798 | "\t-q\t\tnever output headers giving file names\n" \ | ||
799 | "\t-v\t\talways output headers giving file names" ) | ||
768 | #define head_example_usage \ | 800 | #define head_example_usage \ |
769 | "$ head -n 2 /etc/passwd\n" \ | 801 | "$ head -n 2 /etc/passwd\n" \ |
770 | "root:x:0:0:root:/root:/bin/bash\n" \ | 802 | "root:x:0:0:root:/root:/bin/bash\n" \ |
@@ -1762,7 +1794,7 @@ | |||
1762 | "Remove (unlink) the FILE(s). You may use '--' to\n" \ | 1794 | "Remove (unlink) the FILE(s). You may use '--' to\n" \ |
1763 | "indicate that all following arguments are non-options.\n\n" \ | 1795 | "indicate that all following arguments are non-options.\n\n" \ |
1764 | "Options:\n" \ | 1796 | "Options:\n" \ |
1765 | "\t-i\t\talways prompt before removing each destination" \ | 1797 | "\t-i\t\talways prompt before removing each destination\n" \ |
1766 | "\t-f\t\tremove existing destinations, never prompt\n" \ | 1798 | "\t-f\t\tremove existing destinations, never prompt\n" \ |
1767 | "\t-r or -R\tremove the contents of directories recursively" | 1799 | "\t-r or -R\tremove the contents of directories recursively" |
1768 | #define rm_example_usage \ | 1800 | #define rm_example_usage \ |
@@ -1864,14 +1896,26 @@ | |||
1864 | #define sha1sum_full_usage \ | 1896 | #define sha1sum_full_usage \ |
1865 | "[OPTION] [FILE]" | 1897 | "[OPTION] [FILE]" |
1866 | 1898 | ||
1899 | #ifdef CONFIG_FEATURE_FANCY_SLEEP | ||
1900 | #define USAGE_FANCY_SLEEP(a) a | ||
1901 | #define USAGE_NOT_FANCY_SLEEP(a) | ||
1902 | #else | ||
1903 | #define USAGE_FANCY_SLEEP(a) | ||
1904 | #define USAGE_NOT_FANCY_SLEEP(a) a | ||
1905 | #endif | ||
1906 | |||
1867 | #define sleep_trivial_usage \ | 1907 | #define sleep_trivial_usage \ |
1868 | "N" | 1908 | USAGE_FANCY_SLEEP("[") "N" USAGE_FANCY_SLEEP("]...") |
1869 | #define sleep_full_usage \ | 1909 | #define sleep_full_usage \ |
1870 | "Pause for N seconds." | 1910 | USAGE_NOT_FANCY_SLEEP("Pause for N seconds.") \ |
1911 | USAGE_FANCY_SLEEP( \ | ||
1912 | "Pause for a time equal to the total of the args given, where each arg can\n" \ | ||
1913 | "have an optional suffix of (s)econds, (m)inutes, (h)ours, or (d)ays.") | ||
1871 | #define sleep_example_usage \ | 1914 | #define sleep_example_usage \ |
1872 | "$ sleep 2\n" \ | 1915 | "$ sleep 2\n" \ |
1873 | "[2 second delay results]\n" | 1916 | "[2 second delay results]\n" \ |
1874 | 1917 | USAGE_FANCY_SLEEP("$ sleep 1d 3h 22m 8s\n" \ | |
1918 | "[98528 second delay results]\n") | ||
1875 | 1919 | ||
1876 | #ifdef CONFIG_FEATURE_SORT_UNIQUE | 1920 | #ifdef CONFIG_FEATURE_SORT_UNIQUE |
1877 | #define USAGE_SORT_UNIQUE(a) a | 1921 | #define USAGE_SORT_UNIQUE(a) a |
@@ -2077,7 +2121,8 @@ | |||
2077 | #define tee_full_usage \ | 2121 | #define tee_full_usage \ |
2078 | "Copy standard input to each FILE, and also to standard output.\n\n" \ | 2122 | "Copy standard input to each FILE, and also to standard output.\n\n" \ |
2079 | "Options:\n" \ | 2123 | "Options:\n" \ |
2080 | "\t-a\tappend to the given FILEs, do not overwrite" | 2124 | "\t-a\tappend to the given FILEs, do not overwrite\n" \ |
2125 | "\t-i\tignore interrupt signals (SIGINT)" | ||
2081 | #define tee_example_usage \ | 2126 | #define tee_example_usage \ |
2082 | "$ echo "Hello" | tee /tmp/foo\n" \ | 2127 | "$ echo "Hello" | tee /tmp/foo\n" \ |
2083 | "$ cat /tmp/foo\n" \ | 2128 | "$ cat /tmp/foo\n" \ |
@@ -2312,7 +2357,9 @@ | |||
2312 | "Options:\n" \ | 2357 | "Options:\n" \ |
2313 | "\t-c\tprefix lines by the number of occurrences\n" \ | 2358 | "\t-c\tprefix lines by the number of occurrences\n" \ |
2314 | "\t-d\tonly print duplicate lines\n" \ | 2359 | "\t-d\tonly print duplicate lines\n" \ |
2315 | "\t-u\tonly print unique lines" | 2360 | "\t-u\tonly print unique lines\n" \ |
2361 | "\t-f N\tskip the first N fields\n" \ | ||
2362 | "\t-s N\tskip the first N chars (after any skipped fields)" | ||
2316 | #define uniq_example_usage \ | 2363 | #define uniq_example_usage \ |
2317 | "$ echo -e \"a\\na\\nb\\nc\\nc\\na\" | sort | uniq\n" \ | 2364 | "$ echo -e \"a\\na\\nb\\nc\\nc\\na\" | sort | uniq\n" \ |
2318 | "a\n" \ | 2365 | "a\n" \ |