More updates to the docs, and fixes to sync things with the docs.
authorErik Andersen <andersen@codepoet.org>
Mon, 17 Apr 2000 16:16:10 +0000 (16:16 -0000)
committerErik Andersen <andersen@codepoet.org>
Mon, 17 Apr 2000 16:16:10 +0000 (16:16 -0000)
 -Erik

17 files changed:
Changelog
coreutils/tty.c
coreutils/uniq.c
coreutils/wc.c
coreutils/whoami.c
coreutils/yes.c
docs/busybox.pod
lash.c
miscutils/update.c
sh.c
shell/lash.c
tty.c
uniq.c
update.c
wc.c
whoami.c
yes.c

index 9496d5fbbc014a63451374f0cd2bde0a5dc29ed8..e26a85039a913da11557df0e68a03910c2365710 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,5 @@
 0.43
+       * Major update to the provided documentation.
        * Busybox now includes a shell!  It currently costs 7.5 k (plus an
            additional 2.5 k if you compile in command line editing).  Handles
            job control, has the usual set of builtins, and does everything
index 8ac1c1fcd1d28501c08612aeb5dbf86bae3451e3..6f98d1b797404ce25829c19d7567a42471d85509 100644 (file)
@@ -25,8 +25,8 @@
 #include <sys/types.h>
 
 static const char tty_usage[] = "tty\n\n"
-       "Print the file name of the terminal connected to standard input.\n"
-
+       "Print the file name of the terminal connected to standard input.\n\n"
+       "Options:\n"
        "\t-s\tprint nothing, only return an exit status\n";
 
 extern int tty_main(int argc, char **argv)
index 2eedb886de5e47207979de244b4e686e40bd7924..0324856fd97ac360404a5b00591480a816ae7451 100644 (file)
 #include <errno.h>
 
 static const char uniq_usage[] =
-       "uniq [OPTION]... [INPUT [OUTPUT]]\n"
-       "Discard all but one of successive identical lines from INPUT (or\n"
-       "standard input), writing to OUTPUT (or standard output).\n"
-       "\n"
-       "\t-h\tdisplay this help and exit\n"
-
-       "\n"
-       "A field is a run of whitespace, then non-whitespace characters.\n"
-       "Fields are skipped before chars.\n";
+       "uniq [OPTION]... [INPUT [OUTPUT]]\n\n"
+       "Discard all but one of successive identical lines from INPUT\n"
+       "(or standard input), writing to OUTPUT (or standard output).\n";
 
 /* max chars in line */
 #define UNIQ_MAX 4096
@@ -190,4 +184,4 @@ int uniq_main(int argc, char **argv)
        exit(0);
 }
 
-/* $Id: uniq.c,v 1.8 2000/04/13 01:18:56 erik Exp $ */
+/* $Id: uniq.c,v 1.9 2000/04/17 16:16:10 erik Exp $ */
index 8004e629445e6ecf16c36961797b464a7a1a150a..030afa9d60c92b8ab537ba71efd8770ba6061886 100644 (file)
@@ -25,7 +25,8 @@
 
 static const char wc_usage[] = "wc [OPTION]... [FILE]...\n\n"
        "Print line, word, and byte counts for each FILE, and a total line if\n"
-       "more than one FILE is specified.  With no FILE, read standard input.\n"
+       "more than one FILE is specified.  With no FILE, read standard input.\n\n"
+       "Options:\n"
        "\t-c\tprint the byte counts\n"
        "\t-l\tprint the newline counts\n"
 
index 3677c2fbcb0aed8e97da8c52fcbf83508e995713..5c3fea13f673923311261599d725906772600b5a 100644 (file)
@@ -25,9 +25,7 @@
 #include <pwd.h>
 
 static const char whoami_usage[] = "whoami\n\n"
-       "Print the user name associated with the current effective user id.\n"
-
-       "Same as id -un.\n";
+       "Prints the user name associated with the current effective user id.\n";
 
 extern int whoami_main(int argc, char **argv)
 {
index ac67845ac7dadce196de3a37c9ac6fc840e2649d..a822ebc1d4e019b4be1347e15e575521758b4106 100644 (file)
@@ -27,12 +27,18 @@ extern int yes_main(int argc, char **argv)
 {
        int i;
 
-       if (argc == 1)
+       if (argc >=1 && *argv[1]=='-') {
+               usage("yes [OPTION]... [STRING]...\n\n"
+                               "Repeatedly outputs a line with all specified STRING(s), or `y'.\n");
+       }
+
+       if (argc == 1) {
                while (1)
                        if (puts("y") == EOF) {
                                perror("yes");
                                exit(FALSE);
                        }
+       }
 
        while (1)
                for (i = 1; i < argc; i++)
index e1d2f4804c90f0a45c2e07e86d0c52e432183f9a..9926cffd28c58e4fe3ff9de5af366aeaf70f41b4 100644 (file)
@@ -1290,6 +1290,10 @@ Example:
 
 =item sh
 
+Usage: sh
+
+lash -- the BusyBox LAme SHell (command interpreter)
+
 FIXME
 
 -------------------------------
@@ -1528,12 +1532,10 @@ Example:
 
 =item tr
 
-Usage:  
-
-  tr [-csu] string1 string2
-  tr [-cu] -d string1
-  tr [-cu] -s string1
-  tr [-cu] -ds string1 string2
+Usage:  tr [-csu] string1 string2
+        tr [-cu] -d string1
+        tr [-cu] -s string1
+        tr [-cu] -ds string1 string2
 
 Translate, squeeze, and/or delete characters from standard
 input, writing to standard output.
@@ -1559,67 +1561,162 @@ Example:
 
 =item tty
 
-FIXME
+Usage: tty
+
+Print the file name of the terminal connected to standard input.
+
+Options:
+
+        -s      print nothing, only return an exit status
+
+Example:
+
+       $ tty
+       /dev/tty2
 
 -------------------------------
 
 =item umount
 
-FIXME
+Usage: umount [flags] filesystem|directory
+
+Flags:
+
+        -a:     Unmount all file systems
+        -r:     Try to remount devices as read-only if mount is busy
+        -f:     Do not free loop device (if a loop device has been used)
+
+Example:
+
+       $ umount /dev/hdc1 
 
 -------------------------------
 
 =item uname
 
-FIXME
+Usage: uname [OPTION]...
+
+Print certain system information.  With no OPTION, same as -s.
+
+Options:
+
+        -a      print all information
+        -m      the machine (hardware) type
+        -n      print the machine's network node hostname
+        -r      print the operating system release
+        -s      print the operating system name
+        -p      print the host processor type
+        -v      print the operating system version
+
+Example:
+
+       $ uname -a
+       Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown
 
 -------------------------------
 
 =item uniq
 
-FIXME
+Usage: uniq [OPTION]... [INPUT [OUTPUT]]
+
+Discard all but one of successive identical lines from INPUT
+(or standard input), writing to OUTPUT (or standard output).
+
+Example:
+
+       $ echo -e "a\na\nb\nc\nc\na" | sort | uniq
+       a
+       b
+       c
 
 -------------------------------
 
 =item update
 
-FIXME
+Usage: update [options]
+
+Periodically flushes filesystem buffers.
+
+Options:
+
+        -S      force use of sync(2) instead of flushing
+        -s SECS call sync this often (default 30)
+        -f SECS flush some buffers this often (default 5)
 
 -------------------------------
 
 =item uptime
 
-FIXME
+Usage: uptime
+
+Tells how long the system has been running since boot.
+
+Example:
+
+       $ uptime
+         1:55pm  up  2:30, load average: 0.09, 0.04, 0.00
 
 -------------------------------
 
 =item usleep
 
-FIXME
+Usage: usleep N
+
+Pauses for N microseconds.
+
+Example:
+
+       $ usleep 1000000
+       [pauses for 1 second]
 
 -------------------------------
 
 =item wc
 
-FIXME
+Usage: wc [OPTION]... [FILE]...
+
+Print line, word, and byte counts for each FILE, and a total line if
+more than one FILE is specified.  With no FILE, read standard input.
+
+Options:
+
+        -c      print the byte counts
+        -l      print the newline counts
+        -L      print the length of the longest line
+        -w      print the word counts
+
+Example:
+
+       $ wc /etc/passwd
+            31      46    1365 /etc/passwd
 
 -------------------------------
 
 =item whoami
 
-FIXME
+Usage: whoami
+
+Prints the user name associated with the current effective user id.
+
+Example:
+
+       $ whoami
+       andersen
 
 -------------------------------
 
 =item yes
 
-FIXME
+Usage: yes [OPTION]... [STRING]...
+
+Repeatedly outputs a line with all specified STRING(s), or `y'.
 
 -------------------------------
 
 =item zcat
 
-FIXME
+This is essentially an alias for invoking "gunzip -c", where 
+it decompresses the file inquestion and send the output to stdout. 
 
 -------------------------------
 
@@ -1684,4 +1781,4 @@ Enrique Zanardi <ezanardi@ull.es>
 
 =cut
 
-# $Id: busybox.pod,v 1.12 2000/04/17 05:13:59 beppu Exp $
+# $Id: busybox.pod,v 1.13 2000/04/17 16:16:10 erik Exp $
diff --git a/lash.c b/lash.c
index 44ffe968f2c6a4096da7abd101c6b296a3fde313..bd95ba761fabb1b23f5005c6228962874ce71a5f 100644 (file)
--- a/lash.c
+++ b/lash.c
@@ -961,9 +961,12 @@ int shell_main(int argc, char **argv)
                fprintf(stdout, "\n\nBusyBox v%s (%s) Built-in shell\n", BB_VER, BB_BT);
                fprintf(stdout, "Enter 'help' for a list of built-in commands.\n\n");
        } else {
+               if (*argv[1]=='-') {
+                       usage("sh\n\nlash -- the BusyBox LAme SHell (command interpreter)\n");
+               }
                input = fopen(argv[1], "r");
                if (!input) {
-                       fatalError("A: Couldn't open file '%s': %s\n", argv[1],
+                       fatalError("sh: Couldn't open file '%s': %s\n", argv[1],
                                           strerror(errno));
                }
        }
index bb77c5f1f060d1b00d8d9d0cc4b25ce5a152d8f3..1e3e032fde066414533a97779a0b191c53565dc4 100644 (file)
@@ -35,10 +35,12 @@ _syscall2(int, bdflush, int, func, int, data);
 #endif                                                 /* __GLIBC__ */
 
 static char update_usage[] =
-       "update [options]\n"
-       "  -S\tforce use of sync(2) instead of flushing\n"
-       "  -s SECS\tcall sync this often (default 30)\n"
-       "  -f SECS\tflush some buffers this often (default 5)\n";
+       "update [options]\n\n"
+       "Periodically flushes filesystem buffers.\n\n"
+       "Options:\n"
+       "\t-S\tforce use of sync(2) instead of flushing\n"
+       "\t-s SECS\tcall sync this often (default 30)\n"
+       "\t-f SECS\tflush some buffers this often (default 5)\n";
 
 static unsigned int sync_duration = 30;
 static unsigned int flush_duration = 5;
@@ -48,6 +50,8 @@ extern int update_main(int argc, char **argv)
 {
        int pid;
 
+       argc--;
+       argv++;
        while (**argv == '-') {
                while (*++(*argv)) {
                        switch (**argv) {
@@ -62,6 +66,8 @@ extern int update_main(int argc, char **argv)
                                if (--argc < 1) usage(update_usage);
                                flush_duration = atoi(*(++argv));
                                break;
+                       default:
+                               usage(update_usage);
                        }
                }
                argc--;
@@ -100,7 +106,7 @@ extern int update_main(int argc, char **argv)
                        }
                }
        }
-       return TRUE;
+       exit( TRUE);
 }
 
 /*
diff --git a/sh.c b/sh.c
index 44ffe968f2c6a4096da7abd101c6b296a3fde313..bd95ba761fabb1b23f5005c6228962874ce71a5f 100644 (file)
--- a/sh.c
+++ b/sh.c
@@ -961,9 +961,12 @@ int shell_main(int argc, char **argv)
                fprintf(stdout, "\n\nBusyBox v%s (%s) Built-in shell\n", BB_VER, BB_BT);
                fprintf(stdout, "Enter 'help' for a list of built-in commands.\n\n");
        } else {
+               if (*argv[1]=='-') {
+                       usage("sh\n\nlash -- the BusyBox LAme SHell (command interpreter)\n");
+               }
                input = fopen(argv[1], "r");
                if (!input) {
-                       fatalError("A: Couldn't open file '%s': %s\n", argv[1],
+                       fatalError("sh: Couldn't open file '%s': %s\n", argv[1],
                                           strerror(errno));
                }
        }
index 44ffe968f2c6a4096da7abd101c6b296a3fde313..bd95ba761fabb1b23f5005c6228962874ce71a5f 100644 (file)
@@ -961,9 +961,12 @@ int shell_main(int argc, char **argv)
                fprintf(stdout, "\n\nBusyBox v%s (%s) Built-in shell\n", BB_VER, BB_BT);
                fprintf(stdout, "Enter 'help' for a list of built-in commands.\n\n");
        } else {
+               if (*argv[1]=='-') {
+                       usage("sh\n\nlash -- the BusyBox LAme SHell (command interpreter)\n");
+               }
                input = fopen(argv[1], "r");
                if (!input) {
-                       fatalError("A: Couldn't open file '%s': %s\n", argv[1],
+                       fatalError("sh: Couldn't open file '%s': %s\n", argv[1],
                                           strerror(errno));
                }
        }
diff --git a/tty.c b/tty.c
index 8ac1c1fcd1d28501c08612aeb5dbf86bae3451e3..6f98d1b797404ce25829c19d7567a42471d85509 100644 (file)
--- a/tty.c
+++ b/tty.c
@@ -25,8 +25,8 @@
 #include <sys/types.h>
 
 static const char tty_usage[] = "tty\n\n"
-       "Print the file name of the terminal connected to standard input.\n"
-
+       "Print the file name of the terminal connected to standard input.\n\n"
+       "Options:\n"
        "\t-s\tprint nothing, only return an exit status\n";
 
 extern int tty_main(int argc, char **argv)
diff --git a/uniq.c b/uniq.c
index 2eedb886de5e47207979de244b4e686e40bd7924..0324856fd97ac360404a5b00591480a816ae7451 100644 (file)
--- a/uniq.c
+++ b/uniq.c
 #include <errno.h>
 
 static const char uniq_usage[] =
-       "uniq [OPTION]... [INPUT [OUTPUT]]\n"
-       "Discard all but one of successive identical lines from INPUT (or\n"
-       "standard input), writing to OUTPUT (or standard output).\n"
-       "\n"
-       "\t-h\tdisplay this help and exit\n"
-
-       "\n"
-       "A field is a run of whitespace, then non-whitespace characters.\n"
-       "Fields are skipped before chars.\n";
+       "uniq [OPTION]... [INPUT [OUTPUT]]\n\n"
+       "Discard all but one of successive identical lines from INPUT\n"
+       "(or standard input), writing to OUTPUT (or standard output).\n";
 
 /* max chars in line */
 #define UNIQ_MAX 4096
@@ -190,4 +184,4 @@ int uniq_main(int argc, char **argv)
        exit(0);
 }
 
-/* $Id: uniq.c,v 1.8 2000/04/13 01:18:56 erik Exp $ */
+/* $Id: uniq.c,v 1.9 2000/04/17 16:16:10 erik Exp $ */
index bb77c5f1f060d1b00d8d9d0cc4b25ce5a152d8f3..1e3e032fde066414533a97779a0b191c53565dc4 100644 (file)
--- a/update.c
+++ b/update.c
@@ -35,10 +35,12 @@ _syscall2(int, bdflush, int, func, int, data);
 #endif                                                 /* __GLIBC__ */
 
 static char update_usage[] =
-       "update [options]\n"
-       "  -S\tforce use of sync(2) instead of flushing\n"
-       "  -s SECS\tcall sync this often (default 30)\n"
-       "  -f SECS\tflush some buffers this often (default 5)\n";
+       "update [options]\n\n"
+       "Periodically flushes filesystem buffers.\n\n"
+       "Options:\n"
+       "\t-S\tforce use of sync(2) instead of flushing\n"
+       "\t-s SECS\tcall sync this often (default 30)\n"
+       "\t-f SECS\tflush some buffers this often (default 5)\n";
 
 static unsigned int sync_duration = 30;
 static unsigned int flush_duration = 5;
@@ -48,6 +50,8 @@ extern int update_main(int argc, char **argv)
 {
        int pid;
 
+       argc--;
+       argv++;
        while (**argv == '-') {
                while (*++(*argv)) {
                        switch (**argv) {
@@ -62,6 +66,8 @@ extern int update_main(int argc, char **argv)
                                if (--argc < 1) usage(update_usage);
                                flush_duration = atoi(*(++argv));
                                break;
+                       default:
+                               usage(update_usage);
                        }
                }
                argc--;
@@ -100,7 +106,7 @@ extern int update_main(int argc, char **argv)
                        }
                }
        }
-       return TRUE;
+       exit( TRUE);
 }
 
 /*
diff --git a/wc.c b/wc.c
index 8004e629445e6ecf16c36961797b464a7a1a150a..030afa9d60c92b8ab537ba71efd8770ba6061886 100644 (file)
--- a/wc.c
+++ b/wc.c
@@ -25,7 +25,8 @@
 
 static const char wc_usage[] = "wc [OPTION]... [FILE]...\n\n"
        "Print line, word, and byte counts for each FILE, and a total line if\n"
-       "more than one FILE is specified.  With no FILE, read standard input.\n"
+       "more than one FILE is specified.  With no FILE, read standard input.\n\n"
+       "Options:\n"
        "\t-c\tprint the byte counts\n"
        "\t-l\tprint the newline counts\n"
 
index 3677c2fbcb0aed8e97da8c52fcbf83508e995713..5c3fea13f673923311261599d725906772600b5a 100644 (file)
--- a/whoami.c
+++ b/whoami.c
@@ -25,9 +25,7 @@
 #include <pwd.h>
 
 static const char whoami_usage[] = "whoami\n\n"
-       "Print the user name associated with the current effective user id.\n"
-
-       "Same as id -un.\n";
+       "Prints the user name associated with the current effective user id.\n";
 
 extern int whoami_main(int argc, char **argv)
 {
diff --git a/yes.c b/yes.c
index ac67845ac7dadce196de3a37c9ac6fc840e2649d..a822ebc1d4e019b4be1347e15e575521758b4106 100644 (file)
--- a/yes.c
+++ b/yes.c
@@ -27,12 +27,18 @@ extern int yes_main(int argc, char **argv)
 {
        int i;
 
-       if (argc == 1)
+       if (argc >=1 && *argv[1]=='-') {
+               usage("yes [OPTION]... [STRING]...\n\n"
+                               "Repeatedly outputs a line with all specified STRING(s), or `y'.\n");
+       }
+
+       if (argc == 1) {
                while (1)
                        if (puts("y") == EOF) {
                                perror("yes");
                                exit(FALSE);
                        }
+       }
 
        while (1)
                for (i = 1; i < argc; i++)