summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-02-14 21:23:06 +0000
committerEric Andersen <andersen@codepoet.org>2001-02-14 21:23:06 +0000
commit67991cf824f8df27e74c92d754fb507681c69ce6 (patch)
treea0b652f3dc794d1050c1a8de3afb014a621238fa
parent68be2ab914e1e20fe666bbd22a89a18714be2789 (diff)
downloadbusybox-w32-67991cf824f8df27e74c92d754fb507681c69ce6.tar.gz
busybox-w32-67991cf824f8df27e74c92d754fb507681c69ce6.tar.bz2
busybox-w32-67991cf824f8df27e74c92d754fb507681c69ce6.zip
This patch, put together by Manuel Novoa III, is a merge of work
done by Evin Robertson (bug#1105) and work from Manuel to make usage messages occupy less space and simplify how usage messages are displayed.
-rw-r--r--applets.h286
-rw-r--r--applets/busybox.c9
-rw-r--r--applets/usage.c1637
-rw-r--r--ar.c4
-rw-r--r--archival/ar.c4
-rw-r--r--archival/dpkg.c4
-rw-r--r--archival/dpkg_deb.c6
-rw-r--r--archival/gunzip.c4
-rw-r--r--archival/gzip.c4
-rw-r--r--archival/tar.c4
-rw-r--r--basename.c2
-rw-r--r--busybox.c9
-rw-r--r--busybox.h11
-rw-r--r--chmod_chown_chgrp.c6
-rw-r--r--chroot.c2
-rw-r--r--chvt.c2
-rw-r--r--cmp.c2
-rw-r--r--console-tools/chvt.c2
-rw-r--r--console-tools/deallocvt.c2
-rw-r--r--console-tools/dumpkmap.c2
-rw-r--r--console-tools/loadacm.c2
-rw-r--r--console-tools/loadfont.c2
-rw-r--r--console-tools/loadkmap.c2
-rw-r--r--console-tools/setkeycodes.c2
-rw-r--r--coreutils/basename.c2
-rw-r--r--coreutils/chroot.c2
-rw-r--r--coreutils/cmp.c2
-rw-r--r--coreutils/date.c8
-rw-r--r--coreutils/dd.c2
-rw-r--r--coreutils/df.c2
-rw-r--r--coreutils/dirname.c2
-rw-r--r--coreutils/dos2unix.c2
-rw-r--r--coreutils/du.c4
-rw-r--r--coreutils/head.c2
-rw-r--r--coreutils/id.c4
-rw-r--r--coreutils/length.c2
-rw-r--r--coreutils/ln.c2
-rw-r--r--coreutils/logname.c2
-rw-r--r--coreutils/ls.c2
-rw-r--r--coreutils/md5sum.c2
-rw-r--r--coreutils/mkdir.c6
-rw-r--r--coreutils/mkfifo.c6
-rw-r--r--coreutils/mknod.c8
-rw-r--r--coreutils/printf.c2
-rw-r--r--coreutils/rm.c4
-rw-r--r--coreutils/rmdir.c2
-rw-r--r--coreutils/sleep.c2
-rw-r--r--coreutils/sort.c2
-rw-r--r--coreutils/sync.c2
-rw-r--r--coreutils/tail.c2
-rw-r--r--coreutils/tee.c2
-rw-r--r--coreutils/touch.c4
-rw-r--r--coreutils/tr.c2
-rw-r--r--coreutils/tty.c2
-rw-r--r--coreutils/uname.c2
-rw-r--r--coreutils/usleep.c2
-rw-r--r--coreutils/uudecode.c2
-rw-r--r--coreutils/uuencode.c4
-rw-r--r--coreutils/wc.c2
-rw-r--r--coreutils/whoami.c2
-rw-r--r--coreutils/yes.c2
-rw-r--r--cp_mv.c11
-rw-r--r--date.c8
-rw-r--r--dc.c2
-rw-r--r--dd.c2
-rw-r--r--deallocvt.c2
-rw-r--r--df.c2
-rw-r--r--dirname.c2
-rw-r--r--dmesg.c11
-rw-r--r--dos2unix.c2
-rw-r--r--dpkg.c4
-rw-r--r--dpkg_deb.c6
-rw-r--r--du.c4
-rw-r--r--dumpkmap.c2
-rw-r--r--dutmp.c4
-rw-r--r--editors/sed.c4
-rw-r--r--fdflush.c2
-rw-r--r--find.c2
-rw-r--r--findutils/find.c2
-rw-r--r--findutils/grep.c2
-rw-r--r--findutils/which.c2
-rw-r--r--free.c2
-rw-r--r--freeramdisk.c2
-rw-r--r--fsck_minix.c5
-rw-r--r--getopt.c2
-rw-r--r--grep.c2
-rw-r--r--gunzip.c4
-rw-r--r--gzip.c4
-rw-r--r--head.c2
-rw-r--r--hostname.c10
-rw-r--r--id.c4
-rw-r--r--ifconfig.c20
-rw-r--r--include/applets.h286
-rw-r--r--include/busybox.h11
-rw-r--r--init.c4
-rw-r--r--init/init.c4
-rw-r--r--insmod.c8
-rw-r--r--kill.c7
-rw-r--r--lash.c17
-rw-r--r--length.c2
-rw-r--r--ln.c2
-rw-r--r--loadacm.c2
-rw-r--r--loadfont.c2
-rw-r--r--loadkmap.c2
-rw-r--r--logger.c2
-rw-r--r--logname.c2
-rw-r--r--ls.c2
-rw-r--r--makedevs.c4
-rw-r--r--md5sum.c2
-rw-r--r--miscutils/dc.c2
-rw-r--r--miscutils/dutmp.c4
-rw-r--r--miscutils/makedevs.c4
-rw-r--r--miscutils/mktemp.c2
-rw-r--r--miscutils/mt.c4
-rw-r--r--miscutils/readlink.c2
-rw-r--r--miscutils/update.c2
-rw-r--r--miscutils/watchdog.c2
-rw-r--r--mkdir.c6
-rw-r--r--mkfifo.c6
-rw-r--r--mkfs_minix.c7
-rw-r--r--mknod.c8
-rw-r--r--mkswap.c10
-rw-r--r--mktemp.c2
-rw-r--r--modutils/insmod.c8
-rw-r--r--modutils/rmmod.c4
-rw-r--r--mount.c2
-rw-r--r--mt.c4
-rw-r--r--nc.c4
-rw-r--r--networking/hostname.c10
-rw-r--r--networking/ifconfig.c20
-rw-r--r--networking/nc.c4
-rw-r--r--networking/nslookup.c4
-rw-r--r--networking/ping.c12
-rw-r--r--networking/route.c26
-rw-r--r--networking/telnet.c2
-rw-r--r--networking/wget.c6
-rw-r--r--nslookup.c4
-rw-r--r--ping.c12
-rw-r--r--pivot_root.c2
-rw-r--r--printf.c2
-rw-r--r--procps/free.c2
-rw-r--r--procps/kill.c7
-rw-r--r--procps/ps.c2
-rw-r--r--procps/renice.c2
-rw-r--r--ps.c2
-rw-r--r--rdate.c6
-rw-r--r--readlink.c2
-rw-r--r--renice.c2
-rw-r--r--rm.c4
-rw-r--r--rmdir.c2
-rw-r--r--rmmod.c4
-rw-r--r--route.c26
-rw-r--r--rpmunpack.c2
-rw-r--r--sed.c4
-rw-r--r--setkeycodes.c2
-rw-r--r--sh.c17
-rw-r--r--shell/lash.c17
-rw-r--r--sleep.c2
-rw-r--r--sort.c2
-rw-r--r--swaponoff.c2
-rw-r--r--sync.c2
-rw-r--r--sysklogd/logger.c2
-rw-r--r--sysklogd/syslogd.c2
-rw-r--r--syslogd.c2
-rw-r--r--tail.c2
-rw-r--r--tar.c4
-rw-r--r--tee.c2
-rw-r--r--telnet.c2
-rw-r--r--touch.c4
-rw-r--r--tr.c2
-rw-r--r--tty.c2
-rw-r--r--umount.c4
-rw-r--r--uname.c2
-rw-r--r--unix2dos.c2
-rw-r--r--update.c2
-rw-r--r--usage.c1637
-rw-r--r--usleep.c2
-rw-r--r--util-linux/dmesg.c11
-rw-r--r--util-linux/fdflush.c2
-rw-r--r--util-linux/freeramdisk.c2
-rw-r--r--util-linux/fsck_minix.c5
-rw-r--r--util-linux/getopt.c2
-rw-r--r--util-linux/mkfs_minix.c7
-rw-r--r--util-linux/mkswap.c10
-rw-r--r--util-linux/mount.c2
-rw-r--r--util-linux/pivot_root.c2
-rw-r--r--util-linux/rdate.c6
-rw-r--r--util-linux/swaponoff.c2
-rw-r--r--util-linux/umount.c4
-rw-r--r--utility.c27
-rw-r--r--uudecode.c2
-rw-r--r--uuencode.c4
-rw-r--r--watchdog.c2
-rw-r--r--wc.c2
-rw-r--r--wget.c6
-rw-r--r--which.c2
-rw-r--r--whoami.c2
-rw-r--r--yes.c2
198 files changed, 702 insertions, 3979 deletions
diff --git a/applets.h b/applets.h
index 0b70a6120..cb744567a 100644
--- a/applets.h
+++ b/applets.h
@@ -10,403 +10,417 @@
10 * file result in the listing remaining in ascii order. You have been warned. 10 * file result in the listing remaining in ascii order. You have been warned.
11 */ 11 */
12 12
13#undef APPLET
14#undef APPLET_ODDNAME
15#undef APPLET_NOUSAGE
16
13#if defined(PROTOTYPES) 17#if defined(PROTOTYPES)
14#define APPLET(a,b,c,d) \ 18#define APPLET(a,b,c) \
15 extern int b(int argc, char **argv); \ 19 extern int b(int argc, char **argv);
16 extern const char d[]; 20#define APPLET_ODDNAME(a,b,c,d,e) APPLET(a,b,c)
17#define APPLET_NOUSAGE(a,b,c) \ 21#define APPLET_NOUSAGE(a,b,c) \
18 extern int b(int argc, char **argv); 22 extern int b(int argc, char **argv);
19#elif defined(MAKE_LINKS) 23#elif defined(MAKE_LINKS)
20#define APPLET(a,b,c,d) LINK c a 24#define APPLET(a,b,c) LINK c #a
21#define APPLET_NOUSAGE(a,b,c) LINK c a 25#define APPLET_ODDNAME(a,b,c,d,e) LINK c a
26#define APPLET_NOUSAGE(a,b,c) LINK c #a
27#elif defined(APPLET_ENUM)
28#define APPLET(a,b,c) a##_applet_number,
29#define APPLET_ODDNAME(a,b,c,d,e) e##_applet_number,
30#define APPLET_NOUSAGE(a,b,c) a##applet_number,
22#else 31#else
32#define USAGE_ENUM
33#include "usage.h"
23const struct BB_applet applets[] = { 34const struct BB_applet applets[] = {
24#define APPLET(a,b,c,d) {a,b,c,d}, 35#define APPLET(a,b,c) {#a,b,c,a##_usage_index},
25#define APPLET_NOUSAGE(a,b,c) {a,b,c,NULL}, 36#define APPLET_ODDNAME(a,b,c,d,e) {a,b,c,d},
37#define APPLET_NOUSAGE(a,b,c) {#a,b,c,-1},
38#define zcat_usage_index gunzip_usage_index
39#define sh_usage_index shell_usage_index
26#endif 40#endif
27 41
28#ifdef BB_TEST 42#ifdef BB_TEST
29 APPLET("[", test_main, _BB_DIR_USR_BIN, test_usage) 43 APPLET_ODDNAME("[", test_main, _BB_DIR_USR_BIN, test_usage_index, open_bracket)
30#endif 44#endif
31#ifdef BB_AR 45#ifdef BB_AR
32 APPLET("ar", ar_main, _BB_DIR_USR_BIN, ar_usage) 46 APPLET(ar, ar_main, _BB_DIR_USR_BIN)
33#endif 47#endif
34#ifdef BB_BASENAME 48#ifdef BB_BASENAME
35 APPLET("basename", basename_main, _BB_DIR_USR_BIN, basename_usage) 49 APPLET(basename, basename_main, _BB_DIR_USR_BIN)
36#endif 50#endif
37 APPLET_NOUSAGE("busybox", busybox_main, _BB_DIR_BIN) 51 APPLET_NOUSAGE(busybox, busybox_main, _BB_DIR_BIN)
38#ifdef BB_CAT 52#ifdef BB_CAT
39 APPLET("cat", cat_main, _BB_DIR_BIN, cat_usage) 53 APPLET(cat, cat_main, _BB_DIR_BIN)
40#endif 54#endif
41#ifdef BB_CHMOD_CHOWN_CHGRP 55#ifdef BB_CHMOD_CHOWN_CHGRP
42 APPLET("chgrp", chmod_chown_chgrp_main, _BB_DIR_BIN, chgrp_usage) 56 APPLET(chgrp, chmod_chown_chgrp_main, _BB_DIR_BIN)
43#endif 57#endif
44#ifdef BB_CHMOD_CHOWN_CHGRP 58#ifdef BB_CHMOD_CHOWN_CHGRP
45 APPLET("chmod", chmod_chown_chgrp_main, _BB_DIR_BIN, chmod_usage) 59 APPLET(chmod, chmod_chown_chgrp_main, _BB_DIR_BIN)
46#endif 60#endif
47#ifdef BB_CHMOD_CHOWN_CHGRP 61#ifdef BB_CHMOD_CHOWN_CHGRP
48 APPLET("chown", chmod_chown_chgrp_main, _BB_DIR_BIN, chown_usage) 62 APPLET(chown, chmod_chown_chgrp_main, _BB_DIR_BIN)
49#endif 63#endif
50#ifdef BB_CHROOT 64#ifdef BB_CHROOT
51 APPLET("chroot", chroot_main, _BB_DIR_USR_SBIN, chroot_usage) 65 APPLET(chroot, chroot_main, _BB_DIR_USR_SBIN)
52#endif 66#endif
53#ifdef BB_CHVT 67#ifdef BB_CHVT
54 APPLET("chvt", chvt_main, _BB_DIR_USR_BIN, chvt_usage) 68 APPLET(chvt, chvt_main, _BB_DIR_USR_BIN)
55#endif 69#endif
56#ifdef BB_CLEAR 70#ifdef BB_CLEAR
57 APPLET("clear", clear_main, _BB_DIR_USR_BIN, clear_usage) 71 APPLET(clear, clear_main, _BB_DIR_USR_BIN)
58#endif 72#endif
59#ifdef BB_CMP 73#ifdef BB_CMP
60 APPLET("cmp", cmp_main, _BB_DIR_USR_BIN, cmp_usage) 74 APPLET(cmp, cmp_main, _BB_DIR_USR_BIN)
61#endif 75#endif
62#ifdef BB_CP_MV 76#ifdef BB_CP_MV
63 APPLET("cp", cp_mv_main, _BB_DIR_BIN, cp_usage) 77 APPLET(cp, cp_mv_main, _BB_DIR_BIN)
64#endif 78#endif
65#ifdef BB_CUT 79#ifdef BB_CUT
66 APPLET("cut", cut_main, _BB_DIR_USR_BIN, cut_usage) 80 APPLET(cut, cut_main, _BB_DIR_USR_BIN)
67#endif 81#endif
68#ifdef BB_DATE 82#ifdef BB_DATE
69 APPLET("date", date_main, _BB_DIR_BIN, date_usage) 83 APPLET(date, date_main, _BB_DIR_BIN)
70#endif 84#endif
71#ifdef BB_DC 85#ifdef BB_DC
72 APPLET("dc", dc_main, _BB_DIR_USR_BIN, dc_usage) 86 APPLET(dc, dc_main, _BB_DIR_USR_BIN)
73#endif 87#endif
74#ifdef BB_DD 88#ifdef BB_DD
75 APPLET("dd", dd_main, _BB_DIR_BIN, dd_usage) 89 APPLET(dd, dd_main, _BB_DIR_BIN)
76#endif 90#endif
77#ifdef BB_DEALLOCVT 91#ifdef BB_DEALLOCVT
78 APPLET("deallocvt", deallocvt_main, _BB_DIR_USR_BIN, deallocvt_usage) 92 APPLET(deallocvt, deallocvt_main, _BB_DIR_USR_BIN)
79#endif 93#endif
80#ifdef BB_DF 94#ifdef BB_DF
81 APPLET("df", df_main, _BB_DIR_BIN, df_usage) 95 APPLET(df, df_main, _BB_DIR_BIN)
82#endif 96#endif
83#ifdef BB_DIRNAME 97#ifdef BB_DIRNAME
84 APPLET("dirname", dirname_main, _BB_DIR_USR_BIN, dirname_usage) 98 APPLET(dirname, dirname_main, _BB_DIR_USR_BIN)
85#endif 99#endif
86#ifdef BB_DMESG 100#ifdef BB_DMESG
87 APPLET("dmesg", dmesg_main, _BB_DIR_BIN, dmesg_usage) 101 APPLET(dmesg, dmesg_main, _BB_DIR_BIN)
88#endif 102#endif
89#ifdef BB_DOS2UNIX 103#ifdef BB_DOS2UNIX
90 APPLET("dos2unix", dos2unix_main, _BB_DIR_USR_BIN, dos2unix_usage) 104 APPLET(dos2unix, dos2unix_main, _BB_DIR_USR_BIN)
91#endif 105#endif
92#ifdef BB_DPKG 106#ifdef BB_DPKG
93 APPLET("dpkg", dpkg_main, _BB_DIR_USR_BIN, dpkg_usage) 107 APPLET(dpkg, dpkg_main, _BB_DIR_USR_BIN)
94#endif 108#endif
95#ifdef BB_DPKG_DEB 109#ifdef BB_DPKG_DEB
96 APPLET("dpkg-deb", dpkg_deb_main, _BB_DIR_USR_BIN, dpkg_deb_usage) 110 APPLET_ODDNAME("dpkg-deb", dpkg_deb_main, _BB_DIR_USR_BIN, dpkg_deb_usage_index, dpkg_deb)
97#endif 111#endif
98#ifdef BB_DU 112#ifdef BB_DU
99 APPLET("du", du_main, _BB_DIR_USR_BIN, du_usage) 113 APPLET(du, du_main, _BB_DIR_USR_BIN)
100#endif 114#endif
101#ifdef BB_DUMPKMAP 115#ifdef BB_DUMPKMAP
102 APPLET("dumpkmap", dumpkmap_main, _BB_DIR_BIN, dumpkmap_usage) 116 APPLET(dumpkmap, dumpkmap_main, _BB_DIR_BIN)
103#endif 117#endif
104#ifdef BB_DUTMP 118#ifdef BB_DUTMP
105 APPLET("dutmp", dutmp_main, _BB_DIR_USR_SBIN, dutmp_usage) 119 APPLET(dutmp, dutmp_main, _BB_DIR_USR_SBIN)
106#endif 120#endif
107#ifdef BB_ECHO 121#ifdef BB_ECHO
108 APPLET("echo", echo_main, _BB_DIR_BIN, echo_usage) 122 APPLET(echo, echo_main, _BB_DIR_BIN)
109#endif 123#endif
110#ifdef BB_EXPR 124#ifdef BB_EXPR
111 APPLET("expr", expr_main, _BB_DIR_USR_BIN, expr_usage) 125 APPLET(expr, expr_main, _BB_DIR_USR_BIN)
112#endif 126#endif
113#ifdef BB_TRUE_FALSE 127#ifdef BB_TRUE_FALSE
114 APPLET("false", false_main, _BB_DIR_BIN, false_usage) 128 APPLET(false, false_main, _BB_DIR_BIN)
115#endif 129#endif
116#ifdef BB_FBSET 130#ifdef BB_FBSET
117 APPLET_NOUSAGE("fbset", fbset_main, _BB_DIR_USR_SBIN) 131 APPLET_NOUSAGE(fbset, fbset_main, _BB_DIR_USR_SBIN)
118#endif 132#endif
119#ifdef BB_FDFLUSH 133#ifdef BB_FDFLUSH
120 APPLET("fdflush", fdflush_main, _BB_DIR_BIN, fdflush_usage) 134 APPLET(fdflush, fdflush_main, _BB_DIR_BIN)
121#endif 135#endif
122#ifdef BB_FIND 136#ifdef BB_FIND
123 APPLET("find", find_main, _BB_DIR_USR_BIN, find_usage) 137 APPLET(find, find_main, _BB_DIR_USR_BIN)
124#endif 138#endif
125#ifdef BB_FREE 139#ifdef BB_FREE
126 APPLET("free", free_main, _BB_DIR_USR_BIN, free_usage) 140 APPLET(free, free_main, _BB_DIR_USR_BIN)
127#endif 141#endif
128#ifdef BB_FREERAMDISK 142#ifdef BB_FREERAMDISK
129 APPLET("freeramdisk", freeramdisk_main, _BB_DIR_SBIN, freeramdisk_usage) 143 APPLET(freeramdisk, freeramdisk_main, _BB_DIR_SBIN)
130#endif 144#endif
131#ifdef BB_FSCK_MINIX 145#ifdef BB_FSCK_MINIX
132 APPLET("fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage) 146 APPLET_ODDNAME("fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage_index, fsck_minix)
133#endif 147#endif
134#ifdef BB_GETOPT 148#ifdef BB_GETOPT
135 APPLET("getopt", getopt_main, _BB_DIR_BIN, getopt_usage) 149 APPLET(getopt, getopt_main, _BB_DIR_BIN)
136#endif 150#endif
137#ifdef BB_GREP 151#ifdef BB_GREP
138 APPLET("grep", grep_main, _BB_DIR_BIN, grep_usage) 152 APPLET(grep, grep_main, _BB_DIR_BIN)
139#endif 153#endif
140#ifdef BB_GUNZIP 154#ifdef BB_GUNZIP
141 APPLET("gunzip", gunzip_main, _BB_DIR_BIN, gunzip_usage) 155 APPLET(gunzip, gunzip_main, _BB_DIR_BIN)
142#endif 156#endif
143#ifdef BB_GZIP 157#ifdef BB_GZIP
144 APPLET("gzip", gzip_main, _BB_DIR_BIN, gzip_usage) 158 APPLET(gzip, gzip_main, _BB_DIR_BIN)
145#endif 159#endif
146#ifdef BB_HALT 160#ifdef BB_HALT
147 APPLET("halt", halt_main, _BB_DIR_SBIN, halt_usage) 161 APPLET(halt, halt_main, _BB_DIR_SBIN)
148#endif 162#endif
149#ifdef BB_HEAD 163#ifdef BB_HEAD
150 APPLET("head", head_main, _BB_DIR_USR_BIN, head_usage) 164 APPLET(head, head_main, _BB_DIR_USR_BIN)
151#endif 165#endif
152#ifdef BB_HOSTID 166#ifdef BB_HOSTID
153 APPLET("hostid", hostid_main, _BB_DIR_USR_BIN, hostid_usage) 167 APPLET(hostid, hostid_main, _BB_DIR_USR_BIN)
154#endif 168#endif
155#ifdef BB_HOSTNAME 169#ifdef BB_HOSTNAME
156 APPLET("hostname", hostname_main, _BB_DIR_BIN, hostname_usage) 170 APPLET(hostname, hostname_main, _BB_DIR_BIN)
157#endif 171#endif
158#ifdef BB_ID 172#ifdef BB_ID
159 APPLET("id", id_main, _BB_DIR_USR_BIN, id_usage) 173 APPLET(id, id_main, _BB_DIR_USR_BIN)
160#endif 174#endif
161#ifdef BB_IFCONFIG 175#ifdef BB_IFCONFIG
162 APPLET("ifconfig", ifconfig_main, _BB_DIR_SBIN, ifconfig_usage) 176 APPLET(ifconfig, ifconfig_main, _BB_DIR_SBIN)
163#endif 177#endif
164#ifdef BB_INIT 178#ifdef BB_INIT
165 APPLET_NOUSAGE("init", init_main, _BB_DIR_SBIN) 179 APPLET(init, init_main, _BB_DIR_SBIN)
166#endif 180#endif
167#ifdef BB_INSMOD 181#ifdef BB_INSMOD
168 APPLET("insmod", insmod_main, _BB_DIR_SBIN, insmod_usage) 182 APPLET(insmod, insmod_main, _BB_DIR_SBIN)
169#endif 183#endif
170#ifdef BB_KILL 184#ifdef BB_KILL
171 APPLET("kill", kill_main, _BB_DIR_BIN, kill_usage) 185 APPLET(kill, kill_main, _BB_DIR_BIN)
172#endif 186#endif
173#ifdef BB_KILLALL 187#ifdef BB_KILLALL
174 APPLET("killall", kill_main, _BB_DIR_USR_BIN, killall_usage) 188 APPLET(killall, kill_main, _BB_DIR_USR_BIN)
175#endif 189#endif
176#ifdef BB_LENGTH 190#ifdef BB_LENGTH
177 APPLET("length", length_main, _BB_DIR_USR_BIN, length_usage) 191 APPLET(length, length_main, _BB_DIR_USR_BIN)
178#endif 192#endif
179#ifdef BB_LINUXRC 193#ifdef BB_LINUXRC
180 APPLET_NOUSAGE("linuxrc", init_main, _BB_DIR_ROOT) 194 APPLET_NOUSAGE(linuxrc, init_main, _BB_DIR_ROOT)
181#endif 195#endif
182#ifdef BB_LN 196#ifdef BB_LN
183 APPLET("ln", ln_main, _BB_DIR_BIN, ln_usage) 197 APPLET(ln, ln_main, _BB_DIR_BIN)
184#endif 198#endif
185#ifdef BB_LOADACM 199#ifdef BB_LOADACM
186 APPLET("loadacm", loadacm_main, _BB_DIR_USR_BIN, loadacm_usage) 200 APPLET(loadacm, loadacm_main, _BB_DIR_USR_BIN)
187#endif 201#endif
188#ifdef BB_LOADFONT 202#ifdef BB_LOADFONT
189 APPLET("loadfont", loadfont_main, _BB_DIR_USR_BIN, loadfont_usage) 203 APPLET(loadfont, loadfont_main, _BB_DIR_USR_BIN)
190#endif 204#endif
191#ifdef BB_LOADKMAP 205#ifdef BB_LOADKMAP
192 APPLET("loadkmap", loadkmap_main, _BB_DIR_SBIN, loadkmap_usage) 206 APPLET(loadkmap, loadkmap_main, _BB_DIR_SBIN)
193#endif 207#endif
194#ifdef BB_LOGGER 208#ifdef BB_LOGGER
195 APPLET("logger", logger_main, _BB_DIR_USR_BIN, logger_usage) 209 APPLET(logger, logger_main, _BB_DIR_USR_BIN)
196#endif 210#endif
197#ifdef BB_LOGNAME 211#ifdef BB_LOGNAME
198 APPLET("logname", logname_main, _BB_DIR_USR_BIN, logname_usage) 212 APPLET(logname, logname_main, _BB_DIR_USR_BIN)
199#endif 213#endif
200#ifdef BB_LS 214#ifdef BB_LS
201 APPLET("ls", ls_main, _BB_DIR_BIN, ls_usage) 215 APPLET(ls, ls_main, _BB_DIR_BIN)
202#endif 216#endif
203#ifdef BB_LSMOD 217#ifdef BB_LSMOD
204 APPLET("lsmod", lsmod_main, _BB_DIR_SBIN, lsmod_usage) 218 APPLET(lsmod, lsmod_main, _BB_DIR_SBIN)
205#endif 219#endif
206#ifdef BB_MAKEDEVS 220#ifdef BB_MAKEDEVS
207 APPLET("makedevs", makedevs_main, _BB_DIR_SBIN, makedevs_usage) 221 APPLET(makedevs, makedevs_main, _BB_DIR_SBIN)
208#endif 222#endif
209#ifdef BB_MD5SUM 223#ifdef BB_MD5SUM
210 APPLET("md5sum", md5sum_main, _BB_DIR_USR_BIN, md5sum_usage) 224 APPLET(md5sum, md5sum_main, _BB_DIR_USR_BIN)
211#endif 225#endif
212#ifdef BB_MKDIR 226#ifdef BB_MKDIR
213 APPLET("mkdir", mkdir_main, _BB_DIR_BIN, mkdir_usage) 227 APPLET(mkdir, mkdir_main, _BB_DIR_BIN)
214#endif 228#endif
215#ifdef BB_MKFIFO 229#ifdef BB_MKFIFO
216 APPLET("mkfifo", mkfifo_main, _BB_DIR_USR_BIN, mkfifo_usage) 230 APPLET(mkfifo, mkfifo_main, _BB_DIR_USR_BIN)
217#endif 231#endif
218#ifdef BB_MKFS_MINIX 232#ifdef BB_MKFS_MINIX
219 APPLET("mkfs.minix", mkfs_minix_main, _BB_DIR_SBIN, mkfs_minix_usage) 233 APPLET_ODDNAME("mkfs.minix", mkfs_minix_main, _BB_DIR_SBIN, mkfs_minix_usage_index, mkfs_minix)
220#endif 234#endif
221#ifdef BB_MKNOD 235#ifdef BB_MKNOD
222 APPLET("mknod", mknod_main, _BB_DIR_BIN, mknod_usage) 236 APPLET(mknod, mknod_main, _BB_DIR_BIN)
223#endif 237#endif
224#ifdef BB_MKSWAP 238#ifdef BB_MKSWAP
225 APPLET("mkswap", mkswap_main, _BB_DIR_SBIN, mkswap_usage) 239 APPLET(mkswap, mkswap_main, _BB_DIR_SBIN)
226#endif 240#endif
227#ifdef BB_MKTEMP 241#ifdef BB_MKTEMP
228 APPLET("mktemp", mktemp_main, _BB_DIR_BIN, mktemp_usage) 242 APPLET(mktemp, mktemp_main, _BB_DIR_BIN)
229#endif 243#endif
230#ifdef BB_MORE 244#ifdef BB_MORE
231 APPLET("more", more_main, _BB_DIR_BIN, more_usage) 245 APPLET(more, more_main, _BB_DIR_BIN)
232#endif 246#endif
233#ifdef BB_MOUNT 247#ifdef BB_MOUNT
234 APPLET("mount", mount_main, _BB_DIR_BIN, mount_usage) 248 APPLET(mount, mount_main, _BB_DIR_BIN)
235#endif 249#endif
236#ifdef BB_MT 250#ifdef BB_MT
237 APPLET("mt", mt_main, _BB_DIR_BIN, mt_usage) 251 APPLET(mt, mt_main, _BB_DIR_BIN)
238#endif 252#endif
239#ifdef BB_CP_MV 253#ifdef BB_CP_MV
240 APPLET("mv", cp_mv_main, _BB_DIR_BIN, mv_usage) 254 APPLET(mv, cp_mv_main, _BB_DIR_BIN)
241#endif 255#endif
242#ifdef BB_NC 256#ifdef BB_NC
243 APPLET("nc", nc_main, _BB_DIR_USR_BIN, nc_usage) 257 APPLET(nc, nc_main, _BB_DIR_USR_BIN)
244#endif 258#endif
245#ifdef BB_NSLOOKUP 259#ifdef BB_NSLOOKUP
246 APPLET("nslookup", nslookup_main, _BB_DIR_USR_BIN, nslookup_usage) 260 APPLET(nslookup, nslookup_main, _BB_DIR_USR_BIN)
247#endif 261#endif
248#ifdef BB_PING 262#ifdef BB_PING
249 APPLET("ping", ping_main, _BB_DIR_BIN, ping_usage) 263 APPLET(ping, ping_main, _BB_DIR_BIN)
250#endif 264#endif
251#ifdef BB_PIVOT_ROOT 265#ifdef BB_PIVOT_ROOT
252 APPLET("pivot_root", pivot_root_main, _BB_DIR_SBIN, pivot_root_usage) 266 APPLET(pivot_root, pivot_root_main, _BB_DIR_SBIN)
253#endif 267#endif
254#ifdef BB_POWEROFF 268#ifdef BB_POWEROFF
255 APPLET("poweroff", poweroff_main, _BB_DIR_SBIN, poweroff_usage) 269 APPLET(poweroff, poweroff_main, _BB_DIR_SBIN)
256#endif 270#endif
257#ifdef BB_PRINTF 271#ifdef BB_PRINTF
258 APPLET("printf", printf_main, _BB_DIR_USR_BIN, printf_usage) 272 APPLET(printf, printf_main, _BB_DIR_USR_BIN)
259#endif 273#endif
260#ifdef BB_PS 274#ifdef BB_PS
261 APPLET("ps", ps_main, _BB_DIR_BIN, ps_usage) 275 APPLET(ps, ps_main, _BB_DIR_BIN)
262#endif 276#endif
263#ifdef BB_PWD 277#ifdef BB_PWD
264 APPLET("pwd", pwd_main, _BB_DIR_BIN, pwd_usage) 278 APPLET(pwd, pwd_main, _BB_DIR_BIN)
265#endif 279#endif
266#ifdef BB_RDATE 280#ifdef BB_RDATE
267 APPLET("rdate", rdate_main, _BB_DIR_USR_BIN, rdate_usage) 281 APPLET(rdate, rdate_main, _BB_DIR_USR_BIN)
268#endif 282#endif
269#ifdef BB_READLINK 283#ifdef BB_READLINK
270 APPLET("readlink", readlink_main, _BB_DIR_USR_BIN, readlink_usage) 284 APPLET(readlink, readlink_main, _BB_DIR_USR_BIN)
271#endif 285#endif
272#ifdef BB_REBOOT 286#ifdef BB_REBOOT
273 APPLET("reboot", reboot_main, _BB_DIR_SBIN, reboot_usage) 287 APPLET(reboot, reboot_main, _BB_DIR_SBIN)
274#endif 288#endif
275#ifdef BB_RENICE 289#ifdef BB_RENICE
276 APPLET("renice", renice_main, _BB_DIR_USR_BIN, renice_usage) 290 APPLET(renice, renice_main, _BB_DIR_USR_BIN)
277#endif 291#endif
278#ifdef BB_RESET 292#ifdef BB_RESET
279 APPLET("reset", reset_main, _BB_DIR_USR_BIN, reset_usage) 293 APPLET(reset, reset_main, _BB_DIR_USR_BIN)
280#endif 294#endif
281#ifdef BB_RM 295#ifdef BB_RM
282 APPLET("rm", rm_main, _BB_DIR_BIN, rm_usage) 296 APPLET(rm, rm_main, _BB_DIR_BIN)
283#endif 297#endif
284#ifdef BB_RMDIR 298#ifdef BB_RMDIR
285 APPLET("rmdir", rmdir_main, _BB_DIR_BIN, rmdir_usage) 299 APPLET(rmdir, rmdir_main, _BB_DIR_BIN)
286#endif 300#endif
287#ifdef BB_RMMOD 301#ifdef BB_RMMOD
288 APPLET("rmmod", rmmod_main, _BB_DIR_SBIN, rmmod_usage) 302 APPLET(rmmod, rmmod_main, _BB_DIR_SBIN)
289#endif 303#endif
290#ifdef BB_ROUTE 304#ifdef BB_ROUTE
291 APPLET("route", route_main, _BB_DIR_USR_BIN, route_usage) 305 APPLET(route, route_main, _BB_DIR_USR_BIN)
292#endif 306#endif
293#ifdef BB_RPMUNPACK 307#ifdef BB_RPMUNPACK
294 APPLET("rpmunpack", rpmunpack_main, _BB_DIR_USR_BIN, rpmunpack_usage) 308 APPLET(rpmunpack, rpmunpack_main, _BB_DIR_USR_BIN)
295#endif 309#endif
296#ifdef BB_SED 310#ifdef BB_SED
297 APPLET("sed", sed_main, _BB_DIR_BIN, sed_usage) 311 APPLET(sed, sed_main, _BB_DIR_BIN)
298#endif 312#endif
299#ifdef BB_SETKEYCODES 313#ifdef BB_SETKEYCODES
300 APPLET("setkeycodes", setkeycodes_main, _BB_DIR_USR_BIN, setkeycodes_usage) 314 APPLET(setkeycodes, setkeycodes_main, _BB_DIR_USR_BIN)
301#endif 315#endif
302#ifdef BB_SH 316#ifdef BB_SH
303 APPLET("sh", shell_main, _BB_DIR_BIN, shell_usage) 317 APPLET(sh, shell_main, _BB_DIR_BIN)
304#endif 318#endif
305#ifdef BB_SLEEP 319#ifdef BB_SLEEP
306 APPLET("sleep", sleep_main, _BB_DIR_BIN, sleep_usage) 320 APPLET(sleep, sleep_main, _BB_DIR_BIN)
307#endif 321#endif
308#ifdef BB_SORT 322#ifdef BB_SORT
309 APPLET("sort", sort_main, _BB_DIR_USR_BIN, sort_usage) 323 APPLET(sort, sort_main, _BB_DIR_USR_BIN)
310#endif 324#endif
311#ifdef BB_STTY 325#ifdef BB_STTY
312 APPLET("stty", stty_main, _BB_DIR_BIN, stty_usage) 326 APPLET(stty, stty_main, _BB_DIR_BIN)
313#endif 327#endif
314#ifdef BB_SWAPONOFF 328#ifdef BB_SWAPONOFF
315 APPLET("swapoff", swap_on_off_main, _BB_DIR_SBIN, swapoff_usage) 329 APPLET(swapoff, swap_on_off_main, _BB_DIR_SBIN)
316#endif 330#endif
317#ifdef BB_SWAPONOFF 331#ifdef BB_SWAPONOFF
318 APPLET("swapon", swap_on_off_main, _BB_DIR_SBIN, swapon_usage) 332 APPLET(swapon, swap_on_off_main, _BB_DIR_SBIN)
319#endif 333#endif
320#ifdef BB_SYNC 334#ifdef BB_SYNC
321 APPLET("sync", sync_main, _BB_DIR_BIN, sync_usage) 335 APPLET(sync, sync_main, _BB_DIR_BIN)
322#endif 336#endif
323#ifdef BB_SYSLOGD 337#ifdef BB_SYSLOGD
324 APPLET("syslogd", syslogd_main, _BB_DIR_SBIN, syslogd_usage) 338 APPLET(syslogd, syslogd_main, _BB_DIR_SBIN)
325#endif 339#endif
326#ifdef BB_TAIL 340#ifdef BB_TAIL
327 APPLET("tail", tail_main, _BB_DIR_USR_BIN, tail_usage) 341 APPLET(tail, tail_main, _BB_DIR_USR_BIN)
328#endif 342#endif
329#ifdef BB_TAR 343#ifdef BB_TAR
330 APPLET("tar", tar_main, _BB_DIR_BIN, tar_usage) 344 APPLET(tar, tar_main, _BB_DIR_BIN)
331#endif 345#endif
332#ifdef BB_TEE 346#ifdef BB_TEE
333 APPLET("tee", tee_main, _BB_DIR_USR_BIN, tee_usage) 347 APPLET(tee, tee_main, _BB_DIR_USR_BIN)
334#endif 348#endif
335#ifdef BB_TELNET 349#ifdef BB_TELNET
336 APPLET("telnet", telnet_main, _BB_DIR_USR_BIN, telnet_usage) 350 APPLET(telnet, telnet_main, _BB_DIR_USR_BIN)
337#endif 351#endif
338#ifdef BB_TEST 352#ifdef BB_TEST
339 APPLET("test", test_main, _BB_DIR_USR_BIN, test_usage) 353 APPLET(test, test_main, _BB_DIR_USR_BIN)
340#endif 354#endif
341#ifdef BB_TOUCH 355#ifdef BB_TOUCH
342 APPLET("touch", touch_main, _BB_DIR_BIN, touch_usage) 356 APPLET(touch, touch_main, _BB_DIR_BIN)
343#endif 357#endif
344#ifdef BB_TR 358#ifdef BB_TR
345 APPLET("tr", tr_main, _BB_DIR_USR_BIN, tr_usage) 359 APPLET(tr, tr_main, _BB_DIR_USR_BIN)
346#endif 360#endif
347#ifdef BB_TRUE_FALSE 361#ifdef BB_TRUE_FALSE
348 APPLET("true", true_main, _BB_DIR_BIN, true_usage) 362 APPLET(true, true_main, _BB_DIR_BIN)
349#endif 363#endif
350#ifdef BB_TTY 364#ifdef BB_TTY
351 APPLET("tty", tty_main, _BB_DIR_USR_BIN, tty_usage) 365 APPLET(tty, tty_main, _BB_DIR_USR_BIN)
352#endif 366#endif
353#ifdef BB_UMOUNT 367#ifdef BB_UMOUNT
354 APPLET("umount", umount_main, _BB_DIR_BIN, umount_usage) 368 APPLET(umount, umount_main, _BB_DIR_BIN)
355#endif 369#endif
356#ifdef BB_UNAME 370#ifdef BB_UNAME
357 APPLET("uname", uname_main, _BB_DIR_BIN, uname_usage) 371 APPLET(uname, uname_main, _BB_DIR_BIN)
358#endif 372#endif
359#ifdef BB_UNIQ 373#ifdef BB_UNIQ
360 APPLET("uniq", uniq_main, _BB_DIR_USR_BIN, uniq_usage) 374 APPLET(uniq, uniq_main, _BB_DIR_USR_BIN)
361#endif 375#endif
362#ifdef BB_UNIX2DOS 376#ifdef BB_UNIX2DOS
363 APPLET("unix2dos", unix2dos_main, _BB_DIR_USR_BIN, unix2dos_usage) 377 APPLET(unix2dos, unix2dos_main, _BB_DIR_USR_BIN)
364#endif 378#endif
365#ifdef BB_UPDATE 379#ifdef BB_UPDATE
366 APPLET("update", update_main, _BB_DIR_SBIN, update_usage) 380 APPLET(update, update_main, _BB_DIR_SBIN)
367#endif 381#endif
368#ifdef BB_UPTIME 382#ifdef BB_UPTIME
369 APPLET("uptime", uptime_main, _BB_DIR_USR_BIN, uptime_usage) 383 APPLET(uptime, uptime_main, _BB_DIR_USR_BIN)
370#endif 384#endif
371#ifdef BB_USLEEP 385#ifdef BB_USLEEP
372 APPLET("usleep", usleep_main, _BB_DIR_BIN, usleep_usage) 386 APPLET(usleep, usleep_main, _BB_DIR_BIN)
373#endif 387#endif
374#ifdef BB_UUDECODE 388#ifdef BB_UUDECODE
375 APPLET("uudecode", uudecode_main, _BB_DIR_USR_BIN, uudecode_usage) 389 APPLET(uudecode, uudecode_main, _BB_DIR_USR_BIN)
376#endif 390#endif
377#ifdef BB_UUENCODE 391#ifdef BB_UUENCODE
378 APPLET("uuencode", uuencode_main, _BB_DIR_USR_BIN, uuencode_usage) 392 APPLET(uuencode, uuencode_main, _BB_DIR_USR_BIN)
379#endif 393#endif
380#ifdef BB_WATCHDOG 394#ifdef BB_WATCHDOG
381 APPLET("watchdog", watchdog_main, _BB_DIR_SBIN, watchdog_usage) 395 APPLET(watchdog, watchdog_main, _BB_DIR_SBIN)
382#endif 396#endif
383#ifdef BB_WC 397#ifdef BB_WC
384 APPLET("wc", wc_main, _BB_DIR_USR_BIN, wc_usage) 398 APPLET(wc, wc_main, _BB_DIR_USR_BIN)
385#endif 399#endif
386#ifdef BB_WGET 400#ifdef BB_WGET
387 APPLET("wget", wget_main, _BB_DIR_USR_BIN, wget_usage) 401 APPLET(wget, wget_main, _BB_DIR_USR_BIN)
388#endif 402#endif
389#ifdef BB_WHICH 403#ifdef BB_WHICH
390 APPLET("which", which_main, _BB_DIR_USR_BIN, which_usage) 404 APPLET(which, which_main, _BB_DIR_USR_BIN)
391#endif 405#endif
392#ifdef BB_WHOAMI 406#ifdef BB_WHOAMI
393 APPLET("whoami", whoami_main, _BB_DIR_USR_BIN, whoami_usage) 407 APPLET(whoami, whoami_main, _BB_DIR_USR_BIN)
394#endif 408#endif
395#ifdef BB_XARGS 409#ifdef BB_XARGS
396 APPLET("xargs", xargs_main, _BB_DIR_USR_BIN, xargs_usage) 410 APPLET(xargs, xargs_main, _BB_DIR_USR_BIN)
397#endif 411#endif
398#ifdef BB_YES 412#ifdef BB_YES
399 APPLET("yes", yes_main, _BB_DIR_USR_BIN, yes_usage) 413 APPLET(yes, yes_main, _BB_DIR_USR_BIN)
400#endif 414#endif
401#ifdef BB_GUNZIP 415#ifdef BB_GUNZIP
402 APPLET("zcat", gunzip_main, _BB_DIR_BIN, gunzip_usage) 416 APPLET(zcat, gunzip_main, _BB_DIR_BIN)
403#endif 417#endif
404 418
405#if !defined(PROTOTYPES) && !defined(MAKE_LINKS) 419#if !defined(PROTOTYPES) && !defined(MAKE_LINKS) && !defined(APPLET_ENUM)
406 { 0,NULL,0,NULL} 420 { 0,NULL,0,-1}
407}; 421};
408 422
409/* The -1 arises because of the {0,NULL,0,NULL} entry above. */ 423/* The -1 arises because of the {0,NULL,0,-1} entry above. */
410size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1); 424size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
411 425
412#endif 426#endif
diff --git a/applets/busybox.c b/applets/busybox.c
index 1409efa54..6c1070fc8 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -87,7 +87,6 @@ static void install_links(const char *busybox, int use_symbolic_links)
87 87
88int main(int argc, char **argv) 88int main(int argc, char **argv)
89{ 89{
90 struct BB_applet *applet;
91 const char *s; 90 const char *s;
92 91
93 for (s = applet_name = argv[0]; *s != '\0';) { 92 for (s = applet_name = argv[0]; *s != '\0';) {
@@ -103,13 +102,7 @@ int main(int argc, char **argv)
103 } 102 }
104#endif 103#endif
105 104
106 /* Do a binary search to find the applet entry given the name. */ 105 run_applet_by_name(applet_name, argc, argv);
107 if ((applet = find_applet_by_name(applet_name)) != NULL) {
108 if (applet->usage && argv[1] && strcmp(argv[1], "--help") == 0)
109 usage(applet->usage);
110 exit((*(applet->main)) (argc, argv));
111 }
112
113 error_msg_and_die("applet not found"); 106 error_msg_and_die("applet not found");
114} 107}
115 108
diff --git a/applets/usage.c b/applets/usage.c
index 7f998086b..1515c0898 100644
--- a/applets/usage.c
+++ b/applets/usage.c
@@ -1,1635 +1,2 @@
1#include "busybox.h" 1#define USAGE_MESSAGES
2 2#include <usage.h>
3#if defined BB_AR
4const char ar_usage[] =
5 "ar -[ovR]{ptx} archive filenames"
6#ifndef BB_FEATURE_TRIVIAL_HELP
7 "\n\nExtract or list files from an ar archive.\n\n"
8 "Options:\n"
9 "\t-o\t\tpreserve original dates\n"
10 "\t-p\t\textract to stdout\n"
11 "\t-t\t\tlist\n"
12 "\t-x\t\textract\n"
13 "\t-v\t\tverbosely list files processed\n"
14 "\t-R\t\trecursive action"
15#endif
16 ;
17#endif
18
19#if defined BB_BASENAME
20const char basename_usage[] =
21 "basename FILE [SUFFIX]"
22#ifndef BB_FEATURE_TRIVIAL_HELP
23 "\n\nStrips directory path and suffixes from FILE.\n"
24 "If specified, also removes any trailing SUFFIX."
25#endif
26 ;
27#endif
28
29#if defined BB_CAT
30const char cat_usage[] =
31 "cat [FILE]..."
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\n\nConcatenates FILE(s) and prints them to stdout."
34#endif
35 ;
36#endif
37
38#if defined BB_CHMOD_CHOWN_CHGRP
39const char chgrp_usage[] =
40 "chgrp [OPTION]... GROUP FILE..."
41#ifndef BB_FEATURE_TRIVIAL_HELP
42 "\n\nChange the group membership of each FILE to GROUP.\n"
43 "\nOptions:\n\t-R\tChanges files and directories recursively."
44#endif
45 ;
46#endif
47
48#if defined BB_CHMOD_CHOWN_CHGRP
49const char chmod_usage[] =
50 "chmod [-R] MODE[,MODE]... FILE..."
51#ifndef BB_FEATURE_TRIVIAL_HELP
52 "\n\nEach MODE is one or more of the letters ugoa, one of the symbols +-= and\n"
53 "one or more of the letters rwxst.\n\n"
54 "\nOptions:\n\t-R\tChanges files and directories recursively."
55#endif
56 ;
57#endif
58
59#if defined BB_CHMOD_CHOWN_CHGRP
60const char chown_usage[] =
61 "chown [OPTION]... OWNER[<.|:>[GROUP] FILE..."
62#ifndef BB_FEATURE_TRIVIAL_HELP
63 "\n\nChange the owner and/or group of each FILE to OWNER and/or GROUP.\n"
64 "\nOptions:\n\t-R\tChanges files and directories recursively."
65#endif
66 ;
67#endif
68
69#if defined BB_CHROOT
70const char chroot_usage[] =
71 "chroot NEWROOT [COMMAND...]"
72#ifndef BB_FEATURE_TRIVIAL_HELP
73 "\n\nRun COMMAND with root directory set to NEWROOT."
74#endif
75 ;
76#endif
77
78#if defined BB_CHVT
79const char chvt_usage[] =
80 "chvt N"
81#ifndef BB_FEATURE_TRIVIAL_HELP
82 "\n\nChanges the foreground virtual terminal to /dev/ttyN"
83#endif
84 ;
85#endif
86
87#if defined BB_CLEAR
88const char clear_usage[] =
89 "clear"
90#ifndef BB_FEATURE_TRIVIAL_HELP
91 "\n\nClear screen."
92#endif
93 ;
94#endif
95
96#if defined BB_CMP
97const char cmp_usage[] =
98 "cmp FILE1 [FILE2]"
99#ifndef BB_FEATURE_TRIVIAL_HELP
100 "\n\nCompare files."
101#endif
102 ;
103#endif
104
105#if defined BB_CP_MV
106const char cp_usage[] =
107 "cp [OPTION]... SOURCE DEST\n"
108 " or: cp [OPTION]... SOURCE... DIRECTORY"
109#ifndef BB_FEATURE_TRIVIAL_HELP
110 "\n\nCopies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n"
111 "\n"
112 "\t-a\tSame as -dpR\n"
113 "\t-d\tPreserves links\n"
114 "\t-p\tPreserves file attributes if possible\n"
115 "\t-f\tforce (implied; ignored) - always set\n"
116 "\t-R\tCopies directories recursively"
117#endif
118 ;
119#endif
120
121#if defined BB_CUT
122const char cut_usage[] =
123 "cut [OPTION]... [FILE]..."
124#ifndef BB_FEATURE_TRIVIAL_HELP
125 "\n\nPrints selected fields from each input FILE to standard output.\n\n"
126 "Options:\n"
127 "\t-b LIST\tOutput only bytes from LIST\n"
128 "\t-c LIST\tOutput only characters from LIST\n"
129 "\t-d CHAR\tUse CHAR instead of tab as the field delimiter\n"
130 "\t-s\tOutput only the lines containing delimiter\n"
131 "\t-f N\tPrint only these fields\n"
132 "\t-n\tIgnored"
133#endif
134 ;
135#endif
136
137#if defined BB_DATE
138const char date_usage[] =
139 "date [OPTION]... [+FORMAT]\n"
140 " or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]"
141#ifndef BB_FEATURE_TRIVIAL_HELP
142 "\n\nDisplays the current time in the given FORMAT, or sets the system date.\n"
143 "\nOptions:\n\t-R\t\tOutputs RFC-822 compliant date string\n"
144 "\t-d STRING\tdisplay time described by STRING, not `now'\n"
145 "\t-s\t\tSets time described by STRING\n"
146 "\t-u\t\tPrints or sets Coordinated Universal Time"
147#endif
148 ;
149#endif
150
151#if defined BB_DC
152const char dc_usage[] =
153 "dc expression ..."
154#ifndef BB_FEATURE_TRIVIAL_HELP
155 "\n\nThis is a Tiny RPN calculator that understands the\n"
156 "following operations: +, -, /, *, and, or, not, eor.\n"
157 "i.e. 'dc 2 2 add' -> 4, and 'dc 8 8 \\* 2 2 + /' -> 16"
158#endif
159 ;
160#endif
161
162#if defined BB_DD
163const char dd_usage[] =
164 "dd [if=FILE] [of=FILE] [bs=N] [count=N] [skip=N] [seek=N] [conv=notrunc|sync]"
165#ifndef BB_FEATURE_TRIVIAL_HELP
166 "\n\nCopy a file, converting and formatting according to options\n\n"
167 "\tif=FILE\tread from FILE instead of stdin\n"
168 "\tof=FILE\twrite to FILE instead of stdout\n"
169 "\tbs=N\tread and write N bytes at a time\n"
170 "\tcount=N\tcopy only N input blocks\n"
171 "\tskip=N\tskip N input blocks\n"
172 "\tseek=N\tskip N output blocks\n"
173 "\tconv=notrunc\tdon't truncate output file\n"
174 "\tconv=sync\tpad blocks with zeros\n"
175 "\n"
176 "Numbers may be suffixed by c (x1), w (x2), b (x512), kD (x1000), k (x1024),\n"
177 "MD (x1000000), M (x1048576), GD (x1000000000) or G (x1073741824)."
178#endif
179 ;
180#endif
181
182#if defined BB_DEALLOCVT
183const char deallocvt_usage[] =
184 "deallocvt N"
185#ifndef BB_FEATURE_TRIVIAL_HELP
186 "\n\nDeallocate unused virtual terminal /dev/ttyN"
187#endif
188 ;
189#endif
190
191#if defined BB_DF
192const char df_usage[] =
193 "df [-?"
194#ifdef BB_FEATURE_HUMAN_READABLE
195 "hm"
196#endif
197 "k] [filesystem ...]\n"
198#ifndef BB_FEATURE_TRIVIAL_HELP
199 "\n\nPrint the filesystem space used and space available."
200 "Options:\n"
201 "\t-?\tshow usage information\n"
202#ifdef BB_FEATURE_HUMAN_READABLE
203 "\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n"
204 "\t-m\tprint sizes in megabytes\n"
205 "\t-k\tprint sizes in kilobytes(default)\n"
206#else
207 "\t-k\tprint sizes in kilobytes(compatability)\n"
208#endif
209#endif
210 ;
211#endif
212
213#if defined BB_DIRNAME
214const char dirname_usage[] =
215 "dirname [FILENAME ...]"
216#ifndef BB_FEATURE_TRIVIAL_HELP
217 "\n\nStrips non-directory suffix from FILENAME"
218#endif
219 ;
220#endif
221
222#if defined BB_DMESG
223const char dmesg_usage[] =
224 "dmesg [-c] [-n LEVEL] [-s SIZE]"
225#ifndef BB_FEATURE_TRIVIAL_HELP
226 "\n\nPrints or controls the kernel ring buffer\n\n"
227 "Options:\n"
228 "\t-c\t\tClears the ring buffer's contents after printing\n"
229 "\t-n LEVEL\tSets console logging level\n"
230 "\t-s SIZE\t\tUse a buffer of size SIZE"
231#endif
232 ;
233#endif
234
235#if defined BB_DOS2UNIX
236const char dos2unix_usage[] =
237 "dos2unix < dosfile > unixfile"
238#ifndef BB_FEATURE_TRIVIAL_HELP
239 "\n\nConverts a text file from dos format to unix format."
240#endif
241 ;
242#endif
243
244#if defined BB_DPKG
245const char dpkg_usage[] =
246 "udpkg <-i|-r|--unpack|--configure> my.deb\n"
247 "WORK IN PROGRESS, only usefull for debian-installer\n"
248#ifndef BB_FEATURE_TRIVIAL_HELP
249#endif
250 ;
251#endif
252
253#if defined BB_DPKG_DEB
254const char dpkg_deb_usage[] =
255 "dpkg-deb [-cexX] file directory"
256#ifndef BB_FEATURE_TRIVIAL_HELP
257 "\n\nPerform actions on debian packages (.debs)\n\n"
258 "Options:\n"
259 "\t-c\tList contents of filesystem tree (verbose)\n"
260 "\t-l\tList contents of filesystem tree (.list format)\n"
261 "\t-e\tExtract control files to directory\n"
262 "\t-x\tExctract packages filesystem tree to directory\n"
263 "\t-X\tVerbose extract"
264#endif
265 ;
266#endif
267
268#if defined BB_DU
269const char du_usage[] =
270 "du [-?ls"
271#ifdef BB_FEATURE_HUMAN_READABLE
272 "hm"
273#endif
274 "k] [FILE]...\n"
275#ifndef BB_FEATURE_TRIVIAL_HELP
276 "\n\nSummarizes disk space used for each FILE and/or directory.\n"
277 "Disk space is printed in units of 1024 bytes.\n\n"
278 "Options:\n"
279 "\t-?\tshow usage information\n"
280 "\t-l\tcount sizes many times if hard linked\n"
281 "\t-s\tdisplay only a total for each argument"
282#ifdef BB_FEATURE_HUMAN_READABLE
283 "\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n"
284 "\t-m\tprint sizes in megabytes\n"
285 "\t-k\tprint sizes in kilobytes(default)\n"
286#else
287 "\t-k\tprint sizes in kilobytes(compatability)\n"
288#endif
289#endif
290 ;
291#endif
292
293#if defined BB_DUMPKMAP
294const char dumpkmap_usage[] =
295 "dumpkmap > keymap"
296#ifndef BB_FEATURE_TRIVIAL_HELP
297 "\n\nPrints out a binary keyboard translation table to standard input."
298#endif
299 ;
300#endif
301
302#if defined BB_DUTMP
303const char dutmp_usage[] =
304 "dutmp [FILE]"
305#ifndef BB_FEATURE_TRIVIAL_HELP
306 "\n\nDump utmp file format (pipe delimited) from FILE\n"
307 "or stdin to stdout. (i.e. 'dutmp /var/run/utmp')"
308#endif
309 ;
310#endif
311
312#if defined BB_ECHO
313const char echo_usage[] =
314 "echo [-neE] [ARG ...]"
315#ifndef BB_FEATURE_TRIVIAL_HELP
316 "\n\nPrints the specified ARGs to stdout\n\n"
317 "Options:\n"
318 "\t-n\tsuppress trailing newline\n"
319 "\t-e\tinterpret backslash-escaped characters (i.e. \\t=tab etc)\n"
320 "\t-E\tdisable interpretation of backslash-escaped characters"
321#endif
322 ;
323#endif
324
325#if defined BB_EXPR
326const char expr_usage[] =
327 "expr EXPRESSION"
328#ifndef BB_FEATURE_TRIVIAL_HELP
329"\n\nPrints the value of EXPRESSION to standard output.\n\n"
330"EXPRESSION may be:\n"
331"ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2\n"
332"ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0\n"
333"ARG1 < ARG2 ARG1 is less than ARG2\n"
334"ARG1 <= ARG2 ARG1 is less than or equal to ARG2\n"
335"ARG1 = ARG2 ARG1 is equal to ARG2\n"
336"ARG1 != ARG2 ARG1 is unequal to ARG2\n"
337"ARG1 >= ARG2 ARG1 is greater than or equal to ARG2\n"
338"ARG1 > ARG2 ARG1 is greater than ARG2\n"
339"ARG1 + ARG2 arithmetic sum of ARG1 and ARG2\n"
340"ARG1 - ARG2 arithmetic difference of ARG1 and ARG2\n"
341"ARG1 * ARG2 arithmetic product of ARG1 and ARG2\n"
342"ARG1 / ARG2 arithmetic quotient of ARG1 divided by ARG2\n"
343"ARG1 % ARG2 arithmetic remainder of ARG1 divided by ARG2\n"
344"STRING : REGEXP anchored pattern match of REGEXP in STRING\n"
345"match STRING REGEXP same as STRING : REGEXP\n"
346"substr STRING POS LENGTH substring of STRING, POS counted from 1\n"
347"index STRING CHARS index in STRING where any CHARS is found, or 0\n"
348"length STRING length of STRING\n"
349"quote TOKEN interpret TOKEN as a string, even if it is a \n"
350" keyword like `match' or an operator like `/'\n"
351"( EXPRESSION ) value of EXPRESSION\n\n"
352"Beware that many operators need to be escaped or quoted for shells.\n"
353"Comparisons are arithmetic if both ARGs are numbers, else\n"
354"lexicographical. Pattern matches return the string matched between \n"
355"\\( and \\) or null; if \\( and \\) are not used, they return the number \n"
356"of characters matched or 0."
357
358#endif
359 ;
360#endif
361
362
363#if defined BB_TRUE_FALSE
364const char false_usage[] =
365 "false"
366#ifndef BB_FEATURE_TRIVIAL_HELP
367 "\n\nReturn an exit code of FALSE (1)."
368#endif
369 ;
370#endif
371
372#if defined BB_FDFLUSH
373const char fdflush_usage[] =
374 "fdflush DEVICE"
375#ifndef BB_FEATURE_TRIVIAL_HELP
376 "\n\nForces floppy disk drive to detect disk change"
377#endif
378 ;
379#endif
380
381#if defined BB_FIND
382const char find_usage[] =
383 "find [PATH...] [EXPRESSION]"
384#ifndef BB_FEATURE_TRIVIAL_HELP
385 "\n\nSearch for files in a directory hierarchy. The default PATH is\n"
386 "the current directory; default EXPRESSION is '-print'\n\n"
387 "\nEXPRESSION may consist of:\n"
388 "\t-follow\t\tDereference symbolic links.\n"
389 "\t-name PATTERN\tFile name (leading directories removed) matches PATTERN.\n"
390#ifdef BB_FEATURE_FIND_TYPE
391 "\t-type X\t\tFiletype matches X (where X is one of: f,d,l,b,c,...)\n"
392#endif
393#ifdef BB_FEATURE_FIND_PERM
394 "\t-perm PERMS\tPermissions match any of (+NNN); all of (-NNN); or exactly (NNN)\n"
395#endif
396#ifdef BB_FEATURE_FIND_MTIME
397 "\t-mtime TIME\tModified time is greater than (+N); less than (-N); or exactly (N) days\n"
398#endif
399#endif
400 ;
401#endif
402
403#if defined BB_FREE
404const char free_usage[] =
405 "free"
406#ifndef BB_FEATURE_TRIVIAL_HELP
407 "\n\nDisplays the amount of free and used system memory"
408#endif
409 ;
410#endif
411
412#if defined BB_FREERAMDISK
413const char freeramdisk_usage[] =
414 "freeramdisk DEVICE"
415#ifndef BB_FEATURE_TRIVIAL_HELP
416 "\n\nFrees all memory used by the specified ramdisk."
417#endif
418 ;
419#endif
420
421#if defined BB_FSCK_MINIX
422const char fsck_minix_usage[] =
423 "Usage: fsck.minix [-larvsmf] /dev/name"
424#ifndef BB_FEATURE_TRIVIAL_HELP
425 "\n\nPerforms a consistency check for MINIX filesystems.\n\n"
426 "Options:\n"
427 "\t-l\tLists all filenames\n"
428 "\t-r\tPerform interactive repairs\n"
429 "\t-a\tPerform automatic repairs\n"
430 "\t-v\tverbose\n"
431 "\t-s\tOutputs super-block information\n"
432 "\t-m\tActivates MINIX-like \"mode not cleared\" warnings\n"
433 "\t-f\tForce file system check."
434#endif
435 ;
436#endif
437
438#if defined BB_GETOPT
439const char getopt_usage[] =
440"getopt [OPTIONS]..."
441#ifndef BB_FEATURE_TRIVIAL_HELP
442"\nParse command options\n"
443" -a, --alternative Allow long options starting with single -\n"
444" -l, --longoptions=longopts Long options to be recognized\n"
445" -n, --name=progname The name under which errors are reported\n"
446" -o, --options=optstring Short options to be recognized\n"
447" -q, --quiet Disable error reporting by getopt(3)\n"
448" -Q, --quiet-output No normal output\n"
449" -s, --shell=shell Set shell quoting conventions\n"
450" -T, --test Test for getopt(1) version\n"
451" -u, --unqote Do not quote the output"
452#endif
453;
454#endif
455
456#if defined BB_GREP
457const char grep_usage[] =
458 "grep [-ihHnqvs] pattern [files...]"
459#ifndef BB_FEATURE_TRIVIAL_HELP
460 "\n\nSearch for PATTERN in each FILE or standard input.\n\n"
461 "Options:\n"
462 "\t-H\tprefix output lines with filename where match was found\n"
463 "\t-h\tsuppress the prefixing filename on output\n"
464 "\t-i\tignore case distinctions\n"
465 "\t-n\tprint line number with output lines\n"
466 "\t-q\tbe quiet. Returns 0 if result was found, 1 otherwise\n"
467 "\t-v\tselect non-matching lines\n"
468 "\t-s\tsuppress file open/read error messages"
469#endif
470 ;
471#endif
472
473#if defined BB_GUNZIP
474const char gunzip_usage[] =
475 "gunzip [OPTION]... FILE"
476#ifndef BB_FEATURE_TRIVIAL_HELP
477 "\n\nUncompress FILE (or standard input if FILE is '-').\n\n"
478 "Options:\n"
479 "\t-c\tWrite output to standard output\n"
480 "\t-t\tTest compressed file integrity"
481#endif
482 ;
483#endif
484
485#if defined BB_GZIP
486const char gzip_usage[] =
487 "gzip [OPTION]... FILE"
488#ifndef BB_FEATURE_TRIVIAL_HELP
489 "\n\nCompress FILE with maximum compression.\n"
490 "When FILE is '-', reads standard input. Implies -c.\n\n"
491 "Options:\n"
492 "\t-c\tWrite output to standard output instead of FILE.gz\n"
493 "\t-d\tdecompress"
494#endif
495 ;
496#endif
497
498#if defined BB_HALT
499const char halt_usage[] =
500 "halt"
501#ifndef BB_FEATURE_TRIVIAL_HELP
502 "\n\nHalt the system."
503#endif
504 ;
505#endif
506
507#if defined BB_HEAD
508const char head_usage[] =
509 "head [OPTION] [FILE]..."
510#ifndef BB_FEATURE_TRIVIAL_HELP
511 "\n\nPrint first 10 lines of each FILE to standard output.\n"
512 "With more than one FILE, precede each with a header giving the\n"
513 "file name. With no FILE, or when FILE is -, read standard input.\n\n"
514
515 "Options:\n" "\t-n NUM\t\tPrint first NUM lines instead of first 10"
516#endif
517 ;
518#endif
519
520#if defined BB_HOSTID
521const char hostid_usage[] =
522 "hostid"
523#ifndef BB_FEATURE_TRIVIAL_HELP
524 "\n\nPrint out a unique 32-bit identifier for the machine."
525#endif
526 ;
527#endif
528
529#if defined BB_HOSTNAME
530const char hostname_usage[] =
531 "hostname [OPTION] {hostname | -F file}"
532#ifndef BB_FEATURE_TRIVIAL_HELP
533 "\n\nGet or set the hostname or DNS domain name. If a hostname is given\n"
534 "(or a file with the -F parameter), the host name will be set.\n\n"
535
536 "Options:\n"
537 "\t-s\t\tShort\n"
538 "\t-i\t\tAddresses for the hostname\n"
539 "\t-d\t\tDNS domain name\n"
540 "\t-F, --file FILE\tUse the contents of FILE to specify the hostname"
541#endif
542 ;
543#endif
544
545#if defined BB_ID
546const char id_usage[] =
547 "id [OPTIONS]... [USERNAME]"
548#ifndef BB_FEATURE_TRIVIAL_HELP
549 "\n\nPrint information for USERNAME or the current user\n\n"
550 "Options:\n"
551 "\t-g\tprints only the group ID\n"
552 "\t-u\tprints only the user ID\n"
553 "\t-n\tprint a name instead of a number (with for -ug)\n"
554 "\t-r\tprints the real user ID instead of the effective ID (with -ug)"
555#endif
556 ;
557#endif
558
559#if defined BB_IFCONFIG
560const char ifconfig_usage[] =
561 "ifconfig [-a] [-i] [-v] <interface> [<address>]"
562#ifndef BB_FEATURE_TRIVIAL_HELP
563 "\n\nconfigure a network interface\n\n"
564 "Options:\n"
565 " [[-]broadcast [<address>]] [[-]pointopoint [<address>]]\n"
566 " [netmask <address>] [dstaddr <address>] [tunnel <adress>]\n"
567#ifdef SIOCSKEEPALIVE
568 " [outfill <NN>] [keepalive <NN>]\n"
569#endif
570 " [hw ether <address>] [metric <NN>] [mtu <NN>]\n"
571 " [[-]trailers] [[-]arp] [[-]allmulti]\n"
572 " [multicast] [[-]promisc]\n"
573 " [mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]\n"
574 " [up|down] ..."
575#endif
576 ;
577#endif
578
579#if defined BB_INSMOD
580const char insmod_usage[] =
581 "insmod [OPTION]... MODULE [symbol=value]..."
582#ifndef BB_FEATURE_TRIVIAL_HELP
583 "\n\nLoads the specified kernel modules into the kernel.\n\n"
584 "Options:\n"
585 "\t-f\tForce module to load into the wrong kernel version.\n"
586 "\t-k\tMake module autoclean-able.\n"
587 "\t-v\tverbose output\n"
588 "\t-L\tLock to prevent simultaneous loads of a module\n"
589 "\t-x\tdo not export externs"
590#endif
591 ;
592#endif
593
594#if defined BB_KILL
595const char kill_usage[] =
596 "kill [-signal] process-id [process-id ...]"
597#ifndef BB_FEATURE_TRIVIAL_HELP
598 "\n\nSend a signal (default is SIGTERM) to the specified process(es).\n\n"
599 "Options:\n" "\t-l\tList all signal names and numbers."
600#endif
601 ;
602#endif
603
604#if defined BB_KILLALL
605const char killall_usage[] =
606 "killall [-signal] process-name [process-name ...]"
607#ifndef BB_FEATURE_TRIVIAL_HELP
608 "\n\nSend a signal (default is SIGTERM) to the specified process(es).\n\n"
609 "Options:\n" "\t-l\tList all signal names and numbers."
610#endif
611 ;
612#endif
613
614#if defined BB_LENGTH
615const char length_usage[] =
616 "length STRING"
617#ifndef BB_FEATURE_TRIVIAL_HELP
618 "\n\nPrints out the length of the specified STRING."
619#endif
620 ;
621#endif
622
623#if defined BB_LN
624const char ln_usage[] =
625 "ln [OPTION] TARGET... LINK_NAME|DIRECTORY"
626#ifndef BB_FEATURE_TRIVIAL_HELP
627 "\n\nCreate a link named LINK_NAME or DIRECTORY to the specified TARGET\n"
628 "\nYou may use '--' to indicate that all following arguments are non-options.\n\n"
629 "Options:\n"
630 "\t-s\tmake symbolic links instead of hard links\n"
631 "\t-f\tremove existing destination files\n"
632 "\t-n\tno dereference symlinks - treat like normal file"
633#endif
634 ;
635#endif
636
637#if defined BB_LOADACM
638const char loadacm_usage[] =
639 "loadacm < mapfile"
640#ifndef BB_FEATURE_TRIVIAL_HELP
641 "\n\nLoads an acm from standard input."
642#endif
643 ;
644#endif
645
646#if defined BB_LOADFONT
647const char loadfont_usage[] =
648 "loadfont < font"
649#ifndef BB_FEATURE_TRIVIAL_HELP
650 "\n\nLoads a console font from standard input."
651#endif
652 ;
653#endif
654
655#if defined BB_LOADKMAP
656const char loadkmap_usage[] =
657 "loadkmap < keymap"
658#ifndef BB_FEATURE_TRIVIAL_HELP
659 "\n\nLoads a binary keyboard translation table from standard input."
660#endif
661 ;
662#endif
663
664#if defined BB_LOGGER
665const char logger_usage[] =
666 "logger [OPTION]... [MESSAGE]"
667#ifndef BB_FEATURE_TRIVIAL_HELP
668 "\n\nWrite MESSAGE to the system log. If MESSAGE is omitted, log stdin.\n\n"
669 "Options:\n"
670 "\t-s\tLog to stderr as well as the system log.\n"
671 "\t-t\tLog using the specified tag (defaults to user name).\n"
672 "\t-p\tEnter the message with the specified priority.\n"
673 "\t\tThis may be numerical or a ``facility.level'' pair."
674#endif
675 ;
676#endif
677
678#if defined BB_LOGNAME
679const char logname_usage[] =
680 "logname"
681#ifndef BB_FEATURE_TRIVIAL_HELP
682 "\n\nPrint the name of the current user."
683#endif
684 ;
685#endif
686
687#if defined BB_LS
688const char ls_usage[] =
689 "ls [-1Aa"
690#ifdef BB_FEATURE_LS_TIMESTAMPS
691 "c"
692#endif
693 "Cd"
694#ifdef BB_FEATURE_LS_TIMESTAMPS
695 "e"
696#endif
697#ifdef BB_FEATURE_LS_FILETYPES
698 "F"
699#endif
700 "iln"
701#ifdef BB_FEATURE_LS_FILETYPES
702 "p"
703#endif
704#ifdef BB_FEATURE_LS_FOLLOWLINKS
705 "L"
706#endif
707#ifdef BB_FEATURE_LS_RECURSIVE
708 "R"
709#endif
710#ifdef BB_FEATURE_LS_SORTFILES
711 "rS"
712#endif
713 "s"
714#ifdef BB_FEATURE_AUTOWIDTH
715 "T"
716#endif
717#ifdef BB_FEATURE_LS_TIMESTAMPS
718 "tu"
719#endif
720#ifdef BB_FEATURE_LS_SORTFILES
721 "v"
722#endif
723#ifdef BB_FEATURE_AUTOWIDTH
724 "w"
725#endif
726 "x"
727#ifdef BB_FEATURE_LS_SORTFILES
728 "X"
729#endif
730#ifdef BB_FEATURE_HUMAN_READABLE
731 "h"
732#endif
733 "k] [filenames...]\n"
734#ifndef BB_FEATURE_TRIVIAL_HELP
735 "\n\nList directory contents\n\n"
736 "Options:\n"
737 "\t-1\tlist files in a single column\n"
738 "\t-A\tdo not list implied . and ..\n"
739 "\t-a\tdo not hide entries starting with .\n"
740 "\t-C\tlist entries by columns\n"
741#ifdef BB_FEATURE_LS_TIMESTAMPS
742 "\t-c\twith -l: show ctime (the time of last\n"
743 "\t\tmodification of file status information)\n"
744#endif
745 "\t-d\tlist directory entries instead of contents\n"
746#ifdef BB_FEATURE_LS_TIMESTAMPS
747 "\t-e\tlist both full date and full time\n"
748#endif
749#ifdef BB_FEATURE_LS_FILETYPES
750 "\t-F\tappend indicator (one of */=@|) to entries\n"
751#endif
752 "\t-i\tlist the i-node for each file\n"
753 "\t-l\tuse a long listing format\n"
754 "\t-n\tlist numeric UIDs and GIDs instead of names\n"
755#ifdef BB_FEATURE_LS_FILETYPES
756 "\t-p\tappend indicator (one of /=@|) to entries\n"
757#endif
758#ifdef BB_FEATURE_LS_FOLLOWLINKS
759 "\t-L\tlist entries pointed to by symbolic links\n"
760#endif
761#ifdef BB_FEATURE_LS_RECURSIVE
762 "\t-R\tlist subdirectories recursively\n"
763#endif
764#ifdef BB_FEATURE_LS_SORTFILES
765 "\t-r\tsort the listing in reverse order\n"
766 "\t-S\tsort the listing by file size\n"
767#endif
768 "\t-s\tlist the size of each file, in blocks\n"
769#ifdef BB_FEATURE_AUTOWIDTH
770 "\t-T NUM\tassume Tabstop every NUM columns\n"
771#endif
772#ifdef BB_FEATURE_LS_TIMESTAMPS
773 "\t-t\twith -l: show modification time (the time of last\n"
774 "\t\tchange of the file)\n"
775 "\t-u\twith -l: show access time (the time of last\n"
776 "\t\taccess of the file)\n"
777#endif
778#ifdef BB_FEATURE_LS_SORTFILES
779 "\t-v\tsort the listing by version\n"
780#endif
781#ifdef BB_FEATURE_AUTOWIDTH
782 "\t-w NUM\tassume the terminal is NUM columns wide\n"
783#endif
784 "\t-x\tlist entries by lines instead of by columns\n"
785#ifdef BB_FEATURE_LS_SORTFILES
786 "\t-X\tsort the listing by extension\n"
787#endif
788
789#ifdef BB_FEATURE_HUMAN_READABLE
790 "\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n"
791 "\t-k\tprint sizes in kilobytes(default)\n"
792#else
793 "\t-k\tprint sizes in kilobytes(compatability)"
794#endif
795
796#endif /* BB_FEATURE_TRIVIAL_HELP */
797 ;
798#endif /* BB_LS */
799
800#if defined BB_LSMOD
801const char lsmod_usage[] =
802 "lsmod"
803#ifndef BB_FEATURE_TRIVIAL_HELP
804 "\n\nList the currently loaded kernel modules."
805#endif
806 ;
807#endif
808
809#if defined BB_MAKEDEVS
810const char makedevs_usage[] =
811 "makedevs NAME TYPE MAJOR MINOR FIRST LAST [s]"
812#ifndef BB_FEATURE_TRIVIAL_HELP
813 "\n\nCreates a range of block or character special files\n\n"
814 "TYPEs include:\n"
815 "\tb:\tMake a block (buffered) device.\n"
816 "\tc or u:\tMake a character (un-buffered) device.\n"
817 "\tp:\tMake a named pipe. MAJOR and MINOR are ignored for named pipes.\n\n"
818 "FIRST specifies the number appended to NAME to create the first device.\n"
819 "LAST specifies the number of the last item that should be created.\n"
820 "If 's' is the last argument, the base device is created as well.\n\n"
821 "For example:\n"
822 "\tmakedevs /dev/ttyS c 4 66 2 63 -> ttyS2-ttyS63\n"
823 "\tmakedevs /dev/hda b 3 0 0 8 s -> hda,hda1-hda8"
824#endif
825 ;
826#endif
827
828#if defined BB_MD5SUM
829const char md5sum_usage[] =
830 "md5sum [OPTION] [FILE]...\n"
831 "or: md5sum [OPTION] -c [FILE]"
832#ifndef BB_FEATURE_TRIVIAL_HELP
833 "\n\nPrint or check MD5 checksums.\n\n"
834 "Options:\n"
835 "With no FILE, or when FILE is -, read standard input.\n\n"
836 "\t-b\tread files in binary mode\n"
837 "\t-c\tcheck MD5 sums against given list\n"
838 "\t-t\tread files in text mode (default)\n"
839 "\t-g\tread a string\n"
840 "\nThe following two options are useful only when verifying checksums:\n"
841 "\t-s,\tdon't output anything, status code shows success\n"
842 "\t-w,\twarn about improperly formated MD5 checksum lines"
843#endif
844 ;
845#endif
846
847#if defined BB_MKDIR
848const char mkdir_usage[] =
849 "mkdir [OPTION] DIRECTORY..."
850#ifndef BB_FEATURE_TRIVIAL_HELP
851 "\n\nCreate the DIRECTORY(ies), if they do not already exist\n\n"
852
853 "Options:\n"
854 "\t-m\tset permission mode (as in chmod), not rwxrwxrwx - umask\n"
855 "\t-p\tno error if existing, make parent directories as needed"
856#endif
857 ;
858#endif
859
860#if defined BB_MKFIFO
861const char mkfifo_usage[] =
862 "mkfifo [OPTIONS] name"
863#ifndef BB_FEATURE_TRIVIAL_HELP
864 "\n\nCreates a named pipe (identical to 'mknod name p')\n\n"
865 "Options:\n"
866 "\t-m\tcreate the pipe using the specified mode (default a=rw)"
867#endif
868 ;
869#endif
870
871#if defined BB_MKFS_MINIX
872const char mkfs_minix_usage[] =
873 "mkfs.minix [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]"
874#ifndef BB_FEATURE_TRIVIAL_HELP
875 "\n\nMake a MINIX filesystem.\n\n"
876 "Options:\n"
877 "\t-c\t\tCheck the device for bad blocks\n"
878 "\t-n [14|30]\tSpecify the maximum length of filenames\n"
879 "\t-i INODES\tSpecify the number of inodes for the filesystem\n"
880 "\t-l FILENAME\tRead the bad blocks list from FILENAME\n"
881 "\t-v\t\tMake a Minix version 2 filesystem"
882#endif
883 ;
884#endif
885
886#if defined BB_MKNOD
887const char mknod_usage[] =
888 "mknod [OPTIONS] NAME TYPE MAJOR MINOR"
889#ifndef BB_FEATURE_TRIVIAL_HELP
890 "\n\nCreate a special file (block, character, or pipe).\n\n"
891 "Options:\n"
892 "\t-m\tcreate the special file using the specified mode (default a=rw)\n\n"
893 "TYPEs include:\n"
894 "\tb:\tMake a block (buffered) device.\n"
895 "\tc or u:\tMake a character (un-buffered) device.\n"
896 "\tp:\tMake a named pipe. MAJOR and MINOR are ignored for named pipes."
897#endif
898 ;
899#endif
900
901#if defined BB_MKSWAP
902const char mkswap_usage[] =
903 "mkswap [-c] [-v0|-v1] device [block-count]"
904#ifndef BB_FEATURE_TRIVIAL_HELP
905 "\n\nPrepare a disk partition to be used as a swap partition.\n\n"
906 "Options:\n" "\t-c\t\tCheck for read-ability.\n"
907 "\t-v0\t\tMake version 0 swap [max 128 Megs].\n"
908 "\t-v1\t\tMake version 1 swap [big!] (default for kernels > 2.1.117).\n"
909 "\tblock-count\tNumber of block to use (default is entire partition)."
910#endif
911 ;
912#endif
913
914#if defined BB_MKTEMP
915const char mktemp_usage[] =
916 "mktemp [-q] TEMPLATE"
917#ifndef BB_FEATURE_TRIVIAL_HELP
918 "\n\nCreates a temporary file with its name based on TEMPLATE.\n"
919 "TEMPLATE is any name with six `Xs' (i.e. /tmp/temp.XXXXXX)."
920#endif
921 ;
922#endif
923
924#if defined BB_MORE
925const char more_usage[] =
926 "more [FILE ...]"
927#ifndef BB_FEATURE_TRIVIAL_HELP
928 "\n\nMore is a filter for viewing FILE one screenful at a time."
929#endif
930 ;
931#endif
932
933#if defined BB_MOUNT
934const char mount_usage[] =
935 "mount [flags] device directory [-o options,more-options]"
936#ifndef BB_FEATURE_TRIVIAL_HELP
937 "\n\nMount a filesystem\n\n"
938 "Flags:\n"
939 "\t-a:\t\tMount all filesystems in fstab.\n"
940#ifdef BB_MTAB
941 "\t-f:\t\t\"Fake\" mount. Add entry to mount table but don't mount it.\n"
942 "\t-n:\t\tDon't write a mount table entry.\n"
943#endif
944 "\t-o option:\tOne of many filesystem options, listed below.\n"
945 "\t-r:\t\tMount the filesystem read-only.\n"
946 "\t-t fs-type:\tSpecify the filesystem type.\n"
947 "\t-w:\t\tMount for reading and writing (default).\n"
948 "\n"
949 "Options for use with the \"-o\" flag:\n"
950 "\tasync/sync:\tWrites are asynchronous / synchronous.\n"
951 "\tatime/noatime:\tEnable / disable updates to inode access times.\n"
952 "\tdev/nodev:\tAllow use of special device files / disallow them.\n"
953 "\texec/noexec:\tAllow use of executable files / disallow them.\n"
954#if defined BB_FEATURE_MOUNT_LOOP
955 "\tloop:\t\tMounts a file via loop device.\n"
956#endif
957 "\tsuid/nosuid:\tAllow set-user-id-root programs / disallow them.\n"
958 "\tremount:\tRe-mount a currently-mounted filesystem, changing its flags.\n"
959 "\tro/rw:\t\tMount for read-only / read-write.\n"
960 "\nThere are EVEN MORE flags that are specific to each filesystem.\n"
961 "You'll have to see the written documentation for those."
962#endif
963 ;
964#endif
965
966#if defined BB_MT
967const char mt_usage[] =
968 "mt [-f device] opcode value"
969#ifndef BB_FEATURE_TRIVIAL_HELP
970 "\n\nControl magnetic tape drive operation\n"
971 "\nAvailable Opcodes:\n\n"
972 "bsf bsfm bsr bss datacompression drvbuffer eof eom erase\n"
973 "fsf fsfm fsr fss load lock mkpart nop offline ras1 ras2\n"
974 "ras3 reset retension rew rewoffline seek setblk setdensity\n"
975 "setpart tell unload unlock weof wset"
976#endif
977 ;
978#endif
979
980#if defined BB_CP_MV
981const char mv_usage[] =
982 "mv SOURCE DEST\n"
983 " or: mv SOURCE... DIRECTORY"
984#ifndef BB_FEATURE_TRIVIAL_HELP
985 "\n\nRename SOURCE to DEST, or move SOURCE(s) to DIRECTORY."
986#endif
987 ;
988#endif
989
990#if defined BB_NC
991const char nc_usage[] =
992 "nc [-p PORT] IP PORT\n"
993 " or: nc -l -p PORT"
994#ifndef BB_FEATURE_TRIVIAL_HELP
995 "\n\nNetcat opens a pipe to IP:PORT\n"
996 "Options:\n"
997 "\t-l\tListen on the socket.\n"
998 "\t-p PORT\tBind the local port to PORT."
999#endif
1000 ;
1001#endif
1002
1003#if defined BB_NSLOOKUP
1004const char nslookup_usage[] =
1005 "nslookup [HOST]"
1006#ifndef BB_FEATURE_TRIVIAL_HELP
1007 "\n\nQueries the nameserver for the IP address of the given HOST"
1008#endif
1009;
1010#endif
1011
1012#if defined BB_PING
1013#if defined BB_FEATURE_SIMPLE_PING
1014const char ping_usage[] =
1015 "ping host"
1016#ifndef BB_FEATURE_TRIVIAL_HELP
1017 "\n\nSend ICMP ECHO_REQUEST packets to network hosts"
1018#endif
1019 ;
1020#else /* ! defined BB_FEATURE_SIMPLE_PING */
1021const char ping_usage[] =
1022 "ping [OPTION]... host"
1023#ifndef BB_FEATURE_TRIVIAL_HELP
1024 "\n\nSend ICMP ECHO_REQUEST packets to network hosts.\n\n"
1025 "Options:\n"
1026 "\t-c COUNT\tSend only COUNT pings.\n"
1027 "\t-s SIZE\t\tSend SIZE data bytes in packets (default=56).\n"
1028 "\t-q\t\tQuiet mode, only displays output at start\n"
1029 "\t\t\tand when finished."
1030#endif
1031 ;
1032#endif
1033#endif
1034
1035#if defined BB_PIVOT_ROOT
1036const char pivot_root_usage[] =
1037 "pivot_root new_root put_old"
1038#ifndef BB_FEATURE_TRIVIAL_HELP
1039 "\n\nMove the current root file system to put_old and make new_root\n"
1040 "the new root file system."
1041#endif
1042 ;
1043#endif
1044
1045#if defined BB_POWEROFF
1046const char poweroff_usage[] =
1047 "poweroff"
1048#ifndef BB_FEATURE_TRIVIAL_HELP
1049 "\n\nHalt the system and request that the kernel shut off the power."
1050#endif
1051 ;
1052#endif
1053
1054#if defined BB_PRINTF
1055const char printf_usage[] =
1056 "printf FORMAT [ARGUMENT...]"
1057#ifndef BB_FEATURE_TRIVIAL_HELP
1058 "\n\nFormats and prints ARGUMENT(s) according to FORMAT,\n"
1059 "Where FORMAT controls the output exactly as in C printf."
1060#endif
1061 ;
1062#endif
1063
1064#if defined BB_PS
1065const char ps_usage[] =
1066 "ps"
1067#ifndef BB_FEATURE_TRIVIAL_HELP
1068 "\n\nReport process status\n"
1069 "\nThis version of ps accepts no options."
1070#endif
1071 ;
1072#endif
1073
1074#if defined BB_PWD
1075const char pwd_usage[] =
1076 "pwd"
1077#ifndef BB_FEATURE_TRIVIAL_HELP
1078 "\n\nPrint the full filename of the current working directory."
1079#endif
1080 ;
1081#endif
1082
1083#if defined BB_RDATE
1084const char rdate_usage[] =
1085 "rdate [OPTION] HOST"
1086#ifndef BB_FEATURE_TRIVIAL_HELP
1087 "\n\nGet and possibly set the system date and time from a remote HOST.\n"
1088 "Options:\n"
1089 "\t-s\tSet the system date and time (default).\n"
1090 "\t-p\tPrint the date and time."
1091#endif
1092 ;
1093#endif
1094
1095#if defined BB_READLINK
1096const char readlink_usage[] =
1097 "readlink"
1098#ifndef BB_FEATURE_TRIVIAL_HELP
1099 "\n\nRead a symbolic link."
1100#endif
1101 ;
1102#endif
1103
1104#if defined BB_REBOOT
1105const char reboot_usage[] =
1106 "reboot"
1107#ifndef BB_FEATURE_TRIVIAL_HELP
1108 "\n\nReboot the system."
1109#endif
1110 ;
1111#endif
1112
1113#if defined BB_RENICE
1114const char renice_usage[] =
1115 "renice priority pid [pid ...]"
1116#ifndef BB_FEATURE_TRIVIAL_HELP
1117 "\n\nChanges priority of running processes. Allowed priorities range\n"
1118 "from 20 (the process runs only when nothing else is running) to 0\n"
1119 "(default priority) to -20 (almost nothing else ever gets to run)."
1120#endif
1121 ;
1122#endif
1123
1124
1125#if defined BB_RESET
1126const char reset_usage[] =
1127 "reset"
1128#ifndef BB_FEATURE_TRIVIAL_HELP
1129 "\n\nResets the screen."
1130#endif
1131 ;
1132#endif
1133
1134#if defined BB_RM
1135const char rm_usage[] =
1136 "rm [OPTION]... FILE..."
1137#ifndef BB_FEATURE_TRIVIAL_HELP
1138 "\n\nRemove (unlink) the FILE(s). You may use '--' to\n"
1139 "indicate that all following arguments are non-options.\n\n"
1140 "Options:\n"
1141 "\t-f\t\tremove existing destinations, never prompt\n"
1142 "\t-r or -R\tremove the contents of directories recursively"
1143#endif
1144 ;
1145#endif
1146
1147#if defined BB_RMDIR
1148const char rmdir_usage[] =
1149 "rmdir [OPTION]... DIRECTORY..."
1150#ifndef BB_FEATURE_TRIVIAL_HELP
1151 "\n\nRemove the DIRECTORY(ies), if they are empty."
1152#endif
1153 ;
1154#endif
1155
1156#if defined BB_RMMOD
1157const char rmmod_usage[] =
1158 "rmmod [OPTION]... [MODULE]..."
1159#ifndef BB_FEATURE_TRIVIAL_HELP
1160 "\n\nUnloads the specified kernel modules from the kernel.\n\n"
1161 "Options:\n"
1162 "\t-a\tTry to remove all unused kernel modules."
1163#endif
1164 ;
1165#endif
1166
1167#if defined BB_ROUTE
1168const char route_usage[] =
1169 "route [{add|del|flush}]"
1170#ifndef BB_FEATURE_TRIVIAL_HELP
1171 "\n\nEdit the kernel's routing tables"
1172#endif
1173 ;
1174#endif
1175
1176#if defined BB_RPMUNPACK
1177const char rpmunpack_usage[] =
1178 "rpmunpack < package.rpm | gunzip | cpio -idmuv"
1179#ifndef BB_FEATURE_TRIVIAL_HELP
1180 "\n\nExtracts an rpm archive."
1181#endif
1182 ;
1183#endif
1184
1185#if defined BB_SED
1186const char sed_usage[] =
1187 "sed [-Vhnef] pattern [files...]"
1188#ifndef BB_FEATURE_TRIVIAL_HELP
1189 "\n\n"
1190 "-n\t\tsuppress automatic printing of pattern space\n"
1191 "-e script\tadd the script to the commands to be executed\n"
1192 "-f scriptfile\tadd the contents of script-file to the commands to be executed\n"
1193 "-h\t\tdisplay this help message\n"
1194 "\n"
1195 "If no -e or -f is given, the first non-option argument is taken as the\n"
1196 "sed script to interpret. All remaining arguments are names of input\n"
1197 "files; if no input files are specified, then the standard input is read."
1198#endif
1199 ;
1200#endif
1201
1202#if defined BB_SETKEYCODES
1203const char setkeycodes_usage[] =
1204 "setkeycodes SCANCODE KEYCODE ..."
1205#ifndef BB_FEATURE_TRIVIAL_HELP
1206 "\n\nSet entries into the kernel's scancode-to-keycode map,\n"
1207 "allowing unusual keyboards to generate usable keycodes.\n\n"
1208 "SCANCODE may be either xx or e0xx (hexadecimal),\n"
1209 "and KEYCODE is given in decimal"
1210#endif
1211 ;
1212#endif
1213
1214#if defined BB_SH
1215const char shell_usage[] =
1216 "sh [FILE]...\n"
1217 " or: sh -c command [args]..."
1218#ifndef BB_FEATURE_TRIVIAL_HELP
1219 "\n\nlash: The BusyBox command interpreter (shell)."
1220#endif
1221 ;
1222#endif
1223
1224#if defined BB_SLEEP
1225const char sleep_usage[] =
1226 "sleep N"
1227#ifndef BB_FEATURE_TRIVIAL_HELP
1228 "\n\nPause for N seconds."
1229#endif
1230 ;
1231#endif
1232
1233#if defined BB_SORT
1234const char sort_usage[] =
1235 "sort [-n]"
1236#ifdef BB_FEATURE_SORT_REVERSE
1237 " [-r]"
1238#endif
1239 " [FILE]..."
1240#ifndef BB_FEATURE_TRIVIAL_HELP
1241 "\n\nSorts lines of text in the specified files"
1242#endif
1243 ;
1244#endif
1245
1246#if defined BB_STTY
1247const char stty_usage[] =
1248 "stty [-a|g] [-F device] [SETTING]..."
1249#ifndef BB_FEATURE_TRIVIAL_HELP
1250 "\n\nWithout arguments, prints baud rate, line discipline,"
1251 "\nand deviations from stty sane."
1252 "\n -F device open and use the specified device instead of stdin"
1253 "\n -a print all current settings in human-readable form. Or"
1254 "\n -g print in a stty-readable form"
1255 "\n [SETTING] see in documentation"
1256#endif
1257 ;
1258#endif
1259
1260#if defined BB_SWAPONOFF
1261const char swapoff_usage[] =
1262 "swapoff [OPTION] [device]"
1263#ifndef BB_FEATURE_TRIVIAL_HELP
1264 "\n\nStop swapping virtual memory pages on the given device.\n\n"
1265 "Options:\n"
1266 "\t-a\tStop swapping on all swap devices"
1267#endif
1268 ;
1269#endif
1270
1271#if defined BB_SWAPONOFF
1272const char swapon_usage[] =
1273 "swapon [OPTION] [device]"
1274#ifndef BB_FEATURE_TRIVIAL_HELP
1275 "\n\nStart swapping virtual memory pages on the given device.\n\n"
1276 "Options:\n"
1277 "\t-a\tStart swapping on all swap devices"
1278#endif
1279 ;
1280#endif
1281
1282#if defined BB_SYNC
1283const char sync_usage[] =
1284 "sync"
1285#ifndef BB_FEATURE_TRIVIAL_HELP
1286 "\n\nWrite all buffered filesystem blocks to disk."
1287#endif
1288 ;
1289#endif
1290
1291#if defined BB_SYSLOGD
1292const char syslogd_usage[] =
1293 "syslogd [OPTION]..."
1294#ifndef BB_FEATURE_TRIVIAL_HELP
1295 "\n\nLinux system and kernel (provides klogd) logging utility.\n"
1296 "Note that this version of syslogd/klogd ignores /etc/syslog.conf.\n\n"
1297 "Options:\n"
1298 "\t-m NUM\t\tInterval between MARK lines (default=20min, 0=off)\n"
1299 "\t-n\t\tRun as a foreground process\n"
1300#ifdef BB_FEATURE_KLOGD
1301 "\t-K\t\tDo not start up the klogd process\n"
1302#endif
1303 "\t-O FILE\t\tUse an alternate log file (default=/var/log/messages)"
1304#ifdef BB_FEATURE_REMOTE_LOG
1305 "\n\t-R HOST[:PORT]\t\tLog remotely to IP or hostname on PORT (default PORT=514/UDP)\n"
1306 "\t-L\t\tLog locally as well as network logging (default is network only)"
1307#endif
1308#endif
1309 ;
1310#endif
1311
1312#if defined BB_TAIL
1313const char tail_usage[] =
1314 "tail [OPTION]... [FILE]..."
1315#ifndef BB_FEATURE_TRIVIAL_HELP
1316 "\n\nPrint last 10 lines of each FILE to standard output.\n"
1317 "With more than one FILE, precede each with a header giving the\n"
1318 "file name. With no FILE, or when FILE is -, read standard input.\n\n"
1319 "Options:\n"
1320#ifndef BB_FEATURE_SIMPLE_TAIL
1321 "\t-c N[kbm]\toutput the last N bytes\n"
1322#endif
1323 "\t-n N[kbm]\tprint last N lines instead of last 10\n"
1324 "\t-f\t\toutput data as the file grows"
1325#ifndef BB_FEATURE_SIMPLE_TAIL
1326 "\n\t-q\t\tnever output headers giving file names\n"
1327 "\t-s SEC\t\twait SEC seconds between reads with -f\n"
1328 "\t-v\t\talways output headers giving file names\n\n"
1329 "If the first character of N (bytes or lines) is a `+', output begins with \n"
1330 "the Nth item from the start of each file, otherwise, print the last N items\n"
1331 "in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2)."
1332//#else
1333// "\nIf the first character of N (bytes or lines) is a `+', output begins with \n"
1334// "the Nth item from the start of each file."
1335#endif
1336#endif
1337 ;
1338#endif
1339
1340#if defined BB_TAR
1341const char tar_usage[] =
1342#ifdef BB_FEATURE_TAR_CREATE
1343 "tar -[cxtvO] "
1344#else
1345 "tar -[xtvO] "
1346#endif
1347#if defined BB_FEATURE_TAR_EXCLUDE
1348 "[--exclude File] "
1349 "[-X File]"
1350#endif
1351 "[-f tarFile] [FILE(s)] ..."
1352#ifndef BB_FEATURE_TRIVIAL_HELP
1353 "\n\nCreate, extract, or list files from a tar file.\n\n"
1354 "Main operation mode:\n"
1355#ifdef BB_FEATURE_TAR_CREATE
1356 "\tc\t\tcreate\n"
1357#endif
1358 "\tx\t\textract\n"
1359 "\tt\t\tlist\n"
1360 "\nFile selection:\n"
1361 "\tf\t\tname of tarfile or \"-\" for stdin\n"
1362 "\tO\t\textract to stdout\n"
1363#if defined BB_FEATURE_TAR_EXCLUDE
1364 "\texclude\t\tfile to exclude\n"
1365 "\tX\t\tfile with names to exclude\n"
1366#endif
1367 "\nInformative output:\n"
1368 "\tv\t\tverbosely list files processed"
1369#endif
1370 ;
1371#endif
1372
1373#if defined BB_TEE
1374const char tee_usage[] =
1375 "tee [OPTION]... [FILE]..."
1376#ifndef BB_FEATURE_TRIVIAL_HELP
1377 "\n\nCopy standard input to each FILE, and also to standard output.\n\n"
1378 "Options:\n" "\t-a\tappend to the given FILEs, do not overwrite"
1379#endif
1380 ;
1381#endif
1382
1383#if defined BB_TELNET
1384const char telnet_usage[] =
1385 "telnet host [port]"
1386#ifndef BB_FEATURE_TRIVIAL_HELP
1387 "\n\nTelnet is used to establish interactive communication with another\n"
1388 "computer over a network using the TELNET protocol."
1389#endif
1390 ;
1391#endif
1392
1393#if defined BB_TEST
1394const char test_usage[] =
1395 "test EXPRESSION\n"
1396 "or [ EXPRESSION ]"
1397#ifndef BB_FEATURE_TRIVIAL_HELP
1398 "\n\nChecks file types and compares values returning an exit\n"
1399 "code determined by the value of EXPRESSION."
1400#endif
1401 ;
1402#endif
1403
1404#if defined BB_TOUCH
1405const char touch_usage[] =
1406 "touch [-c] file [file ...]"
1407#ifndef BB_FEATURE_TRIVIAL_HELP
1408 "\n\nUpdate the last-modified date on the given file[s].\n\n"
1409 "Options:\n"
1410 "\t-c\tDo not create any files"
1411#endif
1412 ;
1413#endif
1414
1415#if defined BB_TR
1416const char tr_usage[] =
1417 "tr [-cds] STRING1 [STRING2]"
1418#ifndef BB_FEATURE_TRIVIAL_HELP
1419 "\n\nTranslate, squeeze, and/or delete characters from\n"
1420 "standard input, writing to standard output.\n\n"
1421 "Options:\n"
1422 "\t-c\ttake complement of STRING1\n"
1423 "\t-d\tdelete input characters coded STRING1\n"
1424 "\t-s\tsqueeze multiple output characters of STRING2 into one character"
1425#endif
1426 ;
1427#endif
1428
1429#if defined BB_TRUE_FALSE
1430const char true_usage[] =
1431 "true"
1432#ifndef BB_FEATURE_TRIVIAL_HELP
1433 "\n\nReturn an exit code of TRUE (0)."
1434#endif
1435 ;
1436#endif
1437
1438#if defined BB_TTY
1439const char tty_usage[] =
1440 "tty"
1441#ifndef BB_FEATURE_TRIVIAL_HELP
1442 "\n\nPrint the file name of the terminal connected to standard input.\n\n"
1443 "Options:\n"
1444 "\t-s\tprint nothing, only return an exit status"
1445#endif
1446 ;
1447#endif
1448
1449#if defined BB_UMOUNT
1450const char umount_usage[] =
1451 "umount [flags] filesystem|directory"
1452#ifndef BB_FEATURE_TRIVIAL_HELP
1453 "\nUnmount file systems\n"
1454 "\nFlags:\n" "\t-a:\tUnmount all file systems"
1455#ifdef BB_MTAB
1456 " in /etc/mtab\n\t-n:\tDon't erase /etc/mtab entries\n"
1457#else
1458 "\n"
1459#endif
1460 "\t-r:\tTry to remount devices as read-only if mount is busy"
1461#if defined BB_FEATURE_MOUNT_FORCE
1462 "\n\t-f:\tForce filesystem umount (i.e. unreachable NFS server)"
1463#endif
1464#if defined BB_FEATURE_MOUNT_LOOP
1465 "\n\t-l:\tDo not free loop device (if a loop device has been used)"
1466#endif
1467#endif
1468 ;
1469#endif
1470
1471#if defined BB_UNAME
1472const char uname_usage[] =
1473 "uname [OPTION]..."
1474#ifndef BB_FEATURE_TRIVIAL_HELP
1475 "\n\nPrint certain system information. With no OPTION, same as -s.\n\n"
1476 "Options:\n"
1477 "\t-a\tprint all information\n"
1478 "\t-m\tthe machine (hardware) type\n"
1479 "\t-n\tprint the machine's network node hostname\n"
1480 "\t-r\tprint the operating system release\n"
1481 "\t-s\tprint the operating system name\n"
1482
1483 "\t-p\tprint the host processor type\n"
1484 "\t-v\tprint the operating system version"
1485#endif
1486 ;
1487#endif
1488
1489#if defined BB_UNIQ
1490const char uniq_usage[] =
1491 "uniq [OPTION]... [INPUT [OUTPUT]]"
1492#ifndef BB_FEATURE_TRIVIAL_HELP
1493 "\n\nDiscard all but one of successive identical lines from INPUT\n"
1494 "(or standard input), writing to OUTPUT (or standard output).\n"
1495 "Options:\n"
1496 "\t-c\tprefix lines by the number of occurrences\n"
1497 "\t-d\tonly print duplicate lines\n"
1498 "\t-u\tonly print unique lines"
1499#endif
1500 ;
1501#endif
1502
1503#if defined BB_UNIX2DOS
1504const char unix2dos_usage[] =
1505 "unix2dos < unixfile > dosfile"
1506#ifndef BB_FEATURE_TRIVIAL_HELP
1507 "\n\nConverts a text file from unix format to dos format."
1508#endif
1509 ;
1510#endif
1511
1512#if defined BB_UPDATE
1513const char update_usage[] =
1514 "update [options]"
1515#ifndef BB_FEATURE_TRIVIAL_HELP
1516 "\n\nPeriodically flushes filesystem buffers.\n\n"
1517 "Options:\n"
1518 "\t-S\tforce use of sync(2) instead of flushing\n"
1519 "\t-s SECS\tcall sync this often (default 30)\n"
1520 "\t-f SECS\tflush some buffers this often (default 5)"
1521#endif
1522 ;
1523#endif
1524
1525#if defined BB_UPTIME
1526const char uptime_usage[] =
1527 "uptime"
1528#ifndef BB_FEATURE_TRIVIAL_HELP
1529 "\n\nDisplay the time since the last boot."
1530#endif
1531 ;
1532#endif
1533
1534#if defined BB_USLEEP
1535const char usleep_usage[] =
1536 "usleep N"
1537#ifndef BB_FEATURE_TRIVIAL_HELP
1538 "\n\nPause for N microseconds."
1539#endif
1540 ;
1541#endif
1542
1543#if defined BB_UUDECODE
1544const char uudecode_usage[] =
1545 "uudecode [FILE]..."
1546#ifndef BB_FEATURE_TRIVIAL_HELP
1547 "\n\nUudecode a file that is uuencoded.\n\n"
1548 "Options:\n"
1549 "\t-o FILE\tdirect output to FILE"
1550#endif
1551 ;
1552#endif
1553
1554#if defined BB_UUENCODE
1555const char uuencode_usage[] =
1556 "uuencode [OPTION] [INFILE] REMOTEFILE"
1557#ifndef BB_FEATURE_TRIVIAL_HELP
1558 "\n\nUuencode a file.\n\n"
1559 "Options:\n"
1560 "\t-m\tuse base64 encoding as of RFC1521"
1561#endif
1562 ;
1563#endif
1564
1565#if defined BB_WATCHDOG
1566const char watchdog_usage[] =
1567 "watchdog dev\n"
1568#ifndef BB_FEATURE_TRIVIAL_HELP
1569 "\nPeriodically write to watchdog device \"dev\".\n"
1570#endif
1571 ;
1572#endif
1573
1574#if defined BB_WC
1575const char wc_usage[] =
1576 "wc [OPTION]... [FILE]..."
1577#ifndef BB_FEATURE_TRIVIAL_HELP
1578 "\n\nPrint line, word, and byte counts for each FILE, and a total line if\n"
1579 "more than one FILE is specified. With no FILE, read standard input.\n\n"
1580 "Options:\n"
1581 "\t-c\tprint the byte counts\n"
1582 "\t-l\tprint the newline counts\n"
1583
1584 "\t-L\tprint the length of the longest line\n"
1585 "\t-w\tprint the word counts"
1586#endif
1587 ;
1588#endif
1589
1590#if defined BB_WGET
1591const char wget_usage[] = "wget [-c] [-O file] url"
1592#ifndef BB_FEATURE_TRIVIAL_HELP
1593 "\n\nwget retrieves files via HTTP\n\n"
1594 "Options:\n"
1595 "\t-c\tcontinue retrieval of aborted transfers\n"
1596 "\t-O\tsave to filename ('-' for stdout)"
1597#endif
1598 ;
1599#endif
1600
1601#if defined BB_WHICH
1602const char which_usage[] =
1603 "which [COMMAND ...]"
1604#ifndef BB_FEATURE_TRIVIAL_HELP
1605 "\n\nLocates a COMMAND."
1606#endif
1607 ;
1608#endif
1609
1610#if defined BB_WHOAMI
1611const char whoami_usage[] =
1612 "whoami"
1613#ifndef BB_FEATURE_TRIVIAL_HELP
1614 "\n\nPrints the user name associated with the current effective user id."
1615#endif
1616 ;
1617#endif
1618
1619#if defined BB_XARGS
1620const char xargs_usage[] = "xargs [COMMAND] [ARGS...]"
1621#ifndef BB_FEATURE_TRIVIAL_HELP
1622 "\n\nExecutes COMMAND on every item given by standard input."
1623#endif
1624 ;
1625#endif
1626
1627#if defined BB_YES
1628const char yes_usage[] =
1629 "yes [OPTION]... [STRING]..."
1630#ifndef BB_FEATURE_TRIVIAL_HELP
1631 "\n\nRepeatedly outputs a line with all specified STRING(s), or `y'."
1632#endif
1633 ;
1634#endif
1635
diff --git a/ar.c b/ar.c
index 7a5169e95..59f51815f 100644
--- a/ar.c
+++ b/ar.c
@@ -163,13 +163,13 @@ extern int ar_main(int argc, char **argv)
163 funct |= extract_to_file; 163 funct |= extract_to_file;
164 break; 164 break;
165 default: 165 default:
166 usage(ar_usage); 166 show_usage();
167 } 167 }
168 } 168 }
169 169
170 /* check the src filename was specified */ 170 /* check the src filename was specified */
171 if (optind == argc) 171 if (optind == argc)
172 usage(ar_usage); 172 show_usage();
173 173
174 if ( (srcFd = open(argv[optind], O_RDONLY)) < 0) 174 if ( (srcFd = open(argv[optind], O_RDONLY)) < 0)
175 error_msg_and_die("Cannot read %s", argv[optind]); 175 error_msg_and_die("Cannot read %s", argv[optind]);
diff --git a/archival/ar.c b/archival/ar.c
index 7a5169e95..59f51815f 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -163,13 +163,13 @@ extern int ar_main(int argc, char **argv)
163 funct |= extract_to_file; 163 funct |= extract_to_file;
164 break; 164 break;
165 default: 165 default:
166 usage(ar_usage); 166 show_usage();
167 } 167 }
168 } 168 }
169 169
170 /* check the src filename was specified */ 170 /* check the src filename was specified */
171 if (optind == argc) 171 if (optind == argc)
172 usage(ar_usage); 172 show_usage();
173 173
174 if ( (srcFd = open(argv[optind], O_RDONLY)) < 0) 174 if ( (srcFd = open(argv[optind], O_RDONLY)) < 0)
175 error_msg_and_die("Cannot read %s", argv[optind]); 175 error_msg_and_die("Cannot read %s", argv[optind]);
diff --git a/archival/dpkg.c b/archival/dpkg.c
index 4a5c6f4da..6e309eb06 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -840,7 +840,7 @@ extern int dpkg_main(int argc, char **argv)
840 case 'c': 840 case 'c':
841 return dpkg_configure(packages, status); 841 return dpkg_configure(packages, status);
842 default : 842 default :
843 usage(dpkg_usage); 843 show_usage();
844 return EXIT_FAILURE; 844 return EXIT_FAILURE;
845 } 845 }
846} \ No newline at end of file 846}
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index aed0ba368..c08438189 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -141,14 +141,12 @@ extern int dpkg_deb_main(int argc, char **argv)
141 break; 141 break;
142*/ 142*/
143 default: 143 default:
144 usage(dpkg_deb_usage); 144 show_usage();
145 return EXIT_FAILURE;
146 } 145 }
147 } 146 }
148 147
149 if (((optind + 1 ) > argc) || (optflag == 0)) { 148 if (((optind + 1 ) > argc) || (optflag == 0)) {
150 usage(dpkg_deb_usage); 149 show_usage();
151 return(EXIT_FAILURE);
152 } 150 }
153 if ((optflag & dpkg_deb_control) || (optflag & dpkg_deb_extract) || (optflag & dpkg_deb_verbose_extract)) { 151 if ((optflag & dpkg_deb_control) || (optflag & dpkg_deb_extract) || (optflag & dpkg_deb_verbose_extract)) {
154 if ( (optind + 1) == argc ) { 152 if ( (optind + 1) == argc ) {
diff --git a/archival/gunzip.c b/archival/gunzip.c
index 48a46083b..bf8812dbd 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -1250,7 +1250,7 @@ int gunzip_main(int argc, char **argv)
1250 force = 1; 1250 force = 1;
1251 break; 1251 break;
1252 default: 1252 default:
1253 usage(gunzip_usage); 1253 show_usage();
1254 } 1254 }
1255 } 1255 }
1256 } 1256 }
@@ -1275,7 +1275,7 @@ int gunzip_main(int argc, char **argv)
1275 } else { 1275 } else {
1276 /* Open up the input file */ 1276 /* Open up the input file */
1277 if (argc <= 0) 1277 if (argc <= 0)
1278 usage(gunzip_usage); 1278 show_usage();
1279 if (strlen(*argv) > MAX_PATH_LEN) { 1279 if (strlen(*argv) > MAX_PATH_LEN) {
1280 error_msg(name_too_long); 1280 error_msg(name_too_long);
1281 exit(WARNING); 1281 exit(WARNING);
diff --git a/archival/gzip.c b/archival/gzip.c
index 75f3caa35..3cbef4ec1 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -1812,7 +1812,7 @@ int gzip_main(int argc, char **argv)
1812 case 'd': 1812 case 'd':
1813 exit(gunzip_main(argc, argv)); 1813 exit(gunzip_main(argc, argv));
1814 default: 1814 default:
1815 usage(gzip_usage); 1815 show_usage();
1816 } 1816 }
1817 } 1817 }
1818 } 1818 }
@@ -1865,7 +1865,7 @@ int gzip_main(int argc, char **argv)
1865 } else { 1865 } else {
1866 /* Open up the input file */ 1866 /* Open up the input file */
1867 if (argc <= 0) 1867 if (argc <= 0)
1868 usage(gzip_usage); 1868 show_usage();
1869 strncpy(ifname, *argv, MAX_PATH_LEN); 1869 strncpy(ifname, *argv, MAX_PATH_LEN);
1870 1870
1871 /* Open input file */ 1871 /* Open input file */
diff --git a/archival/tar.c b/archival/tar.c
index fb0fcc614..62f1b1d35 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -214,7 +214,7 @@ extern int tar_main(int argc, char **argv)
214 int opt; 214 int opt;
215 215
216 if (argc <= 1) 216 if (argc <= 1)
217 usage(tar_usage); 217 show_usage();
218 218
219 if (argv[1][0] != '-') { 219 if (argv[1][0] != '-') {
220 char *tmp = xmalloc(strlen(argv[1]) + 2); 220 char *tmp = xmalloc(strlen(argv[1]) + 2);
@@ -283,7 +283,7 @@ extern int tar_main(int argc, char **argv)
283 break; 283 break;
284#endif 284#endif
285 default: 285 default:
286 usage(tar_usage); 286 show_usage();
287 } 287 }
288 } 288 }
289 289
diff --git a/basename.c b/basename.c
index cba003d70..da59a8672 100644
--- a/basename.c
+++ b/basename.c
@@ -31,7 +31,7 @@ extern int basename_main(int argc, char **argv)
31 char *s; 31 char *s;
32 32
33 if ((argc < 2) || (**(argv + 1) == '-')) { 33 if ((argc < 2) || (**(argv + 1) == '-')) {
34 usage(basename_usage); 34 show_usage();
35 } 35 }
36 36
37 argv++; 37 argv++;
diff --git a/busybox.c b/busybox.c
index 1409efa54..6c1070fc8 100644
--- a/busybox.c
+++ b/busybox.c
@@ -87,7 +87,6 @@ static void install_links(const char *busybox, int use_symbolic_links)
87 87
88int main(int argc, char **argv) 88int main(int argc, char **argv)
89{ 89{
90 struct BB_applet *applet;
91 const char *s; 90 const char *s;
92 91
93 for (s = applet_name = argv[0]; *s != '\0';) { 92 for (s = applet_name = argv[0]; *s != '\0';) {
@@ -103,13 +102,7 @@ int main(int argc, char **argv)
103 } 102 }
104#endif 103#endif
105 104
106 /* Do a binary search to find the applet entry given the name. */ 105 run_applet_by_name(applet_name, argc, argv);
107 if ((applet = find_applet_by_name(applet_name)) != NULL) {
108 if (applet->usage && argv[1] && strcmp(argv[1], "--help") == 0)
109 usage(applet->usage);
110 exit((*(applet->main)) (argc, argv));
111 }
112
113 error_msg_and_die("applet not found"); 106 error_msg_and_die("applet not found");
114} 107}
115 108
diff --git a/busybox.h b/busybox.h
index 39580b548..aef537b2b 100644
--- a/busybox.h
+++ b/busybox.h
@@ -72,7 +72,7 @@ struct BB_applet {
72 const char* name; 72 const char* name;
73 int (*main)(int argc, char** argv); 73 int (*main)(int argc, char** argv);
74 enum Location location; 74 enum Location location;
75 const char* usage; 75 int usage_index;
76}; 76};
77/* From busybox.c */ 77/* From busybox.c */
78extern const struct BB_applet applets[]; 78extern const struct BB_applet applets[];
@@ -87,9 +87,15 @@ extern const struct BB_applet applets[];
87#include "applets.h" 87#include "applets.h"
88#undef PROTOTYPES 88#undef PROTOTYPES
89 89
90#define APPLET_ENUM
91enum APPLET_INDEX_NUMBERS {
92#include "applets.h"
93};
94#undef APPLET_ENUM
95
90extern const char *applet_name; 96extern const char *applet_name;
91 97
92extern void usage(const char *usage) __attribute__ ((noreturn)); 98extern void show_usage(void) __attribute__ ((noreturn));
93extern void error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); 99extern void error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
94extern void error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); 100extern void error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
95extern void perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); 101extern void perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
@@ -153,6 +159,7 @@ extern FILE *wfopen(const char *path, const char *mode);
153extern FILE *xfopen(const char *path, const char *mode); 159extern FILE *xfopen(const char *path, const char *mode);
154extern void chomp(char *s); 160extern void chomp(char *s);
155extern struct BB_applet *find_applet_by_name(const char *name); 161extern struct BB_applet *find_applet_by_name(const char *name);
162void run_applet_by_name(const char *name, int argc, char **argv);
156 163
157#ifndef DMALLOC 164#ifndef DMALLOC
158extern void *xmalloc (size_t size); 165extern void *xmalloc (size_t size);
diff --git a/chmod_chown_chgrp.c b/chmod_chown_chgrp.c
index 81db10151..9363bd757 100644
--- a/chmod_chown_chgrp.c
+++ b/chmod_chown_chgrp.c
@@ -81,17 +81,13 @@ int chmod_chown_chgrp_main(int argc, char **argv)
81 int recursiveFlag = FALSE; 81 int recursiveFlag = FALSE;
82 char *groupName=NULL; 82 char *groupName=NULL;
83 char *p=NULL; 83 char *p=NULL;
84 const char *appUsage;
85 84
86 whichApp = (applet_name[2]=='o')? /* chown */ 85 whichApp = (applet_name[2]=='o')? /* chown */
87 CHOWN_APP : (applet_name[2]=='m')? /* chmod */ 86 CHOWN_APP : (applet_name[2]=='m')? /* chmod */
88 CHMOD_APP : CHGRP_APP; 87 CHMOD_APP : CHGRP_APP;
89 88
90 appUsage = (whichApp == CHOWN_APP)?
91 chown_usage : (whichApp == CHMOD_APP) ? chmod_usage : chgrp_usage;
92
93 if (argc < 2) 89 if (argc < 2)
94 usage(appUsage); 90 show_usage();
95 argv++; 91 argv++;
96 92
97 /* Parse options */ 93 /* Parse options */
diff --git a/chroot.c b/chroot.c
index cd8101e47..e721e1ffa 100644
--- a/chroot.c
+++ b/chroot.c
@@ -33,7 +33,7 @@ int chroot_main(int argc, char **argv)
33 char *prog; 33 char *prog;
34 34
35 if ((argc < 2) || (**(argv + 1) == '-')) { 35 if ((argc < 2) || (**(argv + 1) == '-')) {
36 usage(chroot_usage); 36 show_usage();
37 } 37 }
38 argc--; 38 argc--;
39 argv++; 39 argv++;
diff --git a/chvt.c b/chvt.c
index c715e67de..f2e6d5f17 100644
--- a/chvt.c
+++ b/chvt.c
@@ -20,7 +20,7 @@ int chvt_main(int argc, char **argv)
20 int fd, num; 20 int fd, num;
21 21
22 if ((argc != 2) || (**(argv + 1) == '-')) 22 if ((argc != 2) || (**(argv + 1) == '-'))
23 usage (chvt_usage); 23 show_usage();
24 fd = get_console_fd("/dev/console"); 24 fd = get_console_fd("/dev/console");
25 num = atoi(argv[1]); 25 num = atoi(argv[1]);
26 if (ioctl(fd, VT_ACTIVATE, num)) 26 if (ioctl(fd, VT_ACTIVATE, num))
diff --git a/cmp.c b/cmp.c
index dd70261df..c04b6e1c9 100644
--- a/cmp.c
+++ b/cmp.c
@@ -36,7 +36,7 @@ int cmp_main(int argc, char **argv)
36 36
37 /* parse argv[] */ 37 /* parse argv[] */
38 if (argc < 2 || 3 < argc) 38 if (argc < 2 || 3 < argc)
39 usage(cmp_usage); 39 show_usage();
40 40
41 fp1 = xfopen(argv[1], "r"); 41 fp1 = xfopen(argv[1], "r");
42 if (argv[2] != NULL) { 42 if (argv[2] != NULL) {
diff --git a/console-tools/chvt.c b/console-tools/chvt.c
index c715e67de..f2e6d5f17 100644
--- a/console-tools/chvt.c
+++ b/console-tools/chvt.c
@@ -20,7 +20,7 @@ int chvt_main(int argc, char **argv)
20 int fd, num; 20 int fd, num;
21 21
22 if ((argc != 2) || (**(argv + 1) == '-')) 22 if ((argc != 2) || (**(argv + 1) == '-'))
23 usage (chvt_usage); 23 show_usage();
24 fd = get_console_fd("/dev/console"); 24 fd = get_console_fd("/dev/console");
25 num = atoi(argv[1]); 25 num = atoi(argv[1]);
26 if (ioctl(fd, VT_ACTIVATE, num)) 26 if (ioctl(fd, VT_ACTIVATE, num))
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c
index b51fbaef4..8c390c261 100644
--- a/console-tools/deallocvt.c
+++ b/console-tools/deallocvt.c
@@ -19,7 +19,7 @@ int deallocvt_main(int argc, char *argv[])
19 19
20 //if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-'))) 20 //if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-')))
21 if (argc > 2) 21 if (argc > 2)
22 usage(deallocvt_usage); 22 show_usage();
23 23
24 fd = get_console_fd("/dev/console"); 24 fd = get_console_fd("/dev/console");
25 25
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c
index 4ab711e55..b9f1bd233 100644
--- a/console-tools/dumpkmap.c
+++ b/console-tools/dumpkmap.c
@@ -48,7 +48,7 @@ int dumpkmap_main(int argc, char **argv)
48 char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap"; 48 char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap";
49 49
50 if (argc>=2 && *argv[1]=='-') { 50 if (argc>=2 && *argv[1]=='-') {
51 usage(dumpkmap_usage); 51 show_usage();
52 } 52 }
53 53
54 fd = open("/dev/tty0", O_RDWR); 54 fd = open("/dev/tty0", O_RDWR);
diff --git a/console-tools/loadacm.c b/console-tools/loadacm.c
index 345a2773c..6422137a1 100644
--- a/console-tools/loadacm.c
+++ b/console-tools/loadacm.c
@@ -34,7 +34,7 @@ int loadacm_main(int argc, char **argv)
34 int fd; 34 int fd;
35 35
36 if (argc>=2 && *argv[1]=='-') { 36 if (argc>=2 && *argv[1]=='-') {
37 usage(loadacm_usage); 37 show_usage();
38 } 38 }
39 39
40 fd = open("/dev/tty", O_RDWR); 40 fd = open("/dev/tty", O_RDWR);
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index ec3e50560..d7bd7e8f5 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -44,7 +44,7 @@ extern int loadfont_main(int argc, char **argv)
44 int fd; 44 int fd;
45 45
46 if (argc != 1) 46 if (argc != 1)
47 usage(loadfont_usage); 47 show_usage();
48 48
49 fd = open("/dev/tty0", O_RDWR); 49 fd = open("/dev/tty0", O_RDWR);
50 if (fd < 0) 50 if (fd < 0)
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c
index a98601aec..5ecd819f9 100644
--- a/console-tools/loadkmap.c
+++ b/console-tools/loadkmap.c
@@ -51,7 +51,7 @@ int loadkmap_main(int argc, char **argv)
51 char flags[MAX_NR_KEYMAPS], buff[7]; 51 char flags[MAX_NR_KEYMAPS], buff[7];
52 52
53 if (argc != 1) 53 if (argc != 1)
54 usage(loadkmap_usage); 54 show_usage();
55 55
56 fd = open("/dev/tty0", O_RDWR); 56 fd = open("/dev/tty0", O_RDWR);
57 if (fd < 0) 57 if (fd < 0)
diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c
index 3e511ad00..0be4724ca 100644
--- a/console-tools/setkeycodes.c
+++ b/console-tools/setkeycodes.c
@@ -43,7 +43,7 @@ setkeycodes_main(int argc, char** argv)
43 struct kbkeycode a; 43 struct kbkeycode a;
44 44
45 if (argc % 2 != 1 || argc < 2) { 45 if (argc % 2 != 1 || argc < 2) {
46 usage(setkeycodes_usage); 46 show_usage();
47 } 47 }
48 48
49 fd = get_console_fd("/dev/console"); 49 fd = get_console_fd("/dev/console");
diff --git a/coreutils/basename.c b/coreutils/basename.c
index cba003d70..da59a8672 100644
--- a/coreutils/basename.c
+++ b/coreutils/basename.c
@@ -31,7 +31,7 @@ extern int basename_main(int argc, char **argv)
31 char *s; 31 char *s;
32 32
33 if ((argc < 2) || (**(argv + 1) == '-')) { 33 if ((argc < 2) || (**(argv + 1) == '-')) {
34 usage(basename_usage); 34 show_usage();
35 } 35 }
36 36
37 argv++; 37 argv++;
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index cd8101e47..e721e1ffa 100644
--- a/coreutils/chroot.c
+++ b/coreutils/chroot.c
@@ -33,7 +33,7 @@ int chroot_main(int argc, char **argv)
33 char *prog; 33 char *prog;
34 34
35 if ((argc < 2) || (**(argv + 1) == '-')) { 35 if ((argc < 2) || (**(argv + 1) == '-')) {
36 usage(chroot_usage); 36 show_usage();
37 } 37 }
38 argc--; 38 argc--;
39 argv++; 39 argv++;
diff --git a/coreutils/cmp.c b/coreutils/cmp.c
index dd70261df..c04b6e1c9 100644
--- a/coreutils/cmp.c
+++ b/coreutils/cmp.c
@@ -36,7 +36,7 @@ int cmp_main(int argc, char **argv)
36 36
37 /* parse argv[] */ 37 /* parse argv[] */
38 if (argc < 2 || 3 < argc) 38 if (argc < 2 || 3 < argc)
39 usage(cmp_usage); 39 show_usage();
40 40
41 fp1 = xfopen(argv[1], "r"); 41 fp1 = xfopen(argv[1], "r");
42 if (argv[2] != NULL) { 42 if (argv[2] != NULL) {
diff --git a/coreutils/date.c b/coreutils/date.c
index 8b6a0620d..21d31bb25 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -151,7 +151,7 @@ int date_main(int argc, char **argv)
151 case 's': 151 case 's':
152 set_time = 1; 152 set_time = 1;
153 if ((date_str != NULL) || ((date_str = optarg) == NULL)) { 153 if ((date_str != NULL) || ((date_str = optarg) == NULL)) {
154 usage(date_usage); 154 show_usage();
155 } 155 }
156 break; 156 break;
157 case 'u': 157 case 'u':
@@ -162,10 +162,10 @@ int date_main(int argc, char **argv)
162 case 'd': 162 case 'd':
163 use_arg = 1; 163 use_arg = 1;
164 if ((date_str != NULL) || ((date_str = optarg) == NULL)) 164 if ((date_str != NULL) || ((date_str = optarg) == NULL))
165 usage(date_usage); 165 show_usage();
166 break; 166 break;
167 default: 167 default:
168 usage(date_usage); 168 show_usage();
169 } 169 }
170 } 170 }
171 171
@@ -178,7 +178,7 @@ int date_main(int argc, char **argv)
178#if 0 178#if 0
179 else { 179 else {
180 error_msg("date_str='%s' date_fmt='%s'\n", date_str, date_fmt); 180 error_msg("date_str='%s' date_fmt='%s'\n", date_str, date_fmt);
181 usage(date_usage); 181 show_usage();
182 } 182 }
183#endif 183#endif
184 184
diff --git a/coreutils/dd.c b/coreutils/dd.c
index 75bbfbac2..e445e0435 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -84,7 +84,7 @@ int dd_main(int argc, char **argv)
84 buf++; 84 buf++;
85 } 85 }
86 } else 86 } else
87 usage(dd_usage); 87 show_usage();
88 } 88 }
89 89
90 buf = xmalloc(bs); 90 buf = xmalloc(bs);
diff --git a/coreutils/df.c b/coreutils/df.c
index 55919793c..8b6726b75 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -143,7 +143,7 @@ extern int df_main(int argc, char **argv)
143 return status; 143 return status;
144 144
145print_df_usage: 145print_df_usage:
146 usage(df_usage); 146 show_usage();
147 return(FALSE); 147 return(FALSE);
148} 148}
149 149
diff --git a/coreutils/dirname.c b/coreutils/dirname.c
index 2e11a69dc..e34ecf8a9 100644
--- a/coreutils/dirname.c
+++ b/coreutils/dirname.c
@@ -30,7 +30,7 @@ extern int dirname_main(int argc, char **argv)
30 char* s; 30 char* s;
31 31
32 if ((argc < 2) || (**(argv + 1) == '-')) 32 if ((argc < 2) || (**(argv + 1) == '-'))
33 usage(dirname_usage); 33 show_usage();
34 argv++; 34 argv++;
35 35
36 s=*argv+strlen(*argv)-1; 36 s=*argv+strlen(*argv)-1;
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c
index 9fd952c31..32423611c 100644
--- a/coreutils/dos2unix.c
+++ b/coreutils/dos2unix.c
@@ -31,7 +31,7 @@ int dos2unix_main( int argc, char **argv ) {
31 if (argc > 1) { 31 if (argc > 1) {
32 c = *argv[1]; 32 c = *argv[1];
33 if (c == '-') { 33 if (c == '-') {
34 usage(dos2unix_usage); 34 show_usage();
35 } 35 }
36 } 36 }
37 c = getchar(); 37 c = getchar();
diff --git a/coreutils/du.c b/coreutils/du.c
index c56afbc4f..516f4c92b 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -163,7 +163,7 @@ int du_main(int argc, char **argv)
163 case 'k': break; 163 case 'k': break;
164#endif 164#endif
165 default: 165 default:
166 usage(du_usage); 166 show_usage();
167 } 167 }
168 } 168 }
169 169
@@ -187,7 +187,7 @@ int du_main(int argc, char **argv)
187 return status; 187 return status;
188} 188}
189 189
190/* $Id: du.c,v 1.36 2001/01/27 09:33:38 andersen Exp $ */ 190/* $Id: du.c,v 1.37 2001/02/14 21:23:05 andersen Exp $ */
191/* 191/*
192Local Variables: 192Local Variables:
193c-file-style: "linux" 193c-file-style: "linux"
diff --git a/coreutils/head.c b/coreutils/head.c
index 7d87f32cb..a2d774437 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -57,7 +57,7 @@ int head_main(int argc, char **argv)
57 break; 57 break;
58 /* fallthrough */ 58 /* fallthrough */
59 default: 59 default:
60 usage(head_usage); 60 show_usage();
61 } 61 }
62 } 62 }
63 63
diff --git a/coreutils/id.c b/coreutils/id.c
index 650e3db20..3667b32b2 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -53,11 +53,11 @@ extern int id_main(int argc, char **argv)
53 name_not_number++; 53 name_not_number++;
54 break; 54 break;
55 default: 55 default:
56 usage(id_usage); 56 show_usage();
57 } 57 }
58 } 58 }
59 59
60 if (no_user && no_group) usage(id_usage); 60 if (no_user && no_group) show_usage();
61 61
62 if (argv[optind] == NULL) { 62 if (argv[optind] == NULL) {
63 if (print_real) { 63 if (print_real) {
diff --git a/coreutils/length.c b/coreutils/length.c
index 1ab4e3a58..9119adca8 100644
--- a/coreutils/length.c
+++ b/coreutils/length.c
@@ -7,7 +7,7 @@
7extern int length_main(int argc, char **argv) 7extern int length_main(int argc, char **argv)
8{ 8{
9 if (argc != 2 || **(argv + 1) == '-') 9 if (argc != 2 || **(argv + 1) == '-')
10 usage(length_usage); 10 show_usage();
11 printf("%lu\n", (long)strlen(argv[1])); 11 printf("%lu\n", (long)strlen(argv[1]));
12 return EXIT_SUCCESS; 12 return EXIT_SUCCESS;
13} 13}
diff --git a/coreutils/ln.c b/coreutils/ln.c
index 54e81f4c5..9dc7f5d8c 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -101,7 +101,7 @@ extern int ln_main(int argc, char **argv)
101 flag |= LN_NODEREFERENCE; 101 flag |= LN_NODEREFERENCE;
102 break; 102 break;
103 default: 103 default:
104 usage(ln_usage); 104 show_usage();
105 } 105 }
106 } 106 }
107 while(optind<(argc-1)) { 107 while(optind<(argc-1)) {
diff --git a/coreutils/logname.c b/coreutils/logname.c
index d9056c69d..a1887aaf9 100644
--- a/coreutils/logname.c
+++ b/coreutils/logname.c
@@ -30,7 +30,7 @@ extern int logname_main(int argc, char **argv)
30 char user[9]; 30 char user[9];
31 31
32 if (argc > 1) 32 if (argc > 1)
33 usage(logname_usage); 33 show_usage();
34 34
35 my_getpwuid(user, geteuid()); 35 my_getpwuid(user, geteuid());
36 if (*user) { 36 if (*user) {
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 42b24456a..06e23e612 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -928,5 +928,5 @@ extern int ls_main(int argc, char **argv)
928 return(status); 928 return(status);
929 929
930 print_usage_message: 930 print_usage_message:
931 usage(ls_usage); 931 show_usage();
932} 932}
diff --git a/coreutils/md5sum.c b/coreutils/md5sum.c
index 97a940059..3decafdf4 100644
--- a/coreutils/md5sum.c
+++ b/coreutils/md5sum.c
@@ -850,7 +850,7 @@ int md5sum_main(int argc,
850 break; 850 break;
851 851
852 default: 852 default:
853 usage(md5sum_usage); 853 show_usage();
854 } 854 }
855 } 855 }
856 856
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index 299f29806..285d34f12 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -48,7 +48,7 @@ extern int mkdir_main(int argc, char **argv)
48 switch (**argv) { 48 switch (**argv) {
49 case 'm': 49 case 'm':
50 if (--argc == 0) 50 if (--argc == 0)
51 usage(mkdir_usage); 51 show_usage();
52 /* Find the specified modes */ 52 /* Find the specified modes */
53 mode = 0; 53 mode = 0;
54 if (parse_mode(*(++argv), &mode) == FALSE) { 54 if (parse_mode(*(++argv), &mode) == FALSE) {
@@ -63,7 +63,7 @@ extern int mkdir_main(int argc, char **argv)
63 parentFlag = TRUE; 63 parentFlag = TRUE;
64 break; 64 break;
65 default: 65 default:
66 usage(mkdir_usage); 66 show_usage();
67 } 67 }
68 } 68 }
69 argc--; 69 argc--;
@@ -71,7 +71,7 @@ extern int mkdir_main(int argc, char **argv)
71 } 71 }
72 72
73 if (argc < 1) { 73 if (argc < 1) {
74 usage(mkdir_usage); 74 show_usage();
75 } 75 }
76 76
77 while (argc > 0) { 77 while (argc > 0) {
diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c
index b31e6f172..56a04f772 100644
--- a/coreutils/mkfifo.c
+++ b/coreutils/mkfifo.c
@@ -37,7 +37,7 @@ extern int mkfifo_main(int argc, char **argv)
37 /* Parse any options */ 37 /* Parse any options */
38 while (argc > 1) { 38 while (argc > 1) {
39 if (**argv != '-') 39 if (**argv != '-')
40 usage(mkfifo_usage); 40 show_usage();
41 thisarg = *argv; 41 thisarg = *argv;
42 thisarg++; 42 thisarg++;
43 switch (*thisarg) { 43 switch (*thisarg) {
@@ -47,13 +47,13 @@ extern int mkfifo_main(int argc, char **argv)
47 parse_mode(*argv, &mode); 47 parse_mode(*argv, &mode);
48 break; 48 break;
49 default: 49 default:
50 usage(mkfifo_usage); 50 show_usage();
51 } 51 }
52 argc--; 52 argc--;
53 argv++; 53 argv++;
54 } 54 }
55 if (argc < 1 || *argv[0] == '-') 55 if (argc < 1 || *argv[0] == '-')
56 usage(mkfifo_usage); 56 show_usage();
57 if (mkfifo(*argv, mode) < 0) 57 if (mkfifo(*argv, mode) < 0)
58 perror_msg_and_die("mkfifo"); 58 perror_msg_and_die("mkfifo");
59 return EXIT_SUCCESS; 59 return EXIT_SUCCESS;
diff --git a/coreutils/mknod.c b/coreutils/mknod.c
index c761aea6f..73f6e06f1 100644
--- a/coreutils/mknod.c
+++ b/coreutils/mknod.c
@@ -53,13 +53,13 @@ int mknod_main(int argc, char **argv)
53 umask(0); 53 umask(0);
54 break; 54 break;
55 default: 55 default:
56 usage(mknod_usage); 56 show_usage();
57 } 57 }
58 argc--; 58 argc--;
59 argv++; 59 argv++;
60 } 60 }
61 if (argc != 4 && argc != 2) { 61 if (argc != 4 && argc != 2) {
62 usage(mknod_usage); 62 show_usage();
63 } 63 }
64 switch (argv[1][0]) { 64 switch (argv[1][0]) {
65 case 'c': 65 case 'c':
@@ -72,11 +72,11 @@ int mknod_main(int argc, char **argv)
72 case 'p': 72 case 'p':
73 mode = S_IFIFO; 73 mode = S_IFIFO;
74 if (argc!=2) { 74 if (argc!=2) {
75 usage(mknod_usage); 75 show_usage();
76 } 76 }
77 break; 77 break;
78 default: 78 default:
79 usage(mknod_usage); 79 show_usage();
80 } 80 }
81 81
82 if (mode == S_IFCHR || mode == S_IFBLK) { 82 if (mode == S_IFCHR || mode == S_IFBLK) {
diff --git a/coreutils/printf.c b/coreutils/printf.c
index 72bc7ae89..26a200e85 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -143,7 +143,7 @@ int printf_main(int argc, char **argv)
143 143
144 exit_status = 0; 144 exit_status = 0;
145 if (argc <= 1 || **(argv + 1) == '-') { 145 if (argc <= 1 || **(argv + 1) == '-') {
146 usage(printf_usage); 146 show_usage();
147 } 147 }
148 148
149 format = argv[1]; 149 format = argv[1];
diff --git a/coreutils/rm.c b/coreutils/rm.c
index ce293a2aa..566076707 100644
--- a/coreutils/rm.c
+++ b/coreutils/rm.c
@@ -84,7 +84,7 @@ extern int rm_main(int argc, char **argv)
84 stopIt = TRUE; 84 stopIt = TRUE;
85 break; 85 break;
86 default: 86 default:
87 usage(rm_usage); 87 show_usage();
88 } 88 }
89 argc--; 89 argc--;
90 argv++; 90 argv++;
@@ -94,7 +94,7 @@ extern int rm_main(int argc, char **argv)
94 } 94 }
95 95
96 if (argc < 1 && forceFlag == FALSE) { 96 if (argc < 1 && forceFlag == FALSE) {
97 usage(rm_usage); 97 show_usage();
98 } 98 }
99 99
100 while (argc-- > 0) { 100 while (argc-- > 0) {
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c
index 86346ddde..6266ce1ef 100644
--- a/coreutils/rmdir.c
+++ b/coreutils/rmdir.c
@@ -33,7 +33,7 @@ extern int rmdir_main(int argc, char **argv)
33 int status = EXIT_SUCCESS; 33 int status = EXIT_SUCCESS;
34 34
35 if (argc == 1 || **(argv + 1) == '-') 35 if (argc == 1 || **(argv + 1) == '-')
36 usage(rmdir_usage); 36 show_usage();
37 37
38 while (--argc > 0) { 38 while (--argc > 0) {
39 if (rmdir(*(++argv)) == -1) { 39 if (rmdir(*(++argv)) == -1) {
diff --git a/coreutils/sleep.c b/coreutils/sleep.c
index 61b7ce404..d21af19b3 100644
--- a/coreutils/sleep.c
+++ b/coreutils/sleep.c
@@ -29,7 +29,7 @@
29extern int sleep_main(int argc, char **argv) 29extern int sleep_main(int argc, char **argv)
30{ 30{
31 if ((argc < 2) || (**(argv + 1) == '-')) { 31 if ((argc < 2) || (**(argv + 1) == '-')) {
32 usage(sleep_usage); 32 show_usage();
33 } 33 }
34 34
35 if (sleep(atoi(*(++argv))) != 0) 35 if (sleep(atoi(*(++argv))) != 0)
diff --git a/coreutils/sort.c b/coreutils/sort.c
index 2aef2d955..4984f5dfe 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -56,7 +56,7 @@ int sort_main(int argc, char **argv)
56 break; 56 break;
57#endif 57#endif
58 default: 58 default:
59 usage(sort_usage); 59 show_usage();
60 } 60 }
61 } 61 }
62 62
diff --git a/coreutils/sync.c b/coreutils/sync.c
index f95c24c6c..fc5a42b8a 100644
--- a/coreutils/sync.c
+++ b/coreutils/sync.c
@@ -28,6 +28,6 @@
28extern int sync_main(int argc, char **argv) 28extern int sync_main(int argc, char **argv)
29{ 29{
30 if (argc > 1 && **(argv + 1) == '-') 30 if (argc > 1 && **(argv + 1) == '-')
31 usage(sync_usage); 31 show_usage();
32 return(sync()); 32 return(sync());
33} 33}
diff --git a/coreutils/tail.c b/coreutils/tail.c
index d45b29c4c..a3b8f6d23 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -103,7 +103,7 @@ int tail_main(int argc, char **argv)
103 break; 103 break;
104#endif 104#endif
105 default: 105 default:
106 usage(tail_usage); 106 show_usage();
107 } 107 }
108 } 108 }
109 109
diff --git a/coreutils/tee.c b/coreutils/tee.c
index aa3098c6a..439cf7dc5 100644
--- a/coreutils/tee.c
+++ b/coreutils/tee.c
@@ -38,7 +38,7 @@ tee_main(int argc, char **argv)
38 mode = "a"; 38 mode = "a";
39 break; 39 break;
40 default: 40 default:
41 usage(tee_usage); 41 show_usage();
42 } 42 }
43 } 43 }
44 44
diff --git a/coreutils/touch.c b/coreutils/touch.c
index e174baa47..a3256d559 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -44,13 +44,13 @@ extern int touch_main(int argc, char **argv)
44 create = FALSE; 44 create = FALSE;
45 break; 45 break;
46 default: 46 default:
47 usage(touch_usage); 47 show_usage();
48 } 48 }
49 } 49 }
50 } 50 }
51 51
52 if (argc < 1) { 52 if (argc < 1) {
53 usage(touch_usage); 53 show_usage();
54 } 54 }
55 55
56 while (argc > 0) { 56 while (argc > 0) {
diff --git a/coreutils/tr.c b/coreutils/tr.c
index 36f29de44..92f399e14 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -170,7 +170,7 @@ extern int tr_main(int argc, char **argv)
170 sq_fl = TRUE; 170 sq_fl = TRUE;
171 break; 171 break;
172 default: 172 default:
173 usage(tr_usage); 173 show_usage();
174 } 174 }
175 } 175 }
176 index++; 176 index++;
diff --git a/coreutils/tty.c b/coreutils/tty.c
index 2a64b149d..d71d8dedb 100644
--- a/coreutils/tty.c
+++ b/coreutils/tty.c
@@ -32,7 +32,7 @@ extern int tty_main(int argc, char **argv)
32 32
33 if (argc > 1) { 33 if (argc > 1) {
34 if (argv[1][0] != '-' || argv[1][1] != 's') 34 if (argv[1][0] != '-' || argv[1][1] != 's')
35 usage(tty_usage); 35 show_usage();
36 } else { 36 } else {
37 tty = ttyname(0); 37 tty = ttyname(0);
38 if (tty) 38 if (tty)
diff --git a/coreutils/uname.c b/coreutils/uname.c
index deaffd700..899da7792 100644
--- a/coreutils/uname.c
+++ b/coreutils/uname.c
@@ -106,7 +106,7 @@ int uname_main(int argc, char **argv)
106 PRINT_MACHINE); 106 PRINT_MACHINE);
107 break; 107 break;
108 default: 108 default:
109 usage(uname_usage); 109 show_usage();
110 } 110 }
111 } 111 }
112 } 112 }
diff --git a/coreutils/usleep.c b/coreutils/usleep.c
index 86dc0501b..c67c365b8 100644
--- a/coreutils/usleep.c
+++ b/coreutils/usleep.c
@@ -28,7 +28,7 @@
28extern int usleep_main(int argc, char **argv) 28extern int usleep_main(int argc, char **argv)
29{ 29{
30 if ((argc < 2) || (**(argv + 1) == '-')) { 30 if ((argc < 2) || (**(argv + 1) == '-')) {
31 usage(usleep_usage); 31 show_usage();
32 } 32 }
33 33
34 usleep(atoi(*(++argv))); /* return void */ 34 usleep(atoi(*(++argv))); /* return void */
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index cccc52872..c0e8cea8c 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -292,7 +292,7 @@ int uudecode_main (int argc,
292 break; 292 break;
293 293
294 default: 294 default:
295 usage(uudecode_usage); 295 show_usage();
296 } 296 }
297 } 297 }
298 298
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c
index 73098ba26..8d5af4a8a 100644
--- a/coreutils/uuencode.c
+++ b/coreutils/uuencode.c
@@ -167,7 +167,7 @@ int uuencode_main (int argc,
167 break; 167 break;
168 168
169 default: 169 default:
170 usage(uuencode_usage); 170 show_usage();
171 } 171 }
172 } 172 }
173 173
@@ -188,7 +188,7 @@ int uuencode_main (int argc,
188 188
189 case 0: 189 case 0:
190 default: 190 default:
191 usage(uuencode_usage); 191 show_usage();
192 } 192 }
193 193
194 printf("begin%s %o %s\n", trans_ptr == uu_std ? "" : "-base64", 194 printf("begin%s %o %s\n", trans_ptr == uu_std ? "" : "-base64",
diff --git a/coreutils/wc.c b/coreutils/wc.c
index 619c161a7..f41687422 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -126,7 +126,7 @@ int wc_main(int argc, char **argv)
126 print_words = 1; 126 print_words = 1;
127 break; 127 break;
128 default: 128 default:
129 usage(wc_usage); 129 show_usage();
130 } 130 }
131 } 131 }
132 132
diff --git a/coreutils/whoami.c b/coreutils/whoami.c
index 398e37315..54df0bf12 100644
--- a/coreutils/whoami.c
+++ b/coreutils/whoami.c
@@ -31,7 +31,7 @@ extern int whoami_main(int argc, char **argv)
31 uid_t uid = geteuid(); 31 uid_t uid = geteuid();
32 32
33 if (argc > 1) 33 if (argc > 1)
34 usage(whoami_usage); 34 show_usage();
35 35
36 my_getpwuid(user, uid); 36 my_getpwuid(user, uid);
37 if (*user) { 37 if (*user) {
diff --git a/coreutils/yes.c b/coreutils/yes.c
index 0ce49499f..0a8ad83a7 100644
--- a/coreutils/yes.c
+++ b/coreutils/yes.c
@@ -29,7 +29,7 @@ extern int yes_main(int argc, char **argv)
29 int i; 29 int i;
30 30
31 if (argc >= 2 && *argv[1] == '-') 31 if (argc >= 2 && *argv[1] == '-')
32 usage(yes_usage); 32 show_usage();
33 33
34 if (argc == 1) { 34 if (argc == 1) {
35 while (1) 35 while (1)
diff --git a/cp_mv.c b/cp_mv.c
index 9c109b511..8052b41a6 100644
--- a/cp_mv.c
+++ b/cp_mv.c
@@ -48,11 +48,6 @@ static const int is_cp = 0;
48static const int is_mv = 1; 48static const int is_mv = 1;
49static int dz_i; /* index into cp_mv_usage */ 49static int dz_i; /* index into cp_mv_usage */
50 50
51static const char *cp_mv_usage[] = /* .rodata */
52{
53 cp_usage,
54 mv_usage
55};
56 51
57static int recursiveFlag; 52static int recursiveFlag;
58static int followLinks; 53static int followLinks;
@@ -184,7 +179,7 @@ extern int cp_mv_main(int argc, char **argv)
184 else 179 else
185 dz_i = is_mv; 180 dz_i = is_mv;
186 if (argc < 3) 181 if (argc < 3)
187 usage(cp_mv_usage[dz_i]); 182 show_usage();
188 183
189 if (dz_i == is_cp) { 184 if (dz_i == is_cp) {
190 recursiveFlag = preserveFlag = forceFlag = FALSE; 185 recursiveFlag = preserveFlag = forceFlag = FALSE;
@@ -209,11 +204,11 @@ extern int cp_mv_main(int argc, char **argv)
209 forceFlag = TRUE; 204 forceFlag = TRUE;
210 break; 205 break;
211 default: 206 default:
212 usage(cp_mv_usage[is_cp]); 207 show_usage();
213 } 208 }
214 } 209 }
215 if ((argc - optind) < 2) { 210 if ((argc - optind) < 2) {
216 usage(cp_mv_usage[dz_i]); 211 show_usage();
217 } 212 }
218 } else { /* (dz_i == is_mv) */ 213 } else { /* (dz_i == is_mv) */
219 /* Initialize optind to 1, since in libc5 optind 214 /* Initialize optind to 1, since in libc5 optind
diff --git a/date.c b/date.c
index 8b6a0620d..21d31bb25 100644
--- a/date.c
+++ b/date.c
@@ -151,7 +151,7 @@ int date_main(int argc, char **argv)
151 case 's': 151 case 's':
152 set_time = 1; 152 set_time = 1;
153 if ((date_str != NULL) || ((date_str = optarg) == NULL)) { 153 if ((date_str != NULL) || ((date_str = optarg) == NULL)) {
154 usage(date_usage); 154 show_usage();
155 } 155 }
156 break; 156 break;
157 case 'u': 157 case 'u':
@@ -162,10 +162,10 @@ int date_main(int argc, char **argv)
162 case 'd': 162 case 'd':
163 use_arg = 1; 163 use_arg = 1;
164 if ((date_str != NULL) || ((date_str = optarg) == NULL)) 164 if ((date_str != NULL) || ((date_str = optarg) == NULL))
165 usage(date_usage); 165 show_usage();
166 break; 166 break;
167 default: 167 default:
168 usage(date_usage); 168 show_usage();
169 } 169 }
170 } 170 }
171 171
@@ -178,7 +178,7 @@ int date_main(int argc, char **argv)
178#if 0 178#if 0
179 else { 179 else {
180 error_msg("date_str='%s' date_fmt='%s'\n", date_str, date_fmt); 180 error_msg("date_str='%s' date_fmt='%s'\n", date_str, date_fmt);
181 usage(date_usage); 181 show_usage();
182 } 182 }
183#endif 183#endif
184 184
diff --git a/dc.c b/dc.c
index 122673a95..1e34574ed 100644
--- a/dc.c
+++ b/dc.c
@@ -169,7 +169,7 @@ int dc_main(int argc, char **argv)
169 } 169 }
170 } else { 170 } else {
171 if (*argv[1]=='-') 171 if (*argv[1]=='-')
172 usage(dc_usage); 172 show_usage();
173 while (argc >= 2) { 173 while (argc >= 2) {
174 stack_machine(argv[1]); 174 stack_machine(argv[1]);
175 argv++; 175 argv++;
diff --git a/dd.c b/dd.c
index 75bbfbac2..e445e0435 100644
--- a/dd.c
+++ b/dd.c
@@ -84,7 +84,7 @@ int dd_main(int argc, char **argv)
84 buf++; 84 buf++;
85 } 85 }
86 } else 86 } else
87 usage(dd_usage); 87 show_usage();
88 } 88 }
89 89
90 buf = xmalloc(bs); 90 buf = xmalloc(bs);
diff --git a/deallocvt.c b/deallocvt.c
index b51fbaef4..8c390c261 100644
--- a/deallocvt.c
+++ b/deallocvt.c
@@ -19,7 +19,7 @@ int deallocvt_main(int argc, char *argv[])
19 19
20 //if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-'))) 20 //if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-')))
21 if (argc > 2) 21 if (argc > 2)
22 usage(deallocvt_usage); 22 show_usage();
23 23
24 fd = get_console_fd("/dev/console"); 24 fd = get_console_fd("/dev/console");
25 25
diff --git a/df.c b/df.c
index 55919793c..8b6726b75 100644
--- a/df.c
+++ b/df.c
@@ -143,7 +143,7 @@ extern int df_main(int argc, char **argv)
143 return status; 143 return status;
144 144
145print_df_usage: 145print_df_usage:
146 usage(df_usage); 146 show_usage();
147 return(FALSE); 147 return(FALSE);
148} 148}
149 149
diff --git a/dirname.c b/dirname.c
index 2e11a69dc..e34ecf8a9 100644
--- a/dirname.c
+++ b/dirname.c
@@ -30,7 +30,7 @@ extern int dirname_main(int argc, char **argv)
30 char* s; 30 char* s;
31 31
32 if ((argc < 2) || (**(argv + 1) == '-')) 32 if ((argc < 2) || (**(argv + 1) == '-'))
33 usage(dirname_usage); 33 show_usage();
34 argv++; 34 argv++;
35 35
36 s=*argv+strlen(*argv)-1; 36 s=*argv+strlen(*argv)-1;
diff --git a/dmesg.c b/dmesg.c
index c21f84c9a..47f9f4474 100644
--- a/dmesg.c
+++ b/dmesg.c
@@ -53,21 +53,21 @@ int dmesg_main(int argc, char **argv)
53 case 'n': 53 case 'n':
54 cmd = 8; 54 cmd = 8;
55 if (optarg == NULL) 55 if (optarg == NULL)
56 usage(dmesg_usage); 56 show_usage();
57 level = atoi(optarg); 57 level = atoi(optarg);
58 break; 58 break;
59 case 's': 59 case 's':
60 if (optarg == NULL) 60 if (optarg == NULL)
61 usage(dmesg_usage); 61 show_usage();
62 bufsize = atoi(optarg); 62 bufsize = atoi(optarg);
63 break; 63 break;
64 default: 64 default:
65 usage(dmesg_usage); 65 show_usage();
66 } 66 }
67 } 67 }
68 68
69 if (optind < argc) { 69 if (optind < argc) {
70 goto end; 70 show_usage();
71 } 71 }
72 72
73 if (cmd == 8) { 73 if (cmd == 8) {
@@ -97,7 +97,4 @@ int dmesg_main(int argc, char **argv)
97 if (lastc != '\n') 97 if (lastc != '\n')
98 putchar('\n'); 98 putchar('\n');
99 return EXIT_SUCCESS; 99 return EXIT_SUCCESS;
100 end:
101 usage(dmesg_usage);
102 return EXIT_FAILURE;
103} 100}
diff --git a/dos2unix.c b/dos2unix.c
index 9fd952c31..32423611c 100644
--- a/dos2unix.c
+++ b/dos2unix.c
@@ -31,7 +31,7 @@ int dos2unix_main( int argc, char **argv ) {
31 if (argc > 1) { 31 if (argc > 1) {
32 c = *argv[1]; 32 c = *argv[1];
33 if (c == '-') { 33 if (c == '-') {
34 usage(dos2unix_usage); 34 show_usage();
35 } 35 }
36 } 36 }
37 c = getchar(); 37 c = getchar();
diff --git a/dpkg.c b/dpkg.c
index 4a5c6f4da..6e309eb06 100644
--- a/dpkg.c
+++ b/dpkg.c
@@ -840,7 +840,7 @@ extern int dpkg_main(int argc, char **argv)
840 case 'c': 840 case 'c':
841 return dpkg_configure(packages, status); 841 return dpkg_configure(packages, status);
842 default : 842 default :
843 usage(dpkg_usage); 843 show_usage();
844 return EXIT_FAILURE; 844 return EXIT_FAILURE;
845 } 845 }
846} \ No newline at end of file 846}
diff --git a/dpkg_deb.c b/dpkg_deb.c
index aed0ba368..c08438189 100644
--- a/dpkg_deb.c
+++ b/dpkg_deb.c
@@ -141,14 +141,12 @@ extern int dpkg_deb_main(int argc, char **argv)
141 break; 141 break;
142*/ 142*/
143 default: 143 default:
144 usage(dpkg_deb_usage); 144 show_usage();
145 return EXIT_FAILURE;
146 } 145 }
147 } 146 }
148 147
149 if (((optind + 1 ) > argc) || (optflag == 0)) { 148 if (((optind + 1 ) > argc) || (optflag == 0)) {
150 usage(dpkg_deb_usage); 149 show_usage();
151 return(EXIT_FAILURE);
152 } 150 }
153 if ((optflag & dpkg_deb_control) || (optflag & dpkg_deb_extract) || (optflag & dpkg_deb_verbose_extract)) { 151 if ((optflag & dpkg_deb_control) || (optflag & dpkg_deb_extract) || (optflag & dpkg_deb_verbose_extract)) {
154 if ( (optind + 1) == argc ) { 152 if ( (optind + 1) == argc ) {
diff --git a/du.c b/du.c
index c56afbc4f..516f4c92b 100644
--- a/du.c
+++ b/du.c
@@ -163,7 +163,7 @@ int du_main(int argc, char **argv)
163 case 'k': break; 163 case 'k': break;
164#endif 164#endif
165 default: 165 default:
166 usage(du_usage); 166 show_usage();
167 } 167 }
168 } 168 }
169 169
@@ -187,7 +187,7 @@ int du_main(int argc, char **argv)
187 return status; 187 return status;
188} 188}
189 189
190/* $Id: du.c,v 1.36 2001/01/27 09:33:38 andersen Exp $ */ 190/* $Id: du.c,v 1.37 2001/02/14 21:23:05 andersen Exp $ */
191/* 191/*
192Local Variables: 192Local Variables:
193c-file-style: "linux" 193c-file-style: "linux"
diff --git a/dumpkmap.c b/dumpkmap.c
index 4ab711e55..b9f1bd233 100644
--- a/dumpkmap.c
+++ b/dumpkmap.c
@@ -48,7 +48,7 @@ int dumpkmap_main(int argc, char **argv)
48 char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap"; 48 char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap";
49 49
50 if (argc>=2 && *argv[1]=='-') { 50 if (argc>=2 && *argv[1]=='-') {
51 usage(dumpkmap_usage); 51 show_usage();
52 } 52 }
53 53
54 fd = open("/dev/tty0", O_RDWR); 54 fd = open("/dev/tty0", O_RDWR);
diff --git a/dutmp.c b/dutmp.c
index 7e1d2eed7..2e6b3c056 100644
--- a/dutmp.c
+++ b/dutmp.c
@@ -33,7 +33,7 @@ extern int dutmp_main(int argc, char **argv)
33 if (argc<2) { 33 if (argc<2) {
34 file = fileno(stdin); 34 file = fileno(stdin);
35 } else if (*argv[1] == '-' ) { 35 } else if (*argv[1] == '-' ) {
36 usage(dutmp_usage); 36 show_usage();
37 } else { 37 } else {
38 file = open(argv[1], O_RDONLY); 38 file = open(argv[1], O_RDONLY);
39 if (file < 0) { 39 if (file < 0) {
@@ -45,7 +45,7 @@ extern int dutmp_main(int argc, char **argv)
45 * fact the stupid libc doesn't have a reliable #define to announce that libc5 45 * fact the stupid libc doesn't have a reliable #define to announce that libc5
46 * is being used. sigh. 46 * is being used. sigh.
47 */ 47 */
48#if ! defined __GLIBC__ 48#if ! defined __GLIBC__ || defined __UCLIBC__
49 while (read(file, (void*)&ut, sizeof(struct utmp))) { 49 while (read(file, (void*)&ut, sizeof(struct utmp))) {
50 printf("%d|%d|%s|%s|%s|%s|%s|%lx\n", 50 printf("%d|%d|%s|%s|%s|%s|%s|%lx\n",
51 ut.ut_type, ut.ut_pid, ut.ut_line, 51 ut.ut_type, ut.ut_pid, ut.ut_line,
diff --git a/editors/sed.c b/editors/sed.c
index 0ce9f45e0..390181375 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -673,7 +673,7 @@ extern int sed_main(int argc, char **argv)
673 while ((opt = getopt(argc, argv, "hne:f:")) > 0) { 673 while ((opt = getopt(argc, argv, "hne:f:")) > 0) {
674 switch (opt) { 674 switch (opt) {
675 case 'h': 675 case 'h':
676 usage(sed_usage); 676 show_usage();
677 break; 677 break;
678 case 'n': 678 case 'n':
679 be_quiet++; 679 be_quiet++;
@@ -691,7 +691,7 @@ extern int sed_main(int argc, char **argv)
691 * argv[optind] should be the pattern. no pattern, no worky */ 691 * argv[optind] should be the pattern. no pattern, no worky */
692 if (ncmds == 0) { 692 if (ncmds == 0) {
693 if (argv[optind] == NULL) 693 if (argv[optind] == NULL)
694 usage(sed_usage); 694 show_usage();
695 else { 695 else {
696 add_cmd_str(argv[optind]); 696 add_cmd_str(argv[optind]);
697 optind++; 697 optind++;
diff --git a/fdflush.c b/fdflush.c
index fcf8ddd28..f10cceae0 100644
--- a/fdflush.c
+++ b/fdflush.c
@@ -35,7 +35,7 @@ extern int fdflush_main(int argc, char **argv)
35 int fd; 35 int fd;
36 36
37 if (argc <= 1 || **(++argv) == '-') 37 if (argc <= 1 || **(++argv) == '-')
38 usage(fdflush_usage); 38 show_usage();
39 39
40 if ((fd = open(*argv, 0)) < 0) 40 if ((fd = open(*argv, 0)) < 0)
41 perror_msg_and_die("%s", *argv); 41 perror_msg_and_die("%s", *argv);
diff --git a/find.c b/find.c
index a4d056b54..a07dc8ecb 100644
--- a/find.c
+++ b/find.c
@@ -178,7 +178,7 @@ int find_main(int argc, char **argv)
178 mtime_days = -mtime_days; 178 mtime_days = -mtime_days;
179#endif 179#endif
180 } else 180 } else
181 usage(find_usage); 181 show_usage();
182 } 182 }
183 183
184 if (firstopt == 1) { 184 if (firstopt == 1) {
diff --git a/findutils/find.c b/findutils/find.c
index a4d056b54..a07dc8ecb 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -178,7 +178,7 @@ int find_main(int argc, char **argv)
178 mtime_days = -mtime_days; 178 mtime_days = -mtime_days;
179#endif 179#endif
180 } else 180 } else
181 usage(find_usage); 181 show_usage();
182 } 182 }
183 183
184 if (firstopt == 1) { 184 if (firstopt == 1) {
diff --git a/findutils/grep.c b/findutils/grep.c
index 3eea7792f..475b4ef21 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -237,7 +237,7 @@ extern int grep_main(int argc, char **argv)
237 237
238 /* argv[optind] should be the regex pattern; no pattern, no worky */ 238 /* argv[optind] should be the regex pattern; no pattern, no worky */
239 if (argv[optind] == NULL) 239 if (argv[optind] == NULL)
240 usage(grep_usage); 240 show_usage();
241 241
242 /* sanity check */ 242 /* sanity check */
243 if (print_count_only || be_quiet) { 243 if (print_count_only || be_quiet) {
diff --git a/findutils/which.c b/findutils/which.c
index 981a8acf5..1908db30a 100644
--- a/findutils/which.c
+++ b/findutils/which.c
@@ -33,7 +33,7 @@ extern int which_main(int argc, char **argv)
33 int i, count=1, found, status = EXIT_SUCCESS; 33 int i, count=1, found, status = EXIT_SUCCESS;
34 34
35 if (argc <= 1 || **(argv + 1) == '-') 35 if (argc <= 1 || **(argv + 1) == '-')
36 usage(which_usage); 36 show_usage();
37 argc--; 37 argc--;
38 38
39 path_list = getenv("PATH"); 39 path_list = getenv("PATH");
diff --git a/free.c b/free.c
index 17dd38687..d287c03f5 100644
--- a/free.c
+++ b/free.c
@@ -46,7 +46,7 @@ extern int free_main(int argc, char **argv)
46 info.bufferram/=info.mem_unit; 46 info.bufferram/=info.mem_unit;
47 47
48 if (argc > 1 && **(argv + 1) == '-') 48 if (argc > 1 && **(argv + 1) == '-')
49 usage(free_usage); 49 show_usage();
50 50
51 printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free", 51 printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free",
52 "shared", "buffers"); 52 "shared", "buffers");
diff --git a/freeramdisk.c b/freeramdisk.c
index 8f90f40b5..cf25fae6a 100644
--- a/freeramdisk.c
+++ b/freeramdisk.c
@@ -40,7 +40,7 @@ freeramdisk_main(int argc, char **argv)
40 int f; 40 int f;
41 41
42 if (argc != 2 || *argv[1] == '-') { 42 if (argc != 2 || *argv[1] == '-') {
43 usage(freeramdisk_usage); 43 show_usage();
44 } 44 }
45 45
46 if ((f = open(argv[1], O_RDWR)) == -1) { 46 if ((f = open(argv[1], O_RDWR)) == -1) {
diff --git a/fsck_minix.c b/fsck_minix.c
index 9d7622006..2b4c65144 100644
--- a/fsck_minix.c
+++ b/fsck_minix.c
@@ -283,11 +283,6 @@ static void leave(int status)
283 exit(status); 283 exit(status);
284} 284}
285 285
286static void show_usage(void)
287{
288 usage(fsck_minix_usage);
289}
290
291static void die(const char *str) 286static void die(const char *str)
292{ 287{
293 error_msg("%s", str); 288 error_msg("%s", str);
diff --git a/getopt.c b/getopt.c
index 625263184..eb28d5d07 100644
--- a/getopt.c
+++ b/getopt.c
@@ -372,7 +372,7 @@ int getopt_main(int argc, char *argv[])
372 quote=0; 372 quote=0;
373 break; 373 break;
374 default: 374 default:
375 usage(getopt_usage); 375 show_usage();
376 } 376 }
377 377
378 if (!optstr) { 378 if (!optstr) {
diff --git a/grep.c b/grep.c
index 3eea7792f..475b4ef21 100644
--- a/grep.c
+++ b/grep.c
@@ -237,7 +237,7 @@ extern int grep_main(int argc, char **argv)
237 237
238 /* argv[optind] should be the regex pattern; no pattern, no worky */ 238 /* argv[optind] should be the regex pattern; no pattern, no worky */
239 if (argv[optind] == NULL) 239 if (argv[optind] == NULL)
240 usage(grep_usage); 240 show_usage();
241 241
242 /* sanity check */ 242 /* sanity check */
243 if (print_count_only || be_quiet) { 243 if (print_count_only || be_quiet) {
diff --git a/gunzip.c b/gunzip.c
index 48a46083b..bf8812dbd 100644
--- a/gunzip.c
+++ b/gunzip.c
@@ -1250,7 +1250,7 @@ int gunzip_main(int argc, char **argv)
1250 force = 1; 1250 force = 1;
1251 break; 1251 break;
1252 default: 1252 default:
1253 usage(gunzip_usage); 1253 show_usage();
1254 } 1254 }
1255 } 1255 }
1256 } 1256 }
@@ -1275,7 +1275,7 @@ int gunzip_main(int argc, char **argv)
1275 } else { 1275 } else {
1276 /* Open up the input file */ 1276 /* Open up the input file */
1277 if (argc <= 0) 1277 if (argc <= 0)
1278 usage(gunzip_usage); 1278 show_usage();
1279 if (strlen(*argv) > MAX_PATH_LEN) { 1279 if (strlen(*argv) > MAX_PATH_LEN) {
1280 error_msg(name_too_long); 1280 error_msg(name_too_long);
1281 exit(WARNING); 1281 exit(WARNING);
diff --git a/gzip.c b/gzip.c
index 75f3caa35..3cbef4ec1 100644
--- a/gzip.c
+++ b/gzip.c
@@ -1812,7 +1812,7 @@ int gzip_main(int argc, char **argv)
1812 case 'd': 1812 case 'd':
1813 exit(gunzip_main(argc, argv)); 1813 exit(gunzip_main(argc, argv));
1814 default: 1814 default:
1815 usage(gzip_usage); 1815 show_usage();
1816 } 1816 }
1817 } 1817 }
1818 } 1818 }
@@ -1865,7 +1865,7 @@ int gzip_main(int argc, char **argv)
1865 } else { 1865 } else {
1866 /* Open up the input file */ 1866 /* Open up the input file */
1867 if (argc <= 0) 1867 if (argc <= 0)
1868 usage(gzip_usage); 1868 show_usage();
1869 strncpy(ifname, *argv, MAX_PATH_LEN); 1869 strncpy(ifname, *argv, MAX_PATH_LEN);
1870 1870
1871 /* Open input file */ 1871 /* Open input file */
diff --git a/head.c b/head.c
index 7d87f32cb..a2d774437 100644
--- a/head.c
+++ b/head.c
@@ -57,7 +57,7 @@ int head_main(int argc, char **argv)
57 break; 57 break;
58 /* fallthrough */ 58 /* fallthrough */
59 default: 59 default:
60 usage(head_usage); 60 show_usage();
61 } 61 }
62 } 62 }
63 63
diff --git a/hostname.c b/hostname.c
index ce17ba91c..e1486b365 100644
--- a/hostname.c
+++ b/hostname.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: hostname.c,v 1.23 2001/02/01 16:49:29 kraai Exp $ 3 * $Id: hostname.c,v 1.24 2001/02/14 21:23:06 andersen Exp $
4 * Mini hostname implementation for busybox 4 * Mini hostname implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -66,7 +66,7 @@ int hostname_main(int argc, char **argv)
66 char *s = NULL; 66 char *s = NULL;
67 67
68 if (argc < 1) 68 if (argc < 1)
69 usage(hostname_usage); 69 show_usage();
70 70
71 while (--argc > 0 && **(++argv) == '-') { 71 while (--argc > 0 && **(++argv) == '-') {
72 while (*(++(*argv))) { 72 while (*(++(*argv))) {
@@ -82,18 +82,18 @@ int hostname_main(int argc, char **argv)
82 break; 82 break;
83 case 'F': 83 case 'F':
84 if (--argc == 0) { 84 if (--argc == 0) {
85 usage(hostname_usage); 85 show_usage();
86 } 86 }
87 filename = *(++argv); 87 filename = *(++argv);
88 break; 88 break;
89 case '-': 89 case '-':
90 if (strcmp(++(*argv), "file") || --argc ==0 ) { 90 if (strcmp(++(*argv), "file") || --argc ==0 ) {
91 usage(hostname_usage); 91 show_usage();
92 } 92 }
93 filename = *(++argv); 93 filename = *(++argv);
94 break; 94 break;
95 default: 95 default:
96 usage(hostname_usage); 96 show_usage();
97 } 97 }
98 if (filename != NULL) 98 if (filename != NULL)
99 break; 99 break;
diff --git a/id.c b/id.c
index 650e3db20..3667b32b2 100644
--- a/id.c
+++ b/id.c
@@ -53,11 +53,11 @@ extern int id_main(int argc, char **argv)
53 name_not_number++; 53 name_not_number++;
54 break; 54 break;
55 default: 55 default:
56 usage(id_usage); 56 show_usage();
57 } 57 }
58 } 58 }
59 59
60 if (no_user && no_group) usage(id_usage); 60 if (no_user && no_group) show_usage();
61 61
62 if (argv[optind] == NULL) { 62 if (argv[optind] == NULL) {
63 if (print_real) { 63 if (print_real) {
diff --git a/ifconfig.c b/ifconfig.c
index 2134f8a48..66615a2fd 100644
--- a/ifconfig.c
+++ b/ifconfig.c
@@ -15,7 +15,7 @@
15 * Foundation; either version 2 of the License, or (at 15 * Foundation; either version 2 of the License, or (at
16 * your option) any later version. 16 * your option) any later version.
17 * 17 *
18 * $Id: ifconfig.c,v 1.1 2001/02/14 08:11:27 andersen Exp $ 18 * $Id: ifconfig.c,v 1.2 2001/02/14 21:23:06 andersen Exp $
19 * 19 *
20 */ 20 */
21 21
@@ -183,7 +183,7 @@ int ifconfig_main(int argc, char **argv)
183 char host[128]; 183 char host[128];
184 184
185 if(argc < 2) { 185 if(argc < 2) {
186 usage(ifconfig_usage); 186 show_usage();
187 } 187 }
188 188
189 /* Create a channel to the NET kernel. */ 189 /* Create a channel to the NET kernel. */
@@ -269,7 +269,7 @@ int ifconfig_main(int argc, char **argv)
269 269
270 if (!strcmp(*spp, "metric")) { 270 if (!strcmp(*spp, "metric")) {
271 if (*++spp == NULL) 271 if (*++spp == NULL)
272 usage(ifconfig_usage); 272 show_usage();
273 ifr.ifr_metric = atoi(*spp); 273 ifr.ifr_metric = atoi(*spp);
274 if (ioctl(sockfd, SIOCSIFMETRIC, &ifr) < 0) { 274 if (ioctl(sockfd, SIOCSIFMETRIC, &ifr) < 0) {
275 fprintf(stderr, "SIOCSIFMETRIC: %s\n", strerror(errno)); 275 fprintf(stderr, "SIOCSIFMETRIC: %s\n", strerror(errno));
@@ -280,7 +280,7 @@ int ifconfig_main(int argc, char **argv)
280 } 280 }
281 if (!strcmp(*spp, "mtu")) { 281 if (!strcmp(*spp, "mtu")) {
282 if (*++spp == NULL) 282 if (*++spp == NULL)
283 usage(ifconfig_usage); 283 show_usage();
284 ifr.ifr_mtu = atoi(*spp); 284 ifr.ifr_mtu = atoi(*spp);
285 if (ioctl(sockfd, SIOCSIFMTU, &ifr) < 0) { 285 if (ioctl(sockfd, SIOCSIFMTU, &ifr) < 0) {
286 fprintf(stderr, "SIOCSIFMTU: %s\n", strerror(errno)); 286 fprintf(stderr, "SIOCSIFMTU: %s\n", strerror(errno));
@@ -292,7 +292,7 @@ int ifconfig_main(int argc, char **argv)
292#ifdef SIOCSKEEPALIVE 292#ifdef SIOCSKEEPALIVE
293 if (!strcmp(*spp, "keepalive")) { 293 if (!strcmp(*spp, "keepalive")) {
294 if (*++spp == NULL) 294 if (*++spp == NULL)
295 usage(ifconfig_usage); 295 show_usage();
296 ifr.ifr_data = (caddr_t) atoi(*spp); 296 ifr.ifr_data = (caddr_t) atoi(*spp);
297 if (ioctl(sockfd, SIOCSKEEPALIVE, &ifr) < 0) { 297 if (ioctl(sockfd, SIOCSKEEPALIVE, &ifr) < 0) {
298 fprintf(stderr, "SIOCSKEEPALIVE: %s\n", strerror(errno)); 298 fprintf(stderr, "SIOCSKEEPALIVE: %s\n", strerror(errno));
@@ -306,7 +306,7 @@ int ifconfig_main(int argc, char **argv)
306#ifdef SIOCSOUTFILL 306#ifdef SIOCSOUTFILL
307 if (!strcmp(*spp, "outfill")) { 307 if (!strcmp(*spp, "outfill")) {
308 if (*++spp == NULL) 308 if (*++spp == NULL)
309 usage(ifconfig_usage); 309 show_usage();
310 ifr.ifr_data = (caddr_t) atoi(*spp); 310 ifr.ifr_data = (caddr_t) atoi(*spp);
311 if (ioctl(sockfd, SIOCSOUTFILL, &ifr) < 0) { 311 if (ioctl(sockfd, SIOCSOUTFILL, &ifr) < 0) {
312 fprintf(stderr, "SIOCSOUTFILL: %s\n", strerror(errno)); 312 fprintf(stderr, "SIOCSOUTFILL: %s\n", strerror(errno));
@@ -344,7 +344,7 @@ int ifconfig_main(int argc, char **argv)
344 } 344 }
345 if (!strcmp(*spp, "dstaddr")) { 345 if (!strcmp(*spp, "dstaddr")) {
346 if (*++spp == NULL) 346 if (*++spp == NULL)
347 usage(ifconfig_usage); 347 show_usage();
348 safe_strncpy(host, *spp, (sizeof host)); 348 safe_strncpy(host, *spp, (sizeof host));
349 if (INET_resolve(host, &sa) < 0) { 349 if (INET_resolve(host, &sa) < 0) {
350 goterr++; 350 goterr++;
@@ -363,7 +363,7 @@ int ifconfig_main(int argc, char **argv)
363 } 363 }
364 if (!strcmp(*spp, "netmask")) { 364 if (!strcmp(*spp, "netmask")) {
365 if (*++spp == NULL || didnetmask) 365 if (*++spp == NULL || didnetmask)
366 usage(ifconfig_usage); 366 show_usage();
367 safe_strncpy(host, *spp, (sizeof host)); 367 safe_strncpy(host, *spp, (sizeof host));
368 if (INET_resolve(host, &sa) < 0) { 368 if (INET_resolve(host, &sa) < 0) {
369 goterr++; 369 goterr++;
@@ -409,7 +409,7 @@ int ifconfig_main(int argc, char **argv)
409 409
410 if (!strcmp(*spp, "hw")) { 410 if (!strcmp(*spp, "hw")) {
411 if (*++spp == NULL || strcmp("ether", *spp)) { 411 if (*++spp == NULL || strcmp("ether", *spp)) {
412 usage(ifconfig_usage); 412 show_usage();
413 } 413 }
414 414
415 if (*++spp == NULL) { 415 if (*++spp == NULL) {
@@ -438,7 +438,7 @@ int ifconfig_main(int argc, char **argv)
438 safe_strncpy(host, *spp, (sizeof host)); 438 safe_strncpy(host, *spp, (sizeof host));
439 439
440 if (INET_resolve(host, &sa) < 0) { 440 if (INET_resolve(host, &sa) < 0) {
441 usage(ifconfig_usage); 441 show_usage();
442 } 442 }
443 memcpy((char *) &ifr.ifr_addr, 443 memcpy((char *) &ifr.ifr_addr,
444 (char *) &sa, sizeof(struct sockaddr)); 444 (char *) &sa, sizeof(struct sockaddr));
diff --git a/include/applets.h b/include/applets.h
index 0b70a6120..cb744567a 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -10,403 +10,417 @@
10 * file result in the listing remaining in ascii order. You have been warned. 10 * file result in the listing remaining in ascii order. You have been warned.
11 */ 11 */
12 12
13#undef APPLET
14#undef APPLET_ODDNAME
15#undef APPLET_NOUSAGE
16
13#if defined(PROTOTYPES) 17#if defined(PROTOTYPES)
14#define APPLET(a,b,c,d) \ 18#define APPLET(a,b,c) \
15 extern int b(int argc, char **argv); \ 19 extern int b(int argc, char **argv);
16 extern const char d[]; 20#define APPLET_ODDNAME(a,b,c,d,e) APPLET(a,b,c)
17#define APPLET_NOUSAGE(a,b,c) \ 21#define APPLET_NOUSAGE(a,b,c) \
18 extern int b(int argc, char **argv); 22 extern int b(int argc, char **argv);
19#elif defined(MAKE_LINKS) 23#elif defined(MAKE_LINKS)
20#define APPLET(a,b,c,d) LINK c a 24#define APPLET(a,b,c) LINK c #a
21#define APPLET_NOUSAGE(a,b,c) LINK c a 25#define APPLET_ODDNAME(a,b,c,d,e) LINK c a
26#define APPLET_NOUSAGE(a,b,c) LINK c #a
27#elif defined(APPLET_ENUM)
28#define APPLET(a,b,c) a##_applet_number,
29#define APPLET_ODDNAME(a,b,c,d,e) e##_applet_number,
30#define APPLET_NOUSAGE(a,b,c) a##applet_number,
22#else 31#else
32#define USAGE_ENUM
33#include "usage.h"
23const struct BB_applet applets[] = { 34const struct BB_applet applets[] = {
24#define APPLET(a,b,c,d) {a,b,c,d}, 35#define APPLET(a,b,c) {#a,b,c,a##_usage_index},
25#define APPLET_NOUSAGE(a,b,c) {a,b,c,NULL}, 36#define APPLET_ODDNAME(a,b,c,d,e) {a,b,c,d},
37#define APPLET_NOUSAGE(a,b,c) {#a,b,c,-1},
38#define zcat_usage_index gunzip_usage_index
39#define sh_usage_index shell_usage_index
26#endif 40#endif
27 41
28#ifdef BB_TEST 42#ifdef BB_TEST
29 APPLET("[", test_main, _BB_DIR_USR_BIN, test_usage) 43 APPLET_ODDNAME("[", test_main, _BB_DIR_USR_BIN, test_usage_index, open_bracket)
30#endif 44#endif
31#ifdef BB_AR 45#ifdef BB_AR
32 APPLET("ar", ar_main, _BB_DIR_USR_BIN, ar_usage) 46 APPLET(ar, ar_main, _BB_DIR_USR_BIN)
33#endif 47#endif
34#ifdef BB_BASENAME 48#ifdef BB_BASENAME
35 APPLET("basename", basename_main, _BB_DIR_USR_BIN, basename_usage) 49 APPLET(basename, basename_main, _BB_DIR_USR_BIN)
36#endif 50#endif
37 APPLET_NOUSAGE("busybox", busybox_main, _BB_DIR_BIN) 51 APPLET_NOUSAGE(busybox, busybox_main, _BB_DIR_BIN)
38#ifdef BB_CAT 52#ifdef BB_CAT
39 APPLET("cat", cat_main, _BB_DIR_BIN, cat_usage) 53 APPLET(cat, cat_main, _BB_DIR_BIN)
40#endif 54#endif
41#ifdef BB_CHMOD_CHOWN_CHGRP 55#ifdef BB_CHMOD_CHOWN_CHGRP
42 APPLET("chgrp", chmod_chown_chgrp_main, _BB_DIR_BIN, chgrp_usage) 56 APPLET(chgrp, chmod_chown_chgrp_main, _BB_DIR_BIN)
43#endif 57#endif
44#ifdef BB_CHMOD_CHOWN_CHGRP 58#ifdef BB_CHMOD_CHOWN_CHGRP
45 APPLET("chmod", chmod_chown_chgrp_main, _BB_DIR_BIN, chmod_usage) 59 APPLET(chmod, chmod_chown_chgrp_main, _BB_DIR_BIN)
46#endif 60#endif
47#ifdef BB_CHMOD_CHOWN_CHGRP 61#ifdef BB_CHMOD_CHOWN_CHGRP
48 APPLET("chown", chmod_chown_chgrp_main, _BB_DIR_BIN, chown_usage) 62 APPLET(chown, chmod_chown_chgrp_main, _BB_DIR_BIN)
49#endif 63#endif
50#ifdef BB_CHROOT 64#ifdef BB_CHROOT
51 APPLET("chroot", chroot_main, _BB_DIR_USR_SBIN, chroot_usage) 65 APPLET(chroot, chroot_main, _BB_DIR_USR_SBIN)
52#endif 66#endif
53#ifdef BB_CHVT 67#ifdef BB_CHVT
54 APPLET("chvt", chvt_main, _BB_DIR_USR_BIN, chvt_usage) 68 APPLET(chvt, chvt_main, _BB_DIR_USR_BIN)
55#endif 69#endif
56#ifdef BB_CLEAR 70#ifdef BB_CLEAR
57 APPLET("clear", clear_main, _BB_DIR_USR_BIN, clear_usage) 71 APPLET(clear, clear_main, _BB_DIR_USR_BIN)
58#endif 72#endif
59#ifdef BB_CMP 73#ifdef BB_CMP
60 APPLET("cmp", cmp_main, _BB_DIR_USR_BIN, cmp_usage) 74 APPLET(cmp, cmp_main, _BB_DIR_USR_BIN)
61#endif 75#endif
62#ifdef BB_CP_MV 76#ifdef BB_CP_MV
63 APPLET("cp", cp_mv_main, _BB_DIR_BIN, cp_usage) 77 APPLET(cp, cp_mv_main, _BB_DIR_BIN)
64#endif 78#endif
65#ifdef BB_CUT 79#ifdef BB_CUT
66 APPLET("cut", cut_main, _BB_DIR_USR_BIN, cut_usage) 80 APPLET(cut, cut_main, _BB_DIR_USR_BIN)
67#endif 81#endif
68#ifdef BB_DATE 82#ifdef BB_DATE
69 APPLET("date", date_main, _BB_DIR_BIN, date_usage) 83 APPLET(date, date_main, _BB_DIR_BIN)
70#endif 84#endif
71#ifdef BB_DC 85#ifdef BB_DC
72 APPLET("dc", dc_main, _BB_DIR_USR_BIN, dc_usage) 86 APPLET(dc, dc_main, _BB_DIR_USR_BIN)
73#endif 87#endif
74#ifdef BB_DD 88#ifdef BB_DD
75 APPLET("dd", dd_main, _BB_DIR_BIN, dd_usage) 89 APPLET(dd, dd_main, _BB_DIR_BIN)
76#endif 90#endif
77#ifdef BB_DEALLOCVT 91#ifdef BB_DEALLOCVT
78 APPLET("deallocvt", deallocvt_main, _BB_DIR_USR_BIN, deallocvt_usage) 92 APPLET(deallocvt, deallocvt_main, _BB_DIR_USR_BIN)
79#endif 93#endif
80#ifdef BB_DF 94#ifdef BB_DF
81 APPLET("df", df_main, _BB_DIR_BIN, df_usage) 95 APPLET(df, df_main, _BB_DIR_BIN)
82#endif 96#endif
83#ifdef BB_DIRNAME 97#ifdef BB_DIRNAME
84 APPLET("dirname", dirname_main, _BB_DIR_USR_BIN, dirname_usage) 98 APPLET(dirname, dirname_main, _BB_DIR_USR_BIN)
85#endif 99#endif
86#ifdef BB_DMESG 100#ifdef BB_DMESG
87 APPLET("dmesg", dmesg_main, _BB_DIR_BIN, dmesg_usage) 101 APPLET(dmesg, dmesg_main, _BB_DIR_BIN)
88#endif 102#endif
89#ifdef BB_DOS2UNIX 103#ifdef BB_DOS2UNIX
90 APPLET("dos2unix", dos2unix_main, _BB_DIR_USR_BIN, dos2unix_usage) 104 APPLET(dos2unix, dos2unix_main, _BB_DIR_USR_BIN)
91#endif 105#endif
92#ifdef BB_DPKG 106#ifdef BB_DPKG
93 APPLET("dpkg", dpkg_main, _BB_DIR_USR_BIN, dpkg_usage) 107 APPLET(dpkg, dpkg_main, _BB_DIR_USR_BIN)
94#endif 108#endif
95#ifdef BB_DPKG_DEB 109#ifdef BB_DPKG_DEB
96 APPLET("dpkg-deb", dpkg_deb_main, _BB_DIR_USR_BIN, dpkg_deb_usage) 110 APPLET_ODDNAME("dpkg-deb", dpkg_deb_main, _BB_DIR_USR_BIN, dpkg_deb_usage_index, dpkg_deb)
97#endif 111#endif
98#ifdef BB_DU 112#ifdef BB_DU
99 APPLET("du", du_main, _BB_DIR_USR_BIN, du_usage) 113 APPLET(du, du_main, _BB_DIR_USR_BIN)
100#endif 114#endif
101#ifdef BB_DUMPKMAP 115#ifdef BB_DUMPKMAP
102 APPLET("dumpkmap", dumpkmap_main, _BB_DIR_BIN, dumpkmap_usage) 116 APPLET(dumpkmap, dumpkmap_main, _BB_DIR_BIN)
103#endif 117#endif
104#ifdef BB_DUTMP 118#ifdef BB_DUTMP
105 APPLET("dutmp", dutmp_main, _BB_DIR_USR_SBIN, dutmp_usage) 119 APPLET(dutmp, dutmp_main, _BB_DIR_USR_SBIN)
106#endif 120#endif
107#ifdef BB_ECHO 121#ifdef BB_ECHO
108 APPLET("echo", echo_main, _BB_DIR_BIN, echo_usage) 122 APPLET(echo, echo_main, _BB_DIR_BIN)
109#endif 123#endif
110#ifdef BB_EXPR 124#ifdef BB_EXPR
111 APPLET("expr", expr_main, _BB_DIR_USR_BIN, expr_usage) 125 APPLET(expr, expr_main, _BB_DIR_USR_BIN)
112#endif 126#endif
113#ifdef BB_TRUE_FALSE 127#ifdef BB_TRUE_FALSE
114 APPLET("false", false_main, _BB_DIR_BIN, false_usage) 128 APPLET(false, false_main, _BB_DIR_BIN)
115#endif 129#endif
116#ifdef BB_FBSET 130#ifdef BB_FBSET
117 APPLET_NOUSAGE("fbset", fbset_main, _BB_DIR_USR_SBIN) 131 APPLET_NOUSAGE(fbset, fbset_main, _BB_DIR_USR_SBIN)
118#endif 132#endif
119#ifdef BB_FDFLUSH 133#ifdef BB_FDFLUSH
120 APPLET("fdflush", fdflush_main, _BB_DIR_BIN, fdflush_usage) 134 APPLET(fdflush, fdflush_main, _BB_DIR_BIN)
121#endif 135#endif
122#ifdef BB_FIND 136#ifdef BB_FIND
123 APPLET("find", find_main, _BB_DIR_USR_BIN, find_usage) 137 APPLET(find, find_main, _BB_DIR_USR_BIN)
124#endif 138#endif
125#ifdef BB_FREE 139#ifdef BB_FREE
126 APPLET("free", free_main, _BB_DIR_USR_BIN, free_usage) 140 APPLET(free, free_main, _BB_DIR_USR_BIN)
127#endif 141#endif
128#ifdef BB_FREERAMDISK 142#ifdef BB_FREERAMDISK
129 APPLET("freeramdisk", freeramdisk_main, _BB_DIR_SBIN, freeramdisk_usage) 143 APPLET(freeramdisk, freeramdisk_main, _BB_DIR_SBIN)
130#endif 144#endif
131#ifdef BB_FSCK_MINIX 145#ifdef BB_FSCK_MINIX
132 APPLET("fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage) 146 APPLET_ODDNAME("fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage_index, fsck_minix)
133#endif 147#endif
134#ifdef BB_GETOPT 148#ifdef BB_GETOPT
135 APPLET("getopt", getopt_main, _BB_DIR_BIN, getopt_usage) 149 APPLET(getopt, getopt_main, _BB_DIR_BIN)
136#endif 150#endif
137#ifdef BB_GREP 151#ifdef BB_GREP
138 APPLET("grep", grep_main, _BB_DIR_BIN, grep_usage) 152 APPLET(grep, grep_main, _BB_DIR_BIN)
139#endif 153#endif
140#ifdef BB_GUNZIP 154#ifdef BB_GUNZIP
141 APPLET("gunzip", gunzip_main, _BB_DIR_BIN, gunzip_usage) 155 APPLET(gunzip, gunzip_main, _BB_DIR_BIN)
142#endif 156#endif
143#ifdef BB_GZIP 157#ifdef BB_GZIP
144 APPLET("gzip", gzip_main, _BB_DIR_BIN, gzip_usage) 158 APPLET(gzip, gzip_main, _BB_DIR_BIN)
145#endif 159#endif
146#ifdef BB_HALT 160#ifdef BB_HALT
147 APPLET("halt", halt_main, _BB_DIR_SBIN, halt_usage) 161 APPLET(halt, halt_main, _BB_DIR_SBIN)
148#endif 162#endif
149#ifdef BB_HEAD 163#ifdef BB_HEAD
150 APPLET("head", head_main, _BB_DIR_USR_BIN, head_usage) 164 APPLET(head, head_main, _BB_DIR_USR_BIN)
151#endif 165#endif
152#ifdef BB_HOSTID 166#ifdef BB_HOSTID
153 APPLET("hostid", hostid_main, _BB_DIR_USR_BIN, hostid_usage) 167 APPLET(hostid, hostid_main, _BB_DIR_USR_BIN)
154#endif 168#endif
155#ifdef BB_HOSTNAME 169#ifdef BB_HOSTNAME
156 APPLET("hostname", hostname_main, _BB_DIR_BIN, hostname_usage) 170 APPLET(hostname, hostname_main, _BB_DIR_BIN)
157#endif 171#endif
158#ifdef BB_ID 172#ifdef BB_ID
159 APPLET("id", id_main, _BB_DIR_USR_BIN, id_usage) 173 APPLET(id, id_main, _BB_DIR_USR_BIN)
160#endif 174#endif
161#ifdef BB_IFCONFIG 175#ifdef BB_IFCONFIG
162 APPLET("ifconfig", ifconfig_main, _BB_DIR_SBIN, ifconfig_usage) 176 APPLET(ifconfig, ifconfig_main, _BB_DIR_SBIN)
163#endif 177#endif
164#ifdef BB_INIT 178#ifdef BB_INIT
165 APPLET_NOUSAGE("init", init_main, _BB_DIR_SBIN) 179 APPLET(init, init_main, _BB_DIR_SBIN)
166#endif 180#endif
167#ifdef BB_INSMOD 181#ifdef BB_INSMOD
168 APPLET("insmod", insmod_main, _BB_DIR_SBIN, insmod_usage) 182 APPLET(insmod, insmod_main, _BB_DIR_SBIN)
169#endif 183#endif
170#ifdef BB_KILL 184#ifdef BB_KILL
171 APPLET("kill", kill_main, _BB_DIR_BIN, kill_usage) 185 APPLET(kill, kill_main, _BB_DIR_BIN)
172#endif 186#endif
173#ifdef BB_KILLALL 187#ifdef BB_KILLALL
174 APPLET("killall", kill_main, _BB_DIR_USR_BIN, killall_usage) 188 APPLET(killall, kill_main, _BB_DIR_USR_BIN)
175#endif 189#endif
176#ifdef BB_LENGTH 190#ifdef BB_LENGTH
177 APPLET("length", length_main, _BB_DIR_USR_BIN, length_usage) 191 APPLET(length, length_main, _BB_DIR_USR_BIN)
178#endif 192#endif
179#ifdef BB_LINUXRC 193#ifdef BB_LINUXRC
180 APPLET_NOUSAGE("linuxrc", init_main, _BB_DIR_ROOT) 194 APPLET_NOUSAGE(linuxrc, init_main, _BB_DIR_ROOT)
181#endif 195#endif
182#ifdef BB_LN 196#ifdef BB_LN
183 APPLET("ln", ln_main, _BB_DIR_BIN, ln_usage) 197 APPLET(ln, ln_main, _BB_DIR_BIN)
184#endif 198#endif
185#ifdef BB_LOADACM 199#ifdef BB_LOADACM
186 APPLET("loadacm", loadacm_main, _BB_DIR_USR_BIN, loadacm_usage) 200 APPLET(loadacm, loadacm_main, _BB_DIR_USR_BIN)
187#endif 201#endif
188#ifdef BB_LOADFONT 202#ifdef BB_LOADFONT
189 APPLET("loadfont", loadfont_main, _BB_DIR_USR_BIN, loadfont_usage) 203 APPLET(loadfont, loadfont_main, _BB_DIR_USR_BIN)
190#endif 204#endif
191#ifdef BB_LOADKMAP 205#ifdef BB_LOADKMAP
192 APPLET("loadkmap", loadkmap_main, _BB_DIR_SBIN, loadkmap_usage) 206 APPLET(loadkmap, loadkmap_main, _BB_DIR_SBIN)
193#endif 207#endif
194#ifdef BB_LOGGER 208#ifdef BB_LOGGER
195 APPLET("logger", logger_main, _BB_DIR_USR_BIN, logger_usage) 209 APPLET(logger, logger_main, _BB_DIR_USR_BIN)
196#endif 210#endif
197#ifdef BB_LOGNAME 211#ifdef BB_LOGNAME
198 APPLET("logname", logname_main, _BB_DIR_USR_BIN, logname_usage) 212 APPLET(logname, logname_main, _BB_DIR_USR_BIN)
199#endif 213#endif
200#ifdef BB_LS 214#ifdef BB_LS
201 APPLET("ls", ls_main, _BB_DIR_BIN, ls_usage) 215 APPLET(ls, ls_main, _BB_DIR_BIN)
202#endif 216#endif
203#ifdef BB_LSMOD 217#ifdef BB_LSMOD
204 APPLET("lsmod", lsmod_main, _BB_DIR_SBIN, lsmod_usage) 218 APPLET(lsmod, lsmod_main, _BB_DIR_SBIN)
205#endif 219#endif
206#ifdef BB_MAKEDEVS 220#ifdef BB_MAKEDEVS
207 APPLET("makedevs", makedevs_main, _BB_DIR_SBIN, makedevs_usage) 221 APPLET(makedevs, makedevs_main, _BB_DIR_SBIN)
208#endif 222#endif
209#ifdef BB_MD5SUM 223#ifdef BB_MD5SUM
210 APPLET("md5sum", md5sum_main, _BB_DIR_USR_BIN, md5sum_usage) 224 APPLET(md5sum, md5sum_main, _BB_DIR_USR_BIN)
211#endif 225#endif
212#ifdef BB_MKDIR 226#ifdef BB_MKDIR
213 APPLET("mkdir", mkdir_main, _BB_DIR_BIN, mkdir_usage) 227 APPLET(mkdir, mkdir_main, _BB_DIR_BIN)
214#endif 228#endif
215#ifdef BB_MKFIFO 229#ifdef BB_MKFIFO
216 APPLET("mkfifo", mkfifo_main, _BB_DIR_USR_BIN, mkfifo_usage) 230 APPLET(mkfifo, mkfifo_main, _BB_DIR_USR_BIN)
217#endif 231#endif
218#ifdef BB_MKFS_MINIX 232#ifdef BB_MKFS_MINIX
219 APPLET("mkfs.minix", mkfs_minix_main, _BB_DIR_SBIN, mkfs_minix_usage) 233 APPLET_ODDNAME("mkfs.minix", mkfs_minix_main, _BB_DIR_SBIN, mkfs_minix_usage_index, mkfs_minix)
220#endif 234#endif
221#ifdef BB_MKNOD 235#ifdef BB_MKNOD
222 APPLET("mknod", mknod_main, _BB_DIR_BIN, mknod_usage) 236 APPLET(mknod, mknod_main, _BB_DIR_BIN)
223#endif 237#endif
224#ifdef BB_MKSWAP 238#ifdef BB_MKSWAP
225 APPLET("mkswap", mkswap_main, _BB_DIR_SBIN, mkswap_usage) 239 APPLET(mkswap, mkswap_main, _BB_DIR_SBIN)
226#endif 240#endif
227#ifdef BB_MKTEMP 241#ifdef BB_MKTEMP
228 APPLET("mktemp", mktemp_main, _BB_DIR_BIN, mktemp_usage) 242 APPLET(mktemp, mktemp_main, _BB_DIR_BIN)
229#endif 243#endif
230#ifdef BB_MORE 244#ifdef BB_MORE
231 APPLET("more", more_main, _BB_DIR_BIN, more_usage) 245 APPLET(more, more_main, _BB_DIR_BIN)
232#endif 246#endif
233#ifdef BB_MOUNT 247#ifdef BB_MOUNT
234 APPLET("mount", mount_main, _BB_DIR_BIN, mount_usage) 248 APPLET(mount, mount_main, _BB_DIR_BIN)
235#endif 249#endif
236#ifdef BB_MT 250#ifdef BB_MT
237 APPLET("mt", mt_main, _BB_DIR_BIN, mt_usage) 251 APPLET(mt, mt_main, _BB_DIR_BIN)
238#endif 252#endif
239#ifdef BB_CP_MV 253#ifdef BB_CP_MV
240 APPLET("mv", cp_mv_main, _BB_DIR_BIN, mv_usage) 254 APPLET(mv, cp_mv_main, _BB_DIR_BIN)
241#endif 255#endif
242#ifdef BB_NC 256#ifdef BB_NC
243 APPLET("nc", nc_main, _BB_DIR_USR_BIN, nc_usage) 257 APPLET(nc, nc_main, _BB_DIR_USR_BIN)
244#endif 258#endif
245#ifdef BB_NSLOOKUP 259#ifdef BB_NSLOOKUP
246 APPLET("nslookup", nslookup_main, _BB_DIR_USR_BIN, nslookup_usage) 260 APPLET(nslookup, nslookup_main, _BB_DIR_USR_BIN)
247#endif 261#endif
248#ifdef BB_PING 262#ifdef BB_PING
249 APPLET("ping", ping_main, _BB_DIR_BIN, ping_usage) 263 APPLET(ping, ping_main, _BB_DIR_BIN)
250#endif 264#endif
251#ifdef BB_PIVOT_ROOT 265#ifdef BB_PIVOT_ROOT
252 APPLET("pivot_root", pivot_root_main, _BB_DIR_SBIN, pivot_root_usage) 266 APPLET(pivot_root, pivot_root_main, _BB_DIR_SBIN)
253#endif 267#endif
254#ifdef BB_POWEROFF 268#ifdef BB_POWEROFF
255 APPLET("poweroff", poweroff_main, _BB_DIR_SBIN, poweroff_usage) 269 APPLET(poweroff, poweroff_main, _BB_DIR_SBIN)
256#endif 270#endif
257#ifdef BB_PRINTF 271#ifdef BB_PRINTF
258 APPLET("printf", printf_main, _BB_DIR_USR_BIN, printf_usage) 272 APPLET(printf, printf_main, _BB_DIR_USR_BIN)
259#endif 273#endif
260#ifdef BB_PS 274#ifdef BB_PS
261 APPLET("ps", ps_main, _BB_DIR_BIN, ps_usage) 275 APPLET(ps, ps_main, _BB_DIR_BIN)
262#endif 276#endif
263#ifdef BB_PWD 277#ifdef BB_PWD
264 APPLET("pwd", pwd_main, _BB_DIR_BIN, pwd_usage) 278 APPLET(pwd, pwd_main, _BB_DIR_BIN)
265#endif 279#endif
266#ifdef BB_RDATE 280#ifdef BB_RDATE
267 APPLET("rdate", rdate_main, _BB_DIR_USR_BIN, rdate_usage) 281 APPLET(rdate, rdate_main, _BB_DIR_USR_BIN)
268#endif 282#endif
269#ifdef BB_READLINK 283#ifdef BB_READLINK
270 APPLET("readlink", readlink_main, _BB_DIR_USR_BIN, readlink_usage) 284 APPLET(readlink, readlink_main, _BB_DIR_USR_BIN)
271#endif 285#endif
272#ifdef BB_REBOOT 286#ifdef BB_REBOOT
273 APPLET("reboot", reboot_main, _BB_DIR_SBIN, reboot_usage) 287 APPLET(reboot, reboot_main, _BB_DIR_SBIN)
274#endif 288#endif
275#ifdef BB_RENICE 289#ifdef BB_RENICE
276 APPLET("renice", renice_main, _BB_DIR_USR_BIN, renice_usage) 290 APPLET(renice, renice_main, _BB_DIR_USR_BIN)
277#endif 291#endif
278#ifdef BB_RESET 292#ifdef BB_RESET
279 APPLET("reset", reset_main, _BB_DIR_USR_BIN, reset_usage) 293 APPLET(reset, reset_main, _BB_DIR_USR_BIN)
280#endif 294#endif
281#ifdef BB_RM 295#ifdef BB_RM
282 APPLET("rm", rm_main, _BB_DIR_BIN, rm_usage) 296 APPLET(rm, rm_main, _BB_DIR_BIN)
283#endif 297#endif
284#ifdef BB_RMDIR 298#ifdef BB_RMDIR
285 APPLET("rmdir", rmdir_main, _BB_DIR_BIN, rmdir_usage) 299 APPLET(rmdir, rmdir_main, _BB_DIR_BIN)
286#endif 300#endif
287#ifdef BB_RMMOD 301#ifdef BB_RMMOD
288 APPLET("rmmod", rmmod_main, _BB_DIR_SBIN, rmmod_usage) 302 APPLET(rmmod, rmmod_main, _BB_DIR_SBIN)
289#endif 303#endif
290#ifdef BB_ROUTE 304#ifdef BB_ROUTE
291 APPLET("route", route_main, _BB_DIR_USR_BIN, route_usage) 305 APPLET(route, route_main, _BB_DIR_USR_BIN)
292#endif 306#endif
293#ifdef BB_RPMUNPACK 307#ifdef BB_RPMUNPACK
294 APPLET("rpmunpack", rpmunpack_main, _BB_DIR_USR_BIN, rpmunpack_usage) 308 APPLET(rpmunpack, rpmunpack_main, _BB_DIR_USR_BIN)
295#endif 309#endif
296#ifdef BB_SED 310#ifdef BB_SED
297 APPLET("sed", sed_main, _BB_DIR_BIN, sed_usage) 311 APPLET(sed, sed_main, _BB_DIR_BIN)
298#endif 312#endif
299#ifdef BB_SETKEYCODES 313#ifdef BB_SETKEYCODES
300 APPLET("setkeycodes", setkeycodes_main, _BB_DIR_USR_BIN, setkeycodes_usage) 314 APPLET(setkeycodes, setkeycodes_main, _BB_DIR_USR_BIN)
301#endif 315#endif
302#ifdef BB_SH 316#ifdef BB_SH
303 APPLET("sh", shell_main, _BB_DIR_BIN, shell_usage) 317 APPLET(sh, shell_main, _BB_DIR_BIN)
304#endif 318#endif
305#ifdef BB_SLEEP 319#ifdef BB_SLEEP
306 APPLET("sleep", sleep_main, _BB_DIR_BIN, sleep_usage) 320 APPLET(sleep, sleep_main, _BB_DIR_BIN)
307#endif 321#endif
308#ifdef BB_SORT 322#ifdef BB_SORT
309 APPLET("sort", sort_main, _BB_DIR_USR_BIN, sort_usage) 323 APPLET(sort, sort_main, _BB_DIR_USR_BIN)
310#endif 324#endif
311#ifdef BB_STTY 325#ifdef BB_STTY
312 APPLET("stty", stty_main, _BB_DIR_BIN, stty_usage) 326 APPLET(stty, stty_main, _BB_DIR_BIN)
313#endif 327#endif
314#ifdef BB_SWAPONOFF 328#ifdef BB_SWAPONOFF
315 APPLET("swapoff", swap_on_off_main, _BB_DIR_SBIN, swapoff_usage) 329 APPLET(swapoff, swap_on_off_main, _BB_DIR_SBIN)
316#endif 330#endif
317#ifdef BB_SWAPONOFF 331#ifdef BB_SWAPONOFF
318 APPLET("swapon", swap_on_off_main, _BB_DIR_SBIN, swapon_usage) 332 APPLET(swapon, swap_on_off_main, _BB_DIR_SBIN)
319#endif 333#endif
320#ifdef BB_SYNC 334#ifdef BB_SYNC
321 APPLET("sync", sync_main, _BB_DIR_BIN, sync_usage) 335 APPLET(sync, sync_main, _BB_DIR_BIN)
322#endif 336#endif
323#ifdef BB_SYSLOGD 337#ifdef BB_SYSLOGD
324 APPLET("syslogd", syslogd_main, _BB_DIR_SBIN, syslogd_usage) 338 APPLET(syslogd, syslogd_main, _BB_DIR_SBIN)
325#endif 339#endif
326#ifdef BB_TAIL 340#ifdef BB_TAIL
327 APPLET("tail", tail_main, _BB_DIR_USR_BIN, tail_usage) 341 APPLET(tail, tail_main, _BB_DIR_USR_BIN)
328#endif 342#endif
329#ifdef BB_TAR 343#ifdef BB_TAR
330 APPLET("tar", tar_main, _BB_DIR_BIN, tar_usage) 344 APPLET(tar, tar_main, _BB_DIR_BIN)
331#endif 345#endif
332#ifdef BB_TEE 346#ifdef BB_TEE
333 APPLET("tee", tee_main, _BB_DIR_USR_BIN, tee_usage) 347 APPLET(tee, tee_main, _BB_DIR_USR_BIN)
334#endif 348#endif
335#ifdef BB_TELNET 349#ifdef BB_TELNET
336 APPLET("telnet", telnet_main, _BB_DIR_USR_BIN, telnet_usage) 350 APPLET(telnet, telnet_main, _BB_DIR_USR_BIN)
337#endif 351#endif
338#ifdef BB_TEST 352#ifdef BB_TEST
339 APPLET("test", test_main, _BB_DIR_USR_BIN, test_usage) 353 APPLET(test, test_main, _BB_DIR_USR_BIN)
340#endif 354#endif
341#ifdef BB_TOUCH 355#ifdef BB_TOUCH
342 APPLET("touch", touch_main, _BB_DIR_BIN, touch_usage) 356 APPLET(touch, touch_main, _BB_DIR_BIN)
343#endif 357#endif
344#ifdef BB_TR 358#ifdef BB_TR
345 APPLET("tr", tr_main, _BB_DIR_USR_BIN, tr_usage) 359 APPLET(tr, tr_main, _BB_DIR_USR_BIN)
346#endif 360#endif
347#ifdef BB_TRUE_FALSE 361#ifdef BB_TRUE_FALSE
348 APPLET("true", true_main, _BB_DIR_BIN, true_usage) 362 APPLET(true, true_main, _BB_DIR_BIN)
349#endif 363#endif
350#ifdef BB_TTY 364#ifdef BB_TTY
351 APPLET("tty", tty_main, _BB_DIR_USR_BIN, tty_usage) 365 APPLET(tty, tty_main, _BB_DIR_USR_BIN)
352#endif 366#endif
353#ifdef BB_UMOUNT 367#ifdef BB_UMOUNT
354 APPLET("umount", umount_main, _BB_DIR_BIN, umount_usage) 368 APPLET(umount, umount_main, _BB_DIR_BIN)
355#endif 369#endif
356#ifdef BB_UNAME 370#ifdef BB_UNAME
357 APPLET("uname", uname_main, _BB_DIR_BIN, uname_usage) 371 APPLET(uname, uname_main, _BB_DIR_BIN)
358#endif 372#endif
359#ifdef BB_UNIQ 373#ifdef BB_UNIQ
360 APPLET("uniq", uniq_main, _BB_DIR_USR_BIN, uniq_usage) 374 APPLET(uniq, uniq_main, _BB_DIR_USR_BIN)
361#endif 375#endif
362#ifdef BB_UNIX2DOS 376#ifdef BB_UNIX2DOS
363 APPLET("unix2dos", unix2dos_main, _BB_DIR_USR_BIN, unix2dos_usage) 377 APPLET(unix2dos, unix2dos_main, _BB_DIR_USR_BIN)
364#endif 378#endif
365#ifdef BB_UPDATE 379#ifdef BB_UPDATE
366 APPLET("update", update_main, _BB_DIR_SBIN, update_usage) 380 APPLET(update, update_main, _BB_DIR_SBIN)
367#endif 381#endif
368#ifdef BB_UPTIME 382#ifdef BB_UPTIME
369 APPLET("uptime", uptime_main, _BB_DIR_USR_BIN, uptime_usage) 383 APPLET(uptime, uptime_main, _BB_DIR_USR_BIN)
370#endif 384#endif
371#ifdef BB_USLEEP 385#ifdef BB_USLEEP
372 APPLET("usleep", usleep_main, _BB_DIR_BIN, usleep_usage) 386 APPLET(usleep, usleep_main, _BB_DIR_BIN)
373#endif 387#endif
374#ifdef BB_UUDECODE 388#ifdef BB_UUDECODE
375 APPLET("uudecode", uudecode_main, _BB_DIR_USR_BIN, uudecode_usage) 389 APPLET(uudecode, uudecode_main, _BB_DIR_USR_BIN)
376#endif 390#endif
377#ifdef BB_UUENCODE 391#ifdef BB_UUENCODE
378 APPLET("uuencode", uuencode_main, _BB_DIR_USR_BIN, uuencode_usage) 392 APPLET(uuencode, uuencode_main, _BB_DIR_USR_BIN)
379#endif 393#endif
380#ifdef BB_WATCHDOG 394#ifdef BB_WATCHDOG
381 APPLET("watchdog", watchdog_main, _BB_DIR_SBIN, watchdog_usage) 395 APPLET(watchdog, watchdog_main, _BB_DIR_SBIN)
382#endif 396#endif
383#ifdef BB_WC 397#ifdef BB_WC
384 APPLET("wc", wc_main, _BB_DIR_USR_BIN, wc_usage) 398 APPLET(wc, wc_main, _BB_DIR_USR_BIN)
385#endif 399#endif
386#ifdef BB_WGET 400#ifdef BB_WGET
387 APPLET("wget", wget_main, _BB_DIR_USR_BIN, wget_usage) 401 APPLET(wget, wget_main, _BB_DIR_USR_BIN)
388#endif 402#endif
389#ifdef BB_WHICH 403#ifdef BB_WHICH
390 APPLET("which", which_main, _BB_DIR_USR_BIN, which_usage) 404 APPLET(which, which_main, _BB_DIR_USR_BIN)
391#endif 405#endif
392#ifdef BB_WHOAMI 406#ifdef BB_WHOAMI
393 APPLET("whoami", whoami_main, _BB_DIR_USR_BIN, whoami_usage) 407 APPLET(whoami, whoami_main, _BB_DIR_USR_BIN)
394#endif 408#endif
395#ifdef BB_XARGS 409#ifdef BB_XARGS
396 APPLET("xargs", xargs_main, _BB_DIR_USR_BIN, xargs_usage) 410 APPLET(xargs, xargs_main, _BB_DIR_USR_BIN)
397#endif 411#endif
398#ifdef BB_YES 412#ifdef BB_YES
399 APPLET("yes", yes_main, _BB_DIR_USR_BIN, yes_usage) 413 APPLET(yes, yes_main, _BB_DIR_USR_BIN)
400#endif 414#endif
401#ifdef BB_GUNZIP 415#ifdef BB_GUNZIP
402 APPLET("zcat", gunzip_main, _BB_DIR_BIN, gunzip_usage) 416 APPLET(zcat, gunzip_main, _BB_DIR_BIN)
403#endif 417#endif
404 418
405#if !defined(PROTOTYPES) && !defined(MAKE_LINKS) 419#if !defined(PROTOTYPES) && !defined(MAKE_LINKS) && !defined(APPLET_ENUM)
406 { 0,NULL,0,NULL} 420 { 0,NULL,0,-1}
407}; 421};
408 422
409/* The -1 arises because of the {0,NULL,0,NULL} entry above. */ 423/* The -1 arises because of the {0,NULL,0,-1} entry above. */
410size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1); 424size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
411 425
412#endif 426#endif
diff --git a/include/busybox.h b/include/busybox.h
index 39580b548..aef537b2b 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -72,7 +72,7 @@ struct BB_applet {
72 const char* name; 72 const char* name;
73 int (*main)(int argc, char** argv); 73 int (*main)(int argc, char** argv);
74 enum Location location; 74 enum Location location;
75 const char* usage; 75 int usage_index;
76}; 76};
77/* From busybox.c */ 77/* From busybox.c */
78extern const struct BB_applet applets[]; 78extern const struct BB_applet applets[];
@@ -87,9 +87,15 @@ extern const struct BB_applet applets[];
87#include "applets.h" 87#include "applets.h"
88#undef PROTOTYPES 88#undef PROTOTYPES
89 89
90#define APPLET_ENUM
91enum APPLET_INDEX_NUMBERS {
92#include "applets.h"
93};
94#undef APPLET_ENUM
95
90extern const char *applet_name; 96extern const char *applet_name;
91 97
92extern void usage(const char *usage) __attribute__ ((noreturn)); 98extern void show_usage(void) __attribute__ ((noreturn));
93extern void error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); 99extern void error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
94extern void error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); 100extern void error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
95extern void perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); 101extern void perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
@@ -153,6 +159,7 @@ extern FILE *wfopen(const char *path, const char *mode);
153extern FILE *xfopen(const char *path, const char *mode); 159extern FILE *xfopen(const char *path, const char *mode);
154extern void chomp(char *s); 160extern void chomp(char *s);
155extern struct BB_applet *find_applet_by_name(const char *name); 161extern struct BB_applet *find_applet_by_name(const char *name);
162void run_applet_by_name(const char *name, int argc, char **argv);
156 163
157#ifndef DMALLOC 164#ifndef DMALLOC
158extern void *xmalloc (size_t size); 165extern void *xmalloc (size_t size);
diff --git a/init.c b/init.c
index a1c6aec3a..9c96726d9 100644
--- a/init.c
+++ b/init.c
@@ -937,9 +937,7 @@ extern int init_main(int argc, char **argv)
937#endif 937#endif
938 ) 938 )
939 { 939 {
940 usage("init\n\nInit is the parent of all processes.\n\n" 940 show_usage();
941 "This version of init is designed to be run only "
942 "by the kernel.");
943 } 941 }
944 /* Set up sig handlers -- be sure to 942 /* Set up sig handlers -- be sure to
945 * clear all of these in run() */ 943 * clear all of these in run() */
diff --git a/init/init.c b/init/init.c
index a1c6aec3a..9c96726d9 100644
--- a/init/init.c
+++ b/init/init.c
@@ -937,9 +937,7 @@ extern int init_main(int argc, char **argv)
937#endif 937#endif
938 ) 938 )
939 { 939 {
940 usage("init\n\nInit is the parent of all processes.\n\n" 940 show_usage();
941 "This version of init is designed to be run only "
942 "by the kernel.");
943 } 941 }
944 /* Set up sig handlers -- be sure to 942 /* Set up sig handlers -- be sure to
945 * clear all of these in run() */ 943 * clear all of these in run() */
diff --git a/insmod.c b/insmod.c
index e55d9fafb..0da0a3962 100644
--- a/insmod.c
+++ b/insmod.c
@@ -81,7 +81,7 @@
81#ifndef MODUTILS_MODULE_H 81#ifndef MODUTILS_MODULE_H
82static const int MODUTILS_MODULE_H = 1; 82static const int MODUTILS_MODULE_H = 1;
83 83
84#ident "$Id: insmod.c,v 1.45 2001/01/31 19:00:21 kraai Exp $" 84#ident "$Id: insmod.c,v 1.46 2001/02/14 21:23:06 andersen Exp $"
85 85
86/* This file contains the structures used by the 2.0 and 2.1 kernels. 86/* This file contains the structures used by the 2.0 and 2.1 kernels.
87 We do not use the kernel headers directly because we do not wish 87 We do not use the kernel headers directly because we do not wish
@@ -287,7 +287,7 @@ int delete_module(const char *);
287#ifndef MODUTILS_OBJ_H 287#ifndef MODUTILS_OBJ_H
288static const int MODUTILS_OBJ_H = 1; 288static const int MODUTILS_OBJ_H = 1;
289 289
290#ident "$Id: insmod.c,v 1.45 2001/01/31 19:00:21 kraai Exp $" 290#ident "$Id: insmod.c,v 1.46 2001/02/14 21:23:06 andersen Exp $"
291 291
292/* The relocatable object is manipulated using elfin types. */ 292/* The relocatable object is manipulated using elfin types. */
293 293
@@ -2916,12 +2916,12 @@ extern int insmod_main( int argc, char **argv)
2916 * loading the same module 50 times concurrently. */ 2916 * loading the same module 50 times concurrently. */
2917 break; 2917 break;
2918 default: 2918 default:
2919 usage(insmod_usage); 2919 show_usage();
2920 } 2920 }
2921 } 2921 }
2922 2922
2923 if (argv[optind] == NULL) { 2923 if (argv[optind] == NULL) {
2924 usage(insmod_usage); 2924 show_usage();
2925 } 2925 }
2926 2926
2927 /* Grab the module name */ 2927 /* Grab the module name */
diff --git a/kill.c b/kill.c
index 00a4d5c40..bdd22b52d 100644
--- a/kill.c
+++ b/kill.c
@@ -124,22 +124,19 @@ const struct signal_name signames[] = {
124extern int kill_main(int argc, char **argv) 124extern int kill_main(int argc, char **argv)
125{ 125{
126 int whichApp, sig = SIGTERM; 126 int whichApp, sig = SIGTERM;
127 const char *appUsage;
128 127
129#ifdef BB_KILLALL 128#ifdef BB_KILLALL
130 /* Figure out what we are trying to do here */ 129 /* Figure out what we are trying to do here */
131 whichApp = (strcmp(applet_name, "killall") == 0)? KILLALL : KILL; 130 whichApp = (strcmp(applet_name, "killall") == 0)? KILLALL : KILL;
132 appUsage = (whichApp == KILLALL)? killall_usage : kill_usage;
133#else 131#else
134 whichApp = KILL; 132 whichApp = KILL;
135 appUsage = kill_usage;
136#endif 133#endif
137 134
138 argc--; 135 argc--;
139 argv++; 136 argv++;
140 /* Parse any options */ 137 /* Parse any options */
141 if (argc < 1) 138 if (argc < 1)
142 usage(appUsage); 139 show_usage();
143 140
144 while (argc > 0 && **argv == '-') { 141 while (argc > 0 && **argv == '-') {
145 while (*++(*argv)) { 142 while (*++(*argv)) {
@@ -163,7 +160,7 @@ extern int kill_main(int argc, char **argv)
163 } 160 }
164 break; 161 break;
165 case '-': 162 case '-':
166 usage(appUsage); 163 show_usage();
167 default: 164 default:
168 { 165 {
169 if (isdigit(**argv)) { 166 if (isdigit(**argv)) {
diff --git a/lash.c b/lash.c
index b1a7b93cf..9519538dc 100644
--- a/lash.c
+++ b/lash.c
@@ -1370,7 +1370,6 @@ static int pseudo_exec(struct child_prog *child)
1370{ 1370{
1371 struct built_in_command *x; 1371 struct built_in_command *x;
1372#ifdef BB_FEATURE_SH_STANDALONE_SHELL 1372#ifdef BB_FEATURE_SH_STANDALONE_SHELL
1373 struct BB_applet *applet;
1374 char *name; 1373 char *name;
1375#endif 1374#endif
1376 1375
@@ -1415,14 +1414,12 @@ static int pseudo_exec(struct child_prog *child)
1415 name = get_last_path_component(name); 1414 name = get_last_path_component(name);
1416#endif 1415#endif
1417 1416
1418 /* Do a binary search to find the applet entry given the name. */ 1417 {
1419 if ((applet = find_applet_by_name(name)) != NULL) { 1418 char** argv=child->argv;
1420 int argc_l; 1419 int argc_l;
1421 char** argv=child->argv; 1420 for(argc_l=0;*argv!=NULL; argv++, argc_l++);
1422 for(argc_l=0;*argv!=NULL; argv++, argc_l++); 1421 optind = 1;
1423 applet_name=applet->name; 1422 run_applet_by_name(name, argc_l, child->argv);
1424 optind = 1;
1425 exit((*(applet->main)) (argc_l, child->argv));
1426 } 1423 }
1427#endif 1424#endif
1428 1425
@@ -1750,7 +1747,7 @@ int shell_main(int argc_l, char **argv_l)
1750 interactive = TRUE; 1747 interactive = TRUE;
1751 break; 1748 break;
1752 default: 1749 default:
1753 usage(shell_usage); 1750 show_usage();
1754 } 1751 }
1755 } 1752 }
1756 /* A shell is interactive if the `-i' flag was given, or if all of 1753 /* A shell is interactive if the `-i' flag was given, or if all of
diff --git a/length.c b/length.c
index 1ab4e3a58..9119adca8 100644
--- a/length.c
+++ b/length.c
@@ -7,7 +7,7 @@
7extern int length_main(int argc, char **argv) 7extern int length_main(int argc, char **argv)
8{ 8{
9 if (argc != 2 || **(argv + 1) == '-') 9 if (argc != 2 || **(argv + 1) == '-')
10 usage(length_usage); 10 show_usage();
11 printf("%lu\n", (long)strlen(argv[1])); 11 printf("%lu\n", (long)strlen(argv[1]));
12 return EXIT_SUCCESS; 12 return EXIT_SUCCESS;
13} 13}
diff --git a/ln.c b/ln.c
index 54e81f4c5..9dc7f5d8c 100644
--- a/ln.c
+++ b/ln.c
@@ -101,7 +101,7 @@ extern int ln_main(int argc, char **argv)
101 flag |= LN_NODEREFERENCE; 101 flag |= LN_NODEREFERENCE;
102 break; 102 break;
103 default: 103 default:
104 usage(ln_usage); 104 show_usage();
105 } 105 }
106 } 106 }
107 while(optind<(argc-1)) { 107 while(optind<(argc-1)) {
diff --git a/loadacm.c b/loadacm.c
index 345a2773c..6422137a1 100644
--- a/loadacm.c
+++ b/loadacm.c
@@ -34,7 +34,7 @@ int loadacm_main(int argc, char **argv)
34 int fd; 34 int fd;
35 35
36 if (argc>=2 && *argv[1]=='-') { 36 if (argc>=2 && *argv[1]=='-') {
37 usage(loadacm_usage); 37 show_usage();
38 } 38 }
39 39
40 fd = open("/dev/tty", O_RDWR); 40 fd = open("/dev/tty", O_RDWR);
diff --git a/loadfont.c b/loadfont.c
index ec3e50560..d7bd7e8f5 100644
--- a/loadfont.c
+++ b/loadfont.c
@@ -44,7 +44,7 @@ extern int loadfont_main(int argc, char **argv)
44 int fd; 44 int fd;
45 45
46 if (argc != 1) 46 if (argc != 1)
47 usage(loadfont_usage); 47 show_usage();
48 48
49 fd = open("/dev/tty0", O_RDWR); 49 fd = open("/dev/tty0", O_RDWR);
50 if (fd < 0) 50 if (fd < 0)
diff --git a/loadkmap.c b/loadkmap.c
index a98601aec..5ecd819f9 100644
--- a/loadkmap.c
+++ b/loadkmap.c
@@ -51,7 +51,7 @@ int loadkmap_main(int argc, char **argv)
51 char flags[MAX_NR_KEYMAPS], buff[7]; 51 char flags[MAX_NR_KEYMAPS], buff[7];
52 52
53 if (argc != 1) 53 if (argc != 1)
54 usage(loadkmap_usage); 54 show_usage();
55 55
56 fd = open("/dev/tty0", O_RDWR); 56 fd = open("/dev/tty0", O_RDWR);
57 if (fd < 0) 57 if (fd < 0)
diff --git a/logger.c b/logger.c
index 85c63b8a5..352bde158 100644
--- a/logger.c
+++ b/logger.c
@@ -122,7 +122,7 @@ extern int logger_main(int argc, char **argv)
122 strncpy(name, optarg, sizeof(name)); 122 strncpy(name, optarg, sizeof(name));
123 break; 123 break;
124 default: 124 default:
125 usage(logger_usage); 125 show_usage();
126 } 126 }
127 } 127 }
128 128
diff --git a/logname.c b/logname.c
index d9056c69d..a1887aaf9 100644
--- a/logname.c
+++ b/logname.c
@@ -30,7 +30,7 @@ extern int logname_main(int argc, char **argv)
30 char user[9]; 30 char user[9];
31 31
32 if (argc > 1) 32 if (argc > 1)
33 usage(logname_usage); 33 show_usage();
34 34
35 my_getpwuid(user, geteuid()); 35 my_getpwuid(user, geteuid());
36 if (*user) { 36 if (*user) {
diff --git a/ls.c b/ls.c
index 42b24456a..06e23e612 100644
--- a/ls.c
+++ b/ls.c
@@ -928,5 +928,5 @@ extern int ls_main(int argc, char **argv)
928 return(status); 928 return(status);
929 929
930 print_usage_message: 930 print_usage_message:
931 usage(ls_usage); 931 show_usage();
932} 932}
diff --git a/makedevs.c b/makedevs.c
index f979871bd..eed3968c8 100644
--- a/makedevs.c
+++ b/makedevs.c
@@ -32,7 +32,7 @@ int makedevs_main(int argc, char **argv)
32 char buf[255]; 32 char buf[255];
33 33
34 if (argc < 7 || *argv[1]=='-') 34 if (argc < 7 || *argv[1]=='-')
35 usage(makedevs_usage); 35 show_usage();
36 36
37 switch (type[0]) { 37 switch (type[0]) {
38 case 'c': 38 case 'c':
@@ -45,7 +45,7 @@ int makedevs_main(int argc, char **argv)
45 mode = S_IFIFO; 45 mode = S_IFIFO;
46 break; 46 break;
47 default: 47 default:
48 usage(makedevs_usage); 48 show_usage();
49 } 49 }
50 mode |= 0660; 50 mode |= 0660;
51 51
diff --git a/md5sum.c b/md5sum.c
index 97a940059..3decafdf4 100644
--- a/md5sum.c
+++ b/md5sum.c
@@ -850,7 +850,7 @@ int md5sum_main(int argc,
850 break; 850 break;
851 851
852 default: 852 default:
853 usage(md5sum_usage); 853 show_usage();
854 } 854 }
855 } 855 }
856 856
diff --git a/miscutils/dc.c b/miscutils/dc.c
index 122673a95..1e34574ed 100644
--- a/miscutils/dc.c
+++ b/miscutils/dc.c
@@ -169,7 +169,7 @@ int dc_main(int argc, char **argv)
169 } 169 }
170 } else { 170 } else {
171 if (*argv[1]=='-') 171 if (*argv[1]=='-')
172 usage(dc_usage); 172 show_usage();
173 while (argc >= 2) { 173 while (argc >= 2) {
174 stack_machine(argv[1]); 174 stack_machine(argv[1]);
175 argv++; 175 argv++;
diff --git a/miscutils/dutmp.c b/miscutils/dutmp.c
index 7e1d2eed7..2e6b3c056 100644
--- a/miscutils/dutmp.c
+++ b/miscutils/dutmp.c
@@ -33,7 +33,7 @@ extern int dutmp_main(int argc, char **argv)
33 if (argc<2) { 33 if (argc<2) {
34 file = fileno(stdin); 34 file = fileno(stdin);
35 } else if (*argv[1] == '-' ) { 35 } else if (*argv[1] == '-' ) {
36 usage(dutmp_usage); 36 show_usage();
37 } else { 37 } else {
38 file = open(argv[1], O_RDONLY); 38 file = open(argv[1], O_RDONLY);
39 if (file < 0) { 39 if (file < 0) {
@@ -45,7 +45,7 @@ extern int dutmp_main(int argc, char **argv)
45 * fact the stupid libc doesn't have a reliable #define to announce that libc5 45 * fact the stupid libc doesn't have a reliable #define to announce that libc5
46 * is being used. sigh. 46 * is being used. sigh.
47 */ 47 */
48#if ! defined __GLIBC__ 48#if ! defined __GLIBC__ || defined __UCLIBC__
49 while (read(file, (void*)&ut, sizeof(struct utmp))) { 49 while (read(file, (void*)&ut, sizeof(struct utmp))) {
50 printf("%d|%d|%s|%s|%s|%s|%s|%lx\n", 50 printf("%d|%d|%s|%s|%s|%s|%s|%lx\n",
51 ut.ut_type, ut.ut_pid, ut.ut_line, 51 ut.ut_type, ut.ut_pid, ut.ut_line,
diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c
index f979871bd..eed3968c8 100644
--- a/miscutils/makedevs.c
+++ b/miscutils/makedevs.c
@@ -32,7 +32,7 @@ int makedevs_main(int argc, char **argv)
32 char buf[255]; 32 char buf[255];
33 33
34 if (argc < 7 || *argv[1]=='-') 34 if (argc < 7 || *argv[1]=='-')
35 usage(makedevs_usage); 35 show_usage();
36 36
37 switch (type[0]) { 37 switch (type[0]) {
38 case 'c': 38 case 'c':
@@ -45,7 +45,7 @@ int makedevs_main(int argc, char **argv)
45 mode = S_IFIFO; 45 mode = S_IFIFO;
46 break; 46 break;
47 default: 47 default:
48 usage(makedevs_usage); 48 show_usage();
49 } 49 }
50 mode |= 0660; 50 mode |= 0660;
51 51
diff --git a/miscutils/mktemp.c b/miscutils/mktemp.c
index 3b9f2b22c..b3522026e 100644
--- a/miscutils/mktemp.c
+++ b/miscutils/mktemp.c
@@ -31,7 +31,7 @@
31extern int mktemp_main(int argc, char **argv) 31extern int mktemp_main(int argc, char **argv)
32{ 32{
33 if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q"))) 33 if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q")))
34 usage(mktemp_usage); 34 show_usage();
35 if(mkstemp(argv[argc-1]) < 0) 35 if(mkstemp(argv[argc-1]) < 0)
36 return EXIT_FAILURE; 36 return EXIT_FAILURE;
37 (void) puts(argv[argc-1]); 37 (void) puts(argv[argc-1]);
diff --git a/miscutils/mt.c b/miscutils/mt.c
index 683804b5a..eb93cb234 100644
--- a/miscutils/mt.c
+++ b/miscutils/mt.c
@@ -57,12 +57,12 @@ extern int mt_main(int argc, char **argv)
57 int fd; 57 int fd;
58 58
59 if (argc < 2) { 59 if (argc < 2) {
60 usage(mt_usage); 60 show_usage();
61 } 61 }
62 62
63 if (strcmp(argv[1], "-f") == 0) { 63 if (strcmp(argv[1], "-f") == 0) {
64 if (argc < 4) { 64 if (argc < 4) {
65 usage(mt_usage); 65 show_usage();
66 } 66 }
67 file = argv[2]; 67 file = argv[2];
68 argv += 2; 68 argv += 2;
diff --git a/miscutils/readlink.c b/miscutils/readlink.c
index 57f43d174..c82f64027 100644
--- a/miscutils/readlink.c
+++ b/miscutils/readlink.c
@@ -33,7 +33,7 @@ int readlink_main(int argc, char **argv)
33 int bufsize = 128, size = 128; 33 int bufsize = 128, size = 128;
34 34
35 if (argc != 2) 35 if (argc != 2)
36 usage(readlink_usage); 36 show_usage();
37 37
38 while (bufsize < size + 1) { 38 while (bufsize < size + 1) {
39 bufsize *= 2; 39 bufsize *= 2;
diff --git a/miscutils/update.c b/miscutils/update.c
index 309ce0cbd..2cf4a98b2 100644
--- a/miscutils/update.c
+++ b/miscutils/update.c
@@ -64,7 +64,7 @@ extern int update_main(int argc, char **argv)
64 flush_duration = atoi(optarg); 64 flush_duration = atoi(optarg);
65 break; 65 break;
66 default: 66 default:
67 usage(update_usage); 67 show_usage();
68 } 68 }
69 } 69 }
70 70
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c
index 7026cc005..65d0fc35f 100644
--- a/miscutils/watchdog.c
+++ b/miscutils/watchdog.c
@@ -31,7 +31,7 @@ extern int watchdog_main(int argc, char **argv)
31 int fd; 31 int fd;
32 32
33 if (argc != 2) { 33 if (argc != 2) {
34 usage(watchdog_usage); 34 show_usage();
35 } 35 }
36 36
37 if ((fd=open(argv[1], O_WRONLY)) == -1) { 37 if ((fd=open(argv[1], O_WRONLY)) == -1) {
diff --git a/mkdir.c b/mkdir.c
index 299f29806..285d34f12 100644
--- a/mkdir.c
+++ b/mkdir.c
@@ -48,7 +48,7 @@ extern int mkdir_main(int argc, char **argv)
48 switch (**argv) { 48 switch (**argv) {
49 case 'm': 49 case 'm':
50 if (--argc == 0) 50 if (--argc == 0)
51 usage(mkdir_usage); 51 show_usage();
52 /* Find the specified modes */ 52 /* Find the specified modes */
53 mode = 0; 53 mode = 0;
54 if (parse_mode(*(++argv), &mode) == FALSE) { 54 if (parse_mode(*(++argv), &mode) == FALSE) {
@@ -63,7 +63,7 @@ extern int mkdir_main(int argc, char **argv)
63 parentFlag = TRUE; 63 parentFlag = TRUE;
64 break; 64 break;
65 default: 65 default:
66 usage(mkdir_usage); 66 show_usage();
67 } 67 }
68 } 68 }
69 argc--; 69 argc--;
@@ -71,7 +71,7 @@ extern int mkdir_main(int argc, char **argv)
71 } 71 }
72 72
73 if (argc < 1) { 73 if (argc < 1) {
74 usage(mkdir_usage); 74 show_usage();
75 } 75 }
76 76
77 while (argc > 0) { 77 while (argc > 0) {
diff --git a/mkfifo.c b/mkfifo.c
index b31e6f172..56a04f772 100644
--- a/mkfifo.c
+++ b/mkfifo.c
@@ -37,7 +37,7 @@ extern int mkfifo_main(int argc, char **argv)
37 /* Parse any options */ 37 /* Parse any options */
38 while (argc > 1) { 38 while (argc > 1) {
39 if (**argv != '-') 39 if (**argv != '-')
40 usage(mkfifo_usage); 40 show_usage();
41 thisarg = *argv; 41 thisarg = *argv;
42 thisarg++; 42 thisarg++;
43 switch (*thisarg) { 43 switch (*thisarg) {
@@ -47,13 +47,13 @@ extern int mkfifo_main(int argc, char **argv)
47 parse_mode(*argv, &mode); 47 parse_mode(*argv, &mode);
48 break; 48 break;
49 default: 49 default:
50 usage(mkfifo_usage); 50 show_usage();
51 } 51 }
52 argc--; 52 argc--;
53 argv++; 53 argv++;
54 } 54 }
55 if (argc < 1 || *argv[0] == '-') 55 if (argc < 1 || *argv[0] == '-')
56 usage(mkfifo_usage); 56 show_usage();
57 if (mkfifo(*argv, mode) < 0) 57 if (mkfifo(*argv, mode) < 0)
58 perror_msg_and_die("mkfifo"); 58 perror_msg_and_die("mkfifo");
59 return EXIT_SUCCESS; 59 return EXIT_SUCCESS;
diff --git a/mkfs_minix.c b/mkfs_minix.c
index 9b40faac6..6b4a3e2d1 100644
--- a/mkfs_minix.c
+++ b/mkfs_minix.c
@@ -255,13 +255,6 @@ static inline int bit(char * a,unsigned int i)
255#define mark_zone(x) (setbit(zone_map,(x)-FIRSTZONE+1)) 255#define mark_zone(x) (setbit(zone_map,(x)-FIRSTZONE+1))
256#define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1)) 256#define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1))
257 257
258static void show_usage() __attribute__ ((noreturn));
259
260static void show_usage()
261{
262 usage(mkfs_minix_usage);
263}
264
265/* 258/*
266 * Check to make certain that our new filesystem won't be created on 259 * Check to make certain that our new filesystem won't be created on
267 * an already mounted partition. Code adapted from mke2fs, Copyright 260 * an already mounted partition. Code adapted from mke2fs, Copyright
diff --git a/mknod.c b/mknod.c
index c761aea6f..73f6e06f1 100644
--- a/mknod.c
+++ b/mknod.c
@@ -53,13 +53,13 @@ int mknod_main(int argc, char **argv)
53 umask(0); 53 umask(0);
54 break; 54 break;
55 default: 55 default:
56 usage(mknod_usage); 56 show_usage();
57 } 57 }
58 argc--; 58 argc--;
59 argv++; 59 argv++;
60 } 60 }
61 if (argc != 4 && argc != 2) { 61 if (argc != 4 && argc != 2) {
62 usage(mknod_usage); 62 show_usage();
63 } 63 }
64 switch (argv[1][0]) { 64 switch (argv[1][0]) {
65 case 'c': 65 case 'c':
@@ -72,11 +72,11 @@ int mknod_main(int argc, char **argv)
72 case 'p': 72 case 'p':
73 mode = S_IFIFO; 73 mode = S_IFIFO;
74 if (argc!=2) { 74 if (argc!=2) {
75 usage(mknod_usage); 75 show_usage();
76 } 76 }
77 break; 77 break;
78 default: 78 default:
79 usage(mknod_usage); 79 show_usage();
80 } 80 }
81 81
82 if (mode == S_IFCHR || mode == S_IFBLK) { 82 if (mode == S_IFCHR || mode == S_IFBLK) {
diff --git a/mkswap.c b/mkswap.c
index 7d690ad99..48637e889 100644
--- a/mkswap.c
+++ b/mkswap.c
@@ -287,7 +287,7 @@ int mkswap_main(int argc, char **argv)
287 287
288 PAGES = strtol(argv[0], &tmp, 0) / blocks_per_page; 288 PAGES = strtol(argv[0], &tmp, 0) / blocks_per_page;
289 if (*tmp) 289 if (*tmp)
290 usage(mkswap_usage); 290 show_usage();
291 } else 291 } else
292 device_name = argv[0]; 292 device_name = argv[0];
293 } else { 293 } else {
@@ -302,13 +302,13 @@ int mkswap_main(int argc, char **argv)
302 version = atoi(argv[0] + 2); 302 version = atoi(argv[0] + 2);
303 break; 303 break;
304 default: 304 default:
305 usage(mkswap_usage); 305 show_usage();
306 } 306 }
307 } 307 }
308 } 308 }
309 if (!device_name) { 309 if (!device_name) {
310 error_msg("error: Nowhere to set up swap on?"); 310 error_msg("error: Nowhere to set up swap on?");
311 usage(mkswap_usage); 311 show_usage();
312 } 312 }
313 sz = get_size(device_name); 313 sz = get_size(device_name);
314 if (!PAGES) { 314 if (!PAGES) {
@@ -331,12 +331,12 @@ int mkswap_main(int argc, char **argv)
331 } 331 }
332 if (version != 0 && version != 1) { 332 if (version != 0 && version != 1) {
333 error_msg("error: unknown version %d", version); 333 error_msg("error: unknown version %d", version);
334 usage(mkswap_usage); 334 show_usage();
335 } 335 }
336 if (PAGES < 10) { 336 if (PAGES < 10) {
337 error_msg("error: swap area needs to be at least %ldkB", 337 error_msg("error: swap area needs to be at least %ldkB",
338 (long) (10 * pagesize / 1024)); 338 (long) (10 * pagesize / 1024));
339 usage(mkswap_usage); 339 show_usage();
340 } 340 }
341#if 0 341#if 0
342 maxpages = ((version == 0) ? V0_MAX_PAGES : V1_MAX_PAGES); 342 maxpages = ((version == 0) ? V0_MAX_PAGES : V1_MAX_PAGES);
diff --git a/mktemp.c b/mktemp.c
index 3b9f2b22c..b3522026e 100644
--- a/mktemp.c
+++ b/mktemp.c
@@ -31,7 +31,7 @@
31extern int mktemp_main(int argc, char **argv) 31extern int mktemp_main(int argc, char **argv)
32{ 32{
33 if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q"))) 33 if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q")))
34 usage(mktemp_usage); 34 show_usage();
35 if(mkstemp(argv[argc-1]) < 0) 35 if(mkstemp(argv[argc-1]) < 0)
36 return EXIT_FAILURE; 36 return EXIT_FAILURE;
37 (void) puts(argv[argc-1]); 37 (void) puts(argv[argc-1]);
diff --git a/modutils/insmod.c b/modutils/insmod.c
index e55d9fafb..0da0a3962 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -81,7 +81,7 @@
81#ifndef MODUTILS_MODULE_H 81#ifndef MODUTILS_MODULE_H
82static const int MODUTILS_MODULE_H = 1; 82static const int MODUTILS_MODULE_H = 1;
83 83
84#ident "$Id: insmod.c,v 1.45 2001/01/31 19:00:21 kraai Exp $" 84#ident "$Id: insmod.c,v 1.46 2001/02/14 21:23:06 andersen Exp $"
85 85
86/* This file contains the structures used by the 2.0 and 2.1 kernels. 86/* This file contains the structures used by the 2.0 and 2.1 kernels.
87 We do not use the kernel headers directly because we do not wish 87 We do not use the kernel headers directly because we do not wish
@@ -287,7 +287,7 @@ int delete_module(const char *);
287#ifndef MODUTILS_OBJ_H 287#ifndef MODUTILS_OBJ_H
288static const int MODUTILS_OBJ_H = 1; 288static const int MODUTILS_OBJ_H = 1;
289 289
290#ident "$Id: insmod.c,v 1.45 2001/01/31 19:00:21 kraai Exp $" 290#ident "$Id: insmod.c,v 1.46 2001/02/14 21:23:06 andersen Exp $"
291 291
292/* The relocatable object is manipulated using elfin types. */ 292/* The relocatable object is manipulated using elfin types. */
293 293
@@ -2916,12 +2916,12 @@ extern int insmod_main( int argc, char **argv)
2916 * loading the same module 50 times concurrently. */ 2916 * loading the same module 50 times concurrently. */
2917 break; 2917 break;
2918 default: 2918 default:
2919 usage(insmod_usage); 2919 show_usage();
2920 } 2920 }
2921 } 2921 }
2922 2922
2923 if (argv[optind] == NULL) { 2923 if (argv[optind] == NULL) {
2924 usage(insmod_usage); 2924 show_usage();
2925 } 2925 }
2926 2926
2927 /* Grab the module name */ 2927 /* Grab the module name */
diff --git a/modutils/rmmod.c b/modutils/rmmod.c
index 3a66af87a..7d4538e6e 100644
--- a/modutils/rmmod.c
+++ b/modutils/rmmod.c
@@ -39,7 +39,7 @@ extern int rmmod_main(int argc, char **argv)
39{ 39{
40 int ret = EXIT_SUCCESS; 40 int ret = EXIT_SUCCESS;
41 if (argc <= 1) { 41 if (argc <= 1) {
42 usage(rmmod_usage); 42 show_usage();
43 } 43 }
44 44
45 /* Parse any options */ 45 /* Parse any options */
@@ -52,7 +52,7 @@ extern int rmmod_main(int argc, char **argv)
52 perror_msg_and_die("rmmod"); 52 perror_msg_and_die("rmmod");
53 return EXIT_SUCCESS; 53 return EXIT_SUCCESS;
54 default: 54 default:
55 usage(rmmod_usage); 55 show_usage();
56 } 56 }
57 } 57 }
58 } 58 }
diff --git a/mount.c b/mount.c
index 79813ba18..2f5bba59d 100644
--- a/mount.c
+++ b/mount.c
@@ -505,5 +505,5 @@ singlemount:
505 goto singlemount; 505 goto singlemount;
506 506
507goodbye: 507goodbye:
508 usage(mount_usage); 508 show_usage();
509} 509}
diff --git a/mt.c b/mt.c
index 683804b5a..eb93cb234 100644
--- a/mt.c
+++ b/mt.c
@@ -57,12 +57,12 @@ extern int mt_main(int argc, char **argv)
57 int fd; 57 int fd;
58 58
59 if (argc < 2) { 59 if (argc < 2) {
60 usage(mt_usage); 60 show_usage();
61 } 61 }
62 62
63 if (strcmp(argv[1], "-f") == 0) { 63 if (strcmp(argv[1], "-f") == 0) {
64 if (argc < 4) { 64 if (argc < 4) {
65 usage(mt_usage); 65 show_usage();
66 } 66 }
67 file = argv[2]; 67 file = argv[2];
68 argv += 2; 68 argv += 2;
diff --git a/nc.c b/nc.c
index 3f512d1cb..8927103e0 100644
--- a/nc.c
+++ b/nc.c
@@ -58,12 +58,12 @@ int nc_main(int argc, char **argv)
58 lport = atoi(optarg); 58 lport = atoi(optarg);
59 break; 59 break;
60 default: 60 default:
61 usage(nc_usage); 61 show_usage();
62 } 62 }
63 } 63 }
64 64
65 if ((do_listen && optind != argc) || (!do_listen && optind + 2 != argc)) 65 if ((do_listen && optind != argc) || (!do_listen && optind + 2 != argc))
66 usage(nc_usage); 66 show_usage();
67 67
68 if ((sfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) 68 if ((sfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
69 perror_msg_and_die("socket"); 69 perror_msg_and_die("socket");
diff --git a/networking/hostname.c b/networking/hostname.c
index ce17ba91c..e1486b365 100644
--- a/networking/hostname.c
+++ b/networking/hostname.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: hostname.c,v 1.23 2001/02/01 16:49:29 kraai Exp $ 3 * $Id: hostname.c,v 1.24 2001/02/14 21:23:06 andersen Exp $
4 * Mini hostname implementation for busybox 4 * Mini hostname implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -66,7 +66,7 @@ int hostname_main(int argc, char **argv)
66 char *s = NULL; 66 char *s = NULL;
67 67
68 if (argc < 1) 68 if (argc < 1)
69 usage(hostname_usage); 69 show_usage();
70 70
71 while (--argc > 0 && **(++argv) == '-') { 71 while (--argc > 0 && **(++argv) == '-') {
72 while (*(++(*argv))) { 72 while (*(++(*argv))) {
@@ -82,18 +82,18 @@ int hostname_main(int argc, char **argv)
82 break; 82 break;
83 case 'F': 83 case 'F':
84 if (--argc == 0) { 84 if (--argc == 0) {
85 usage(hostname_usage); 85 show_usage();
86 } 86 }
87 filename = *(++argv); 87 filename = *(++argv);
88 break; 88 break;
89 case '-': 89 case '-':
90 if (strcmp(++(*argv), "file") || --argc ==0 ) { 90 if (strcmp(++(*argv), "file") || --argc ==0 ) {
91 usage(hostname_usage); 91 show_usage();
92 } 92 }
93 filename = *(++argv); 93 filename = *(++argv);
94 break; 94 break;
95 default: 95 default:
96 usage(hostname_usage); 96 show_usage();
97 } 97 }
98 if (filename != NULL) 98 if (filename != NULL)
99 break; 99 break;
diff --git a/networking/ifconfig.c b/networking/ifconfig.c
index 2134f8a48..66615a2fd 100644
--- a/networking/ifconfig.c
+++ b/networking/ifconfig.c
@@ -15,7 +15,7 @@
15 * Foundation; either version 2 of the License, or (at 15 * Foundation; either version 2 of the License, or (at
16 * your option) any later version. 16 * your option) any later version.
17 * 17 *
18 * $Id: ifconfig.c,v 1.1 2001/02/14 08:11:27 andersen Exp $ 18 * $Id: ifconfig.c,v 1.2 2001/02/14 21:23:06 andersen Exp $
19 * 19 *
20 */ 20 */
21 21
@@ -183,7 +183,7 @@ int ifconfig_main(int argc, char **argv)
183 char host[128]; 183 char host[128];
184 184
185 if(argc < 2) { 185 if(argc < 2) {
186 usage(ifconfig_usage); 186 show_usage();
187 } 187 }
188 188
189 /* Create a channel to the NET kernel. */ 189 /* Create a channel to the NET kernel. */
@@ -269,7 +269,7 @@ int ifconfig_main(int argc, char **argv)
269 269
270 if (!strcmp(*spp, "metric")) { 270 if (!strcmp(*spp, "metric")) {
271 if (*++spp == NULL) 271 if (*++spp == NULL)
272 usage(ifconfig_usage); 272 show_usage();
273 ifr.ifr_metric = atoi(*spp); 273 ifr.ifr_metric = atoi(*spp);
274 if (ioctl(sockfd, SIOCSIFMETRIC, &ifr) < 0) { 274 if (ioctl(sockfd, SIOCSIFMETRIC, &ifr) < 0) {
275 fprintf(stderr, "SIOCSIFMETRIC: %s\n", strerror(errno)); 275 fprintf(stderr, "SIOCSIFMETRIC: %s\n", strerror(errno));
@@ -280,7 +280,7 @@ int ifconfig_main(int argc, char **argv)
280 } 280 }
281 if (!strcmp(*spp, "mtu")) { 281 if (!strcmp(*spp, "mtu")) {
282 if (*++spp == NULL) 282 if (*++spp == NULL)
283 usage(ifconfig_usage); 283 show_usage();
284 ifr.ifr_mtu = atoi(*spp); 284 ifr.ifr_mtu = atoi(*spp);
285 if (ioctl(sockfd, SIOCSIFMTU, &ifr) < 0) { 285 if (ioctl(sockfd, SIOCSIFMTU, &ifr) < 0) {
286 fprintf(stderr, "SIOCSIFMTU: %s\n", strerror(errno)); 286 fprintf(stderr, "SIOCSIFMTU: %s\n", strerror(errno));
@@ -292,7 +292,7 @@ int ifconfig_main(int argc, char **argv)
292#ifdef SIOCSKEEPALIVE 292#ifdef SIOCSKEEPALIVE
293 if (!strcmp(*spp, "keepalive")) { 293 if (!strcmp(*spp, "keepalive")) {
294 if (*++spp == NULL) 294 if (*++spp == NULL)
295 usage(ifconfig_usage); 295 show_usage();
296 ifr.ifr_data = (caddr_t) atoi(*spp); 296 ifr.ifr_data = (caddr_t) atoi(*spp);
297 if (ioctl(sockfd, SIOCSKEEPALIVE, &ifr) < 0) { 297 if (ioctl(sockfd, SIOCSKEEPALIVE, &ifr) < 0) {
298 fprintf(stderr, "SIOCSKEEPALIVE: %s\n", strerror(errno)); 298 fprintf(stderr, "SIOCSKEEPALIVE: %s\n", strerror(errno));
@@ -306,7 +306,7 @@ int ifconfig_main(int argc, char **argv)
306#ifdef SIOCSOUTFILL 306#ifdef SIOCSOUTFILL
307 if (!strcmp(*spp, "outfill")) { 307 if (!strcmp(*spp, "outfill")) {
308 if (*++spp == NULL) 308 if (*++spp == NULL)
309 usage(ifconfig_usage); 309 show_usage();
310 ifr.ifr_data = (caddr_t) atoi(*spp); 310 ifr.ifr_data = (caddr_t) atoi(*spp);
311 if (ioctl(sockfd, SIOCSOUTFILL, &ifr) < 0) { 311 if (ioctl(sockfd, SIOCSOUTFILL, &ifr) < 0) {
312 fprintf(stderr, "SIOCSOUTFILL: %s\n", strerror(errno)); 312 fprintf(stderr, "SIOCSOUTFILL: %s\n", strerror(errno));
@@ -344,7 +344,7 @@ int ifconfig_main(int argc, char **argv)
344 } 344 }
345 if (!strcmp(*spp, "dstaddr")) { 345 if (!strcmp(*spp, "dstaddr")) {
346 if (*++spp == NULL) 346 if (*++spp == NULL)
347 usage(ifconfig_usage); 347 show_usage();
348 safe_strncpy(host, *spp, (sizeof host)); 348 safe_strncpy(host, *spp, (sizeof host));
349 if (INET_resolve(host, &sa) < 0) { 349 if (INET_resolve(host, &sa) < 0) {
350 goterr++; 350 goterr++;
@@ -363,7 +363,7 @@ int ifconfig_main(int argc, char **argv)
363 } 363 }
364 if (!strcmp(*spp, "netmask")) { 364 if (!strcmp(*spp, "netmask")) {
365 if (*++spp == NULL || didnetmask) 365 if (*++spp == NULL || didnetmask)
366 usage(ifconfig_usage); 366 show_usage();
367 safe_strncpy(host, *spp, (sizeof host)); 367 safe_strncpy(host, *spp, (sizeof host));
368 if (INET_resolve(host, &sa) < 0) { 368 if (INET_resolve(host, &sa) < 0) {
369 goterr++; 369 goterr++;
@@ -409,7 +409,7 @@ int ifconfig_main(int argc, char **argv)
409 409
410 if (!strcmp(*spp, "hw")) { 410 if (!strcmp(*spp, "hw")) {
411 if (*++spp == NULL || strcmp("ether", *spp)) { 411 if (*++spp == NULL || strcmp("ether", *spp)) {
412 usage(ifconfig_usage); 412 show_usage();
413 } 413 }
414 414
415 if (*++spp == NULL) { 415 if (*++spp == NULL) {
@@ -438,7 +438,7 @@ int ifconfig_main(int argc, char **argv)
438 safe_strncpy(host, *spp, (sizeof host)); 438 safe_strncpy(host, *spp, (sizeof host));
439 439
440 if (INET_resolve(host, &sa) < 0) { 440 if (INET_resolve(host, &sa) < 0) {
441 usage(ifconfig_usage); 441 show_usage();
442 } 442 }
443 memcpy((char *) &ifr.ifr_addr, 443 memcpy((char *) &ifr.ifr_addr,
444 (char *) &sa, sizeof(struct sockaddr)); 444 (char *) &sa, sizeof(struct sockaddr));
diff --git a/networking/nc.c b/networking/nc.c
index 3f512d1cb..8927103e0 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -58,12 +58,12 @@ int nc_main(int argc, char **argv)
58 lport = atoi(optarg); 58 lport = atoi(optarg);
59 break; 59 break;
60 default: 60 default:
61 usage(nc_usage); 61 show_usage();
62 } 62 }
63 } 63 }
64 64
65 if ((do_listen && optind != argc) || (!do_listen && optind + 2 != argc)) 65 if ((do_listen && optind != argc) || (!do_listen && optind + 2 != argc))
66 usage(nc_usage); 66 show_usage();
67 67
68 if ((sfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) 68 if ((sfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
69 perror_msg_and_die("socket"); 69 perror_msg_and_die("socket");
diff --git a/networking/nslookup.c b/networking/nslookup.c
index 8bfcd5785..33732de68 100644
--- a/networking/nslookup.c
+++ b/networking/nslookup.c
@@ -157,7 +157,7 @@ int nslookup_main(int argc, char **argv)
157 struct hostent *host; 157 struct hostent *host;
158 158
159 if (argc < 2 || *argv[1]=='-') { 159 if (argc < 2 || *argv[1]=='-') {
160 usage(nslookup_usage); 160 show_usage();
161 } 161 }
162 162
163 server_print(); 163 server_print();
@@ -170,4 +170,4 @@ int nslookup_main(int argc, char **argv)
170 return EXIT_SUCCESS; 170 return EXIT_SUCCESS;
171} 171}
172 172
173/* $Id: nslookup.c,v 1.20 2001/01/27 09:33:38 andersen Exp $ */ 173/* $Id: nslookup.c,v 1.21 2001/02/14 21:23:06 andersen Exp $ */
diff --git a/networking/ping.c b/networking/ping.c
index 15611babd..c114fb0b3 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: ping.c,v 1.36 2001/01/31 19:00:21 kraai Exp $ 3 * $Id: ping.c,v 1.37 2001/02/14 21:23:06 andersen Exp $
4 * Mini ping implementation for busybox 4 * Mini ping implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -251,7 +251,7 @@ extern int ping_main(int argc, char **argv)
251 argc--; 251 argc--;
252 argv++; 252 argv++;
253 if (argc < 1) 253 if (argc < 1)
254 usage(ping_usage); 254 show_usage();
255 ping(*argv); 255 ping(*argv);
256 return EXIT_SUCCESS; 256 return EXIT_SUCCESS;
257} 257}
@@ -522,24 +522,24 @@ extern int ping_main(int argc, char **argv)
522 break; 522 break;
523 case 'c': 523 case 'c':
524 if (--argc <= 0) 524 if (--argc <= 0)
525 usage(ping_usage); 525 show_usage();
526 argv++; 526 argv++;
527 pingcount = atoi(*argv); 527 pingcount = atoi(*argv);
528 break; 528 break;
529 case 's': 529 case 's':
530 if (--argc <= 0) 530 if (--argc <= 0)
531 usage(ping_usage); 531 show_usage();
532 argv++; 532 argv++;
533 datalen = atoi(*argv); 533 datalen = atoi(*argv);
534 break; 534 break;
535 default: 535 default:
536 usage(ping_usage); 536 show_usage();
537 } 537 }
538 argc--; 538 argc--;
539 argv++; 539 argv++;
540 } 540 }
541 if (argc < 1) 541 if (argc < 1)
542 usage(ping_usage); 542 show_usage();
543 543
544 myid = getpid() & 0xFFFF; 544 myid = getpid() & 0xFFFF;
545 ping(*argv); 545 ping(*argv);
diff --git a/networking/route.c b/networking/route.c
index 83a0be2d2..3fad81a01 100644
--- a/networking/route.c
+++ b/networking/route.c
@@ -15,7 +15,7 @@
15 * Foundation; either version 2 of the License, or (at 15 * Foundation; either version 2 of the License, or (at
16 * your option) any later version. 16 * your option) any later version.
17 * 17 *
18 * $Id: route.c,v 1.2 2001/02/14 19:26:39 andersen Exp $ 18 * $Id: route.c,v 1.3 2001/02/14 21:23:06 andersen Exp $
19 * 19 *
20 * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> 20 * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
21 */ 21 */
@@ -115,7 +115,7 @@ INET_setroute(int action, int options, char **args)
115 args++; 115 args++;
116 } 116 }
117 if (*args == NULL) 117 if (*args == NULL)
118 usage(route_usage); 118 show_usage();
119 119
120 safe_strncpy(target, *args++, (sizeof target)); 120 safe_strncpy(target, *args++, (sizeof target));
121 121
@@ -152,7 +152,7 @@ INET_setroute(int action, int options, char **args)
152 152
153 args++; 153 args++;
154 if (!*args || !isdigit(**args)) 154 if (!*args || !isdigit(**args))
155 usage(route_usage); 155 show_usage();
156 metric = atoi(*args); 156 metric = atoi(*args);
157#if HAVE_NEW_ADDRT 157#if HAVE_NEW_ADDRT
158 rt.rt_metric = metric + 1; 158 rt.rt_metric = metric + 1;
@@ -168,7 +168,7 @@ INET_setroute(int action, int options, char **args)
168 168
169 args++; 169 args++;
170 if (!*args || mask_in_addr(rt)) 170 if (!*args || mask_in_addr(rt))
171 usage(route_usage); 171 show_usage();
172 safe_strncpy(netmask, *args, (sizeof netmask)); 172 safe_strncpy(netmask, *args, (sizeof netmask));
173 if ((isnet = INET_resolve(netmask, &mask)) < 0) { 173 if ((isnet = INET_resolve(netmask, &mask)) < 0) {
174 fprintf(stderr, "cant resolve netmask %s\n", netmask); 174 fprintf(stderr, "cant resolve netmask %s\n", netmask);
@@ -182,9 +182,9 @@ INET_setroute(int action, int options, char **args)
182 if (!strcmp(*args, "gw") || !strcmp(*args, "gateway")) { 182 if (!strcmp(*args, "gw") || !strcmp(*args, "gateway")) {
183 args++; 183 args++;
184 if (!*args) 184 if (!*args)
185 usage(route_usage); 185 show_usage();
186 if (rt.rt_flags & RTF_GATEWAY) 186 if (rt.rt_flags & RTF_GATEWAY)
187 usage(route_usage); 187 show_usage();
188 safe_strncpy(gateway, *args, (sizeof gateway)); 188 safe_strncpy(gateway, *args, (sizeof gateway));
189 if ((isnet = INET_resolve(gateway, &rt.rt_gateway)) < 0) { 189 if ((isnet = INET_resolve(gateway, &rt.rt_gateway)) < 0) {
190 fprintf(stderr, "cant resolve gw %s\n", gateway); 190 fprintf(stderr, "cant resolve gw %s\n", gateway);
@@ -205,7 +205,7 @@ INET_setroute(int action, int options, char **args)
205 args++; 205 args++;
206 rt.rt_flags |= RTF_MSS; 206 rt.rt_flags |= RTF_MSS;
207 if (!*args) 207 if (!*args)
208 usage(route_usage); 208 show_usage();
209 rt.rt_mss = atoi(*args); 209 rt.rt_mss = atoi(*args);
210 args++; 210 args++;
211 if (rt.rt_mss < 64 || rt.rt_mss > 32768) { 211 if (rt.rt_mss < 64 || rt.rt_mss > 32768) {
@@ -218,7 +218,7 @@ INET_setroute(int action, int options, char **args)
218 if (!strcmp(*args, "window")) { 218 if (!strcmp(*args, "window")) {
219 args++; 219 args++;
220 if (!*args) 220 if (!*args)
221 usage(route_usage); 221 show_usage();
222 rt.rt_flags |= RTF_WINDOW; 222 rt.rt_flags |= RTF_WINDOW;
223 rt.rt_window = atoi(*args); 223 rt.rt_window = atoi(*args);
224 args++; 224 args++;
@@ -232,7 +232,7 @@ INET_setroute(int action, int options, char **args)
232 if (!strcmp(*args, "irtt")) { 232 if (!strcmp(*args, "irtt")) {
233 args++; 233 args++;
234 if (!*args) 234 if (!*args)
235 usage(route_usage); 235 show_usage();
236 args++; 236 args++;
237#if HAVE_RTF_IRTT 237#if HAVE_RTF_IRTT
238 rt.rt_flags |= RTF_IRTT; 238 rt.rt_flags |= RTF_IRTT;
@@ -277,7 +277,7 @@ INET_setroute(int action, int options, char **args)
277 if (!strcmp(*args, "device") || !strcmp(*args, "dev")) { 277 if (!strcmp(*args, "device") || !strcmp(*args, "dev")) {
278 args++; 278 args++;
279 if (rt.rt_dev || *args == NULL) 279 if (rt.rt_dev || *args == NULL)
280 usage(route_usage); 280 show_usage();
281 rt.rt_dev = *args++; 281 rt.rt_dev = *args++;
282 continue; 282 continue;
283 } 283 }
@@ -285,9 +285,9 @@ INET_setroute(int action, int options, char **args)
285 if (!rt.rt_dev) { 285 if (!rt.rt_dev) {
286 rt.rt_dev = *args++; 286 rt.rt_dev = *args++;
287 if (*args) 287 if (*args)
288 usage(route_usage); /* must be last to catch typos */ 288 show_usage(); /* must be last to catch typos */
289 } else 289 } else
290 usage(route_usage); 290 show_usage();
291 } 291 }
292 292
293#if HAVE_RTF_REJECT 293#if HAVE_RTF_REJECT
@@ -420,7 +420,7 @@ int route_main(int argc, char **argv)
420 else if (!strcmp(*argv, "flush")) 420 else if (!strcmp(*argv, "flush"))
421 what = RTACTION_FLUSH; 421 what = RTACTION_FLUSH;
422 else 422 else
423 usage(route_usage); 423 show_usage();
424 } 424 }
425 425
426 INET_setroute(what, 0, ++argv); 426 INET_setroute(what, 0, ++argv);
diff --git a/networking/telnet.c b/networking/telnet.c
index b08effed7..ed92a8403 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -498,7 +498,7 @@ extern int telnet_main(int argc, char** argv)
498 498
499 cfmakeraw(&G.termios_raw); 499 cfmakeraw(&G.termios_raw);
500 500
501 if (argc < 2) usage(telnet_usage); 501 if (argc < 2) show_usage();
502 port = (argc > 2)? getport(argv[2]): 23; 502 port = (argc > 2)? getport(argv[2]): 23;
503 503
504 G.buf = xmalloc(DATABUFSIZE); 504 G.buf = xmalloc(DATABUFSIZE);
diff --git a/networking/wget.c b/networking/wget.c
index c134427e4..d1aacefa6 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -105,12 +105,12 @@ int wget_main(int argc, char **argv)
105 fname_out = (strcmp(optarg, "-") == 0 ? (char *)1 : optarg); 105 fname_out = (strcmp(optarg, "-") == 0 ? (char *)1 : optarg);
106 break; 106 break;
107 default: 107 default:
108 usage(wget_usage); 108 show_usage();
109 } 109 }
110 } 110 }
111 111
112 if (argc - optind != 1) 112 if (argc - optind != 1)
113 usage(wget_usage); 113 show_usage();
114 114
115 /* 115 /*
116 * Use the proxy if necessary. 116 * Use the proxy if necessary.
@@ -533,7 +533,7 @@ progressmeter(int flag)
533 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 533 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
534 * SUCH DAMAGE. 534 * SUCH DAMAGE.
535 * 535 *
536 * $Id: wget.c,v 1.26 2001/02/01 16:49:30 kraai Exp $ 536 * $Id: wget.c,v 1.27 2001/02/14 21:23:06 andersen Exp $
537 */ 537 */
538 538
539 539
diff --git a/nslookup.c b/nslookup.c
index 8bfcd5785..33732de68 100644
--- a/nslookup.c
+++ b/nslookup.c
@@ -157,7 +157,7 @@ int nslookup_main(int argc, char **argv)
157 struct hostent *host; 157 struct hostent *host;
158 158
159 if (argc < 2 || *argv[1]=='-') { 159 if (argc < 2 || *argv[1]=='-') {
160 usage(nslookup_usage); 160 show_usage();
161 } 161 }
162 162
163 server_print(); 163 server_print();
@@ -170,4 +170,4 @@ int nslookup_main(int argc, char **argv)
170 return EXIT_SUCCESS; 170 return EXIT_SUCCESS;
171} 171}
172 172
173/* $Id: nslookup.c,v 1.20 2001/01/27 09:33:38 andersen Exp $ */ 173/* $Id: nslookup.c,v 1.21 2001/02/14 21:23:06 andersen Exp $ */
diff --git a/ping.c b/ping.c
index 15611babd..c114fb0b3 100644
--- a/ping.c
+++ b/ping.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: ping.c,v 1.36 2001/01/31 19:00:21 kraai Exp $ 3 * $Id: ping.c,v 1.37 2001/02/14 21:23:06 andersen Exp $
4 * Mini ping implementation for busybox 4 * Mini ping implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -251,7 +251,7 @@ extern int ping_main(int argc, char **argv)
251 argc--; 251 argc--;
252 argv++; 252 argv++;
253 if (argc < 1) 253 if (argc < 1)
254 usage(ping_usage); 254 show_usage();
255 ping(*argv); 255 ping(*argv);
256 return EXIT_SUCCESS; 256 return EXIT_SUCCESS;
257} 257}
@@ -522,24 +522,24 @@ extern int ping_main(int argc, char **argv)
522 break; 522 break;
523 case 'c': 523 case 'c':
524 if (--argc <= 0) 524 if (--argc <= 0)
525 usage(ping_usage); 525 show_usage();
526 argv++; 526 argv++;
527 pingcount = atoi(*argv); 527 pingcount = atoi(*argv);
528 break; 528 break;
529 case 's': 529 case 's':
530 if (--argc <= 0) 530 if (--argc <= 0)
531 usage(ping_usage); 531 show_usage();
532 argv++; 532 argv++;
533 datalen = atoi(*argv); 533 datalen = atoi(*argv);
534 break; 534 break;
535 default: 535 default:
536 usage(ping_usage); 536 show_usage();
537 } 537 }
538 argc--; 538 argc--;
539 argv++; 539 argv++;
540 } 540 }
541 if (argc < 1) 541 if (argc < 1)
542 usage(ping_usage); 542 show_usage();
543 543
544 myid = getpid() & 0xFFFF; 544 myid = getpid() & 0xFFFF;
545 ping(*argv); 545 ping(*argv);
diff --git a/pivot_root.c b/pivot_root.c
index 92fe4aeab..e00710148 100644
--- a/pivot_root.c
+++ b/pivot_root.c
@@ -20,7 +20,7 @@ static _syscall2(int,pivot_root,const char *,new_root,const char *,put_old)
20int pivot_root_main(int argc, char **argv) 20int pivot_root_main(int argc, char **argv)
21{ 21{
22 if (argc != 3) 22 if (argc != 3)
23 usage(pivot_root_usage); 23 show_usage();
24 24
25 if (pivot_root(argv[1],argv[2]) < 0) 25 if (pivot_root(argv[1],argv[2]) < 0)
26 perror_msg_and_die("pivot_root"); 26 perror_msg_and_die("pivot_root");
diff --git a/printf.c b/printf.c
index 72bc7ae89..26a200e85 100644
--- a/printf.c
+++ b/printf.c
@@ -143,7 +143,7 @@ int printf_main(int argc, char **argv)
143 143
144 exit_status = 0; 144 exit_status = 0;
145 if (argc <= 1 || **(argv + 1) == '-') { 145 if (argc <= 1 || **(argv + 1) == '-') {
146 usage(printf_usage); 146 show_usage();
147 } 147 }
148 148
149 format = argv[1]; 149 format = argv[1];
diff --git a/procps/free.c b/procps/free.c
index 17dd38687..d287c03f5 100644
--- a/procps/free.c
+++ b/procps/free.c
@@ -46,7 +46,7 @@ extern int free_main(int argc, char **argv)
46 info.bufferram/=info.mem_unit; 46 info.bufferram/=info.mem_unit;
47 47
48 if (argc > 1 && **(argv + 1) == '-') 48 if (argc > 1 && **(argv + 1) == '-')
49 usage(free_usage); 49 show_usage();
50 50
51 printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free", 51 printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free",
52 "shared", "buffers"); 52 "shared", "buffers");
diff --git a/procps/kill.c b/procps/kill.c
index 00a4d5c40..bdd22b52d 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -124,22 +124,19 @@ const struct signal_name signames[] = {
124extern int kill_main(int argc, char **argv) 124extern int kill_main(int argc, char **argv)
125{ 125{
126 int whichApp, sig = SIGTERM; 126 int whichApp, sig = SIGTERM;
127 const char *appUsage;
128 127
129#ifdef BB_KILLALL 128#ifdef BB_KILLALL
130 /* Figure out what we are trying to do here */ 129 /* Figure out what we are trying to do here */
131 whichApp = (strcmp(applet_name, "killall") == 0)? KILLALL : KILL; 130 whichApp = (strcmp(applet_name, "killall") == 0)? KILLALL : KILL;
132 appUsage = (whichApp == KILLALL)? killall_usage : kill_usage;
133#else 131#else
134 whichApp = KILL; 132 whichApp = KILL;
135 appUsage = kill_usage;
136#endif 133#endif
137 134
138 argc--; 135 argc--;
139 argv++; 136 argv++;
140 /* Parse any options */ 137 /* Parse any options */
141 if (argc < 1) 138 if (argc < 1)
142 usage(appUsage); 139 show_usage();
143 140
144 while (argc > 0 && **argv == '-') { 141 while (argc > 0 && **argv == '-') {
145 while (*++(*argv)) { 142 while (*++(*argv)) {
@@ -163,7 +160,7 @@ extern int kill_main(int argc, char **argv)
163 } 160 }
164 break; 161 break;
165 case '-': 162 case '-':
166 usage(appUsage); 163 show_usage();
167 default: 164 default:
168 { 165 {
169 if (isdigit(**argv)) { 166 if (isdigit(**argv)) {
diff --git a/procps/ps.c b/procps/ps.c
index eabdef407..dd154af9d 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -207,7 +207,7 @@ extern int ps_main(int argc, char **argv)
207#endif 207#endif
208 208
209 if (argc > 1 && **(argv + 1) == '-') 209 if (argc > 1 && **(argv + 1) == '-')
210 usage(ps_usage); 210 show_usage();
211 211
212 /* open device */ 212 /* open device */
213 fd = open(device, O_RDONLY); 213 fd = open(device, O_RDONLY);
diff --git a/procps/renice.c b/procps/renice.c
index 9d85ba0d0..9180ebf81 100644
--- a/procps/renice.c
+++ b/procps/renice.c
@@ -32,7 +32,7 @@ extern int renice_main(int argc, char **argv)
32{ 32{
33 int prio, status = EXIT_SUCCESS; 33 int prio, status = EXIT_SUCCESS;
34 34
35 if (argc < 3) usage(renice_usage); 35 if (argc < 3) show_usage();
36 36
37 prio = atoi(*++argv); 37 prio = atoi(*++argv);
38 if (prio > 20) prio = 20; 38 if (prio > 20) prio = 20;
diff --git a/ps.c b/ps.c
index eabdef407..dd154af9d 100644
--- a/ps.c
+++ b/ps.c
@@ -207,7 +207,7 @@ extern int ps_main(int argc, char **argv)
207#endif 207#endif
208 208
209 if (argc > 1 && **(argv + 1) == '-') 209 if (argc > 1 && **(argv + 1) == '-')
210 usage(ps_usage); 210 show_usage();
211 211
212 /* open device */ 212 /* open device */
213 fd = open(device, O_RDONLY); 213 fd = open(device, O_RDONLY);
diff --git a/rdate.c b/rdate.c
index d350be877..38a7689e9 100644
--- a/rdate.c
+++ b/rdate.c
@@ -95,14 +95,14 @@ int rdate_main(int argc, char **argv)
95 /* Interpret command line args */ 95 /* Interpret command line args */
96 /* do special-case option parsing */ 96 /* do special-case option parsing */
97 if (argv[1] && (strcmp(argv[1], "--help") == 0)) 97 if (argv[1] && (strcmp(argv[1], "--help") == 0))
98 usage(rdate_usage); 98 show_usage();
99 99
100 /* do normal option parsing */ 100 /* do normal option parsing */
101 while ((opt = getopt(argc, argv, "Hsp")) > 0) { 101 while ((opt = getopt(argc, argv, "Hsp")) > 0) {
102 switch (opt) { 102 switch (opt) {
103 default: 103 default:
104 case 'H': 104 case 'H':
105 usage(rdate_usage); 105 show_usage();
106 break; 106 break;
107 case 's': 107 case 's':
108 setdate++; 108 setdate++;
@@ -117,7 +117,7 @@ int rdate_main(int argc, char **argv)
117 if (printdate==0 && setdate==0) setdate++; 117 if (printdate==0 && setdate==0) setdate++;
118 118
119 if (optind == argc) { 119 if (optind == argc) {
120 usage(rdate_usage); 120 show_usage();
121 } 121 }
122 122
123 if ((time= askremotedate(argv[optind])) == (time_t)-1) { 123 if ((time= askremotedate(argv[optind])) == (time_t)-1) {
diff --git a/readlink.c b/readlink.c
index 57f43d174..c82f64027 100644
--- a/readlink.c
+++ b/readlink.c
@@ -33,7 +33,7 @@ int readlink_main(int argc, char **argv)
33 int bufsize = 128, size = 128; 33 int bufsize = 128, size = 128;
34 34
35 if (argc != 2) 35 if (argc != 2)
36 usage(readlink_usage); 36 show_usage();
37 37
38 while (bufsize < size + 1) { 38 while (bufsize < size + 1) {
39 bufsize *= 2; 39 bufsize *= 2;
diff --git a/renice.c b/renice.c
index 9d85ba0d0..9180ebf81 100644
--- a/renice.c
+++ b/renice.c
@@ -32,7 +32,7 @@ extern int renice_main(int argc, char **argv)
32{ 32{
33 int prio, status = EXIT_SUCCESS; 33 int prio, status = EXIT_SUCCESS;
34 34
35 if (argc < 3) usage(renice_usage); 35 if (argc < 3) show_usage();
36 36
37 prio = atoi(*++argv); 37 prio = atoi(*++argv);
38 if (prio > 20) prio = 20; 38 if (prio > 20) prio = 20;
diff --git a/rm.c b/rm.c
index ce293a2aa..566076707 100644
--- a/rm.c
+++ b/rm.c
@@ -84,7 +84,7 @@ extern int rm_main(int argc, char **argv)
84 stopIt = TRUE; 84 stopIt = TRUE;
85 break; 85 break;
86 default: 86 default:
87 usage(rm_usage); 87 show_usage();
88 } 88 }
89 argc--; 89 argc--;
90 argv++; 90 argv++;
@@ -94,7 +94,7 @@ extern int rm_main(int argc, char **argv)
94 } 94 }
95 95
96 if (argc < 1 && forceFlag == FALSE) { 96 if (argc < 1 && forceFlag == FALSE) {
97 usage(rm_usage); 97 show_usage();
98 } 98 }
99 99
100 while (argc-- > 0) { 100 while (argc-- > 0) {
diff --git a/rmdir.c b/rmdir.c
index 86346ddde..6266ce1ef 100644
--- a/rmdir.c
+++ b/rmdir.c
@@ -33,7 +33,7 @@ extern int rmdir_main(int argc, char **argv)
33 int status = EXIT_SUCCESS; 33 int status = EXIT_SUCCESS;
34 34
35 if (argc == 1 || **(argv + 1) == '-') 35 if (argc == 1 || **(argv + 1) == '-')
36 usage(rmdir_usage); 36 show_usage();
37 37
38 while (--argc > 0) { 38 while (--argc > 0) {
39 if (rmdir(*(++argv)) == -1) { 39 if (rmdir(*(++argv)) == -1) {
diff --git a/rmmod.c b/rmmod.c
index 3a66af87a..7d4538e6e 100644
--- a/rmmod.c
+++ b/rmmod.c
@@ -39,7 +39,7 @@ extern int rmmod_main(int argc, char **argv)
39{ 39{
40 int ret = EXIT_SUCCESS; 40 int ret = EXIT_SUCCESS;
41 if (argc <= 1) { 41 if (argc <= 1) {
42 usage(rmmod_usage); 42 show_usage();
43 } 43 }
44 44
45 /* Parse any options */ 45 /* Parse any options */
@@ -52,7 +52,7 @@ extern int rmmod_main(int argc, char **argv)
52 perror_msg_and_die("rmmod"); 52 perror_msg_and_die("rmmod");
53 return EXIT_SUCCESS; 53 return EXIT_SUCCESS;
54 default: 54 default:
55 usage(rmmod_usage); 55 show_usage();
56 } 56 }
57 } 57 }
58 } 58 }
diff --git a/route.c b/route.c
index 83a0be2d2..3fad81a01 100644
--- a/route.c
+++ b/route.c
@@ -15,7 +15,7 @@
15 * Foundation; either version 2 of the License, or (at 15 * Foundation; either version 2 of the License, or (at
16 * your option) any later version. 16 * your option) any later version.
17 * 17 *
18 * $Id: route.c,v 1.2 2001/02/14 19:26:39 andersen Exp $ 18 * $Id: route.c,v 1.3 2001/02/14 21:23:06 andersen Exp $
19 * 19 *
20 * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> 20 * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
21 */ 21 */
@@ -115,7 +115,7 @@ INET_setroute(int action, int options, char **args)
115 args++; 115 args++;
116 } 116 }
117 if (*args == NULL) 117 if (*args == NULL)
118 usage(route_usage); 118 show_usage();
119 119
120 safe_strncpy(target, *args++, (sizeof target)); 120 safe_strncpy(target, *args++, (sizeof target));
121 121
@@ -152,7 +152,7 @@ INET_setroute(int action, int options, char **args)
152 152
153 args++; 153 args++;
154 if (!*args || !isdigit(**args)) 154 if (!*args || !isdigit(**args))
155 usage(route_usage); 155 show_usage();
156 metric = atoi(*args); 156 metric = atoi(*args);
157#if HAVE_NEW_ADDRT 157#if HAVE_NEW_ADDRT
158 rt.rt_metric = metric + 1; 158 rt.rt_metric = metric + 1;
@@ -168,7 +168,7 @@ INET_setroute(int action, int options, char **args)
168 168
169 args++; 169 args++;
170 if (!*args || mask_in_addr(rt)) 170 if (!*args || mask_in_addr(rt))
171 usage(route_usage); 171 show_usage();
172 safe_strncpy(netmask, *args, (sizeof netmask)); 172 safe_strncpy(netmask, *args, (sizeof netmask));
173 if ((isnet = INET_resolve(netmask, &mask)) < 0) { 173 if ((isnet = INET_resolve(netmask, &mask)) < 0) {
174 fprintf(stderr, "cant resolve netmask %s\n", netmask); 174 fprintf(stderr, "cant resolve netmask %s\n", netmask);
@@ -182,9 +182,9 @@ INET_setroute(int action, int options, char **args)
182 if (!strcmp(*args, "gw") || !strcmp(*args, "gateway")) { 182 if (!strcmp(*args, "gw") || !strcmp(*args, "gateway")) {
183 args++; 183 args++;
184 if (!*args) 184 if (!*args)
185 usage(route_usage); 185 show_usage();
186 if (rt.rt_flags & RTF_GATEWAY) 186 if (rt.rt_flags & RTF_GATEWAY)
187 usage(route_usage); 187 show_usage();
188 safe_strncpy(gateway, *args, (sizeof gateway)); 188 safe_strncpy(gateway, *args, (sizeof gateway));
189 if ((isnet = INET_resolve(gateway, &rt.rt_gateway)) < 0) { 189 if ((isnet = INET_resolve(gateway, &rt.rt_gateway)) < 0) {
190 fprintf(stderr, "cant resolve gw %s\n", gateway); 190 fprintf(stderr, "cant resolve gw %s\n", gateway);
@@ -205,7 +205,7 @@ INET_setroute(int action, int options, char **args)
205 args++; 205 args++;
206 rt.rt_flags |= RTF_MSS; 206 rt.rt_flags |= RTF_MSS;
207 if (!*args) 207 if (!*args)
208 usage(route_usage); 208 show_usage();
209 rt.rt_mss = atoi(*args); 209 rt.rt_mss = atoi(*args);
210 args++; 210 args++;
211 if (rt.rt_mss < 64 || rt.rt_mss > 32768) { 211 if (rt.rt_mss < 64 || rt.rt_mss > 32768) {
@@ -218,7 +218,7 @@ INET_setroute(int action, int options, char **args)
218 if (!strcmp(*args, "window")) { 218 if (!strcmp(*args, "window")) {
219 args++; 219 args++;
220 if (!*args) 220 if (!*args)
221 usage(route_usage); 221 show_usage();
222 rt.rt_flags |= RTF_WINDOW; 222 rt.rt_flags |= RTF_WINDOW;
223 rt.rt_window = atoi(*args); 223 rt.rt_window = atoi(*args);
224 args++; 224 args++;
@@ -232,7 +232,7 @@ INET_setroute(int action, int options, char **args)
232 if (!strcmp(*args, "irtt")) { 232 if (!strcmp(*args, "irtt")) {
233 args++; 233 args++;
234 if (!*args) 234 if (!*args)
235 usage(route_usage); 235 show_usage();
236 args++; 236 args++;
237#if HAVE_RTF_IRTT 237#if HAVE_RTF_IRTT
238 rt.rt_flags |= RTF_IRTT; 238 rt.rt_flags |= RTF_IRTT;
@@ -277,7 +277,7 @@ INET_setroute(int action, int options, char **args)
277 if (!strcmp(*args, "device") || !strcmp(*args, "dev")) { 277 if (!strcmp(*args, "device") || !strcmp(*args, "dev")) {
278 args++; 278 args++;
279 if (rt.rt_dev || *args == NULL) 279 if (rt.rt_dev || *args == NULL)
280 usage(route_usage); 280 show_usage();
281 rt.rt_dev = *args++; 281 rt.rt_dev = *args++;
282 continue; 282 continue;
283 } 283 }
@@ -285,9 +285,9 @@ INET_setroute(int action, int options, char **args)
285 if (!rt.rt_dev) { 285 if (!rt.rt_dev) {
286 rt.rt_dev = *args++; 286 rt.rt_dev = *args++;
287 if (*args) 287 if (*args)
288 usage(route_usage); /* must be last to catch typos */ 288 show_usage(); /* must be last to catch typos */
289 } else 289 } else
290 usage(route_usage); 290 show_usage();
291 } 291 }
292 292
293#if HAVE_RTF_REJECT 293#if HAVE_RTF_REJECT
@@ -420,7 +420,7 @@ int route_main(int argc, char **argv)
420 else if (!strcmp(*argv, "flush")) 420 else if (!strcmp(*argv, "flush"))
421 what = RTACTION_FLUSH; 421 what = RTACTION_FLUSH;
422 else 422 else
423 usage(route_usage); 423 show_usage();
424 } 424 }
425 425
426 INET_setroute(what, 0, ++argv); 426 INET_setroute(what, 0, ++argv);
diff --git a/rpmunpack.c b/rpmunpack.c
index e37ac2cfa..79971faf3 100644
--- a/rpmunpack.c
+++ b/rpmunpack.c
@@ -64,7 +64,7 @@ int rpmunpack_main(int argc, char **argv)
64 64
65 /* Check for command line parameters */ 65 /* Check for command line parameters */
66 if (argc>=2 && *argv[1]=='-') { 66 if (argc>=2 && *argv[1]=='-') {
67 usage(rpmunpack_usage); 67 show_usage();
68 } 68 }
69 69
70 /* Open input file */ 70 /* Open input file */
diff --git a/sed.c b/sed.c
index 0ce9f45e0..390181375 100644
--- a/sed.c
+++ b/sed.c
@@ -673,7 +673,7 @@ extern int sed_main(int argc, char **argv)
673 while ((opt = getopt(argc, argv, "hne:f:")) > 0) { 673 while ((opt = getopt(argc, argv, "hne:f:")) > 0) {
674 switch (opt) { 674 switch (opt) {
675 case 'h': 675 case 'h':
676 usage(sed_usage); 676 show_usage();
677 break; 677 break;
678 case 'n': 678 case 'n':
679 be_quiet++; 679 be_quiet++;
@@ -691,7 +691,7 @@ extern int sed_main(int argc, char **argv)
691 * argv[optind] should be the pattern. no pattern, no worky */ 691 * argv[optind] should be the pattern. no pattern, no worky */
692 if (ncmds == 0) { 692 if (ncmds == 0) {
693 if (argv[optind] == NULL) 693 if (argv[optind] == NULL)
694 usage(sed_usage); 694 show_usage();
695 else { 695 else {
696 add_cmd_str(argv[optind]); 696 add_cmd_str(argv[optind]);
697 optind++; 697 optind++;
diff --git a/setkeycodes.c b/setkeycodes.c
index 3e511ad00..0be4724ca 100644
--- a/setkeycodes.c
+++ b/setkeycodes.c
@@ -43,7 +43,7 @@ setkeycodes_main(int argc, char** argv)
43 struct kbkeycode a; 43 struct kbkeycode a;
44 44
45 if (argc % 2 != 1 || argc < 2) { 45 if (argc % 2 != 1 || argc < 2) {
46 usage(setkeycodes_usage); 46 show_usage();
47 } 47 }
48 48
49 fd = get_console_fd("/dev/console"); 49 fd = get_console_fd("/dev/console");
diff --git a/sh.c b/sh.c
index b1a7b93cf..9519538dc 100644
--- a/sh.c
+++ b/sh.c
@@ -1370,7 +1370,6 @@ static int pseudo_exec(struct child_prog *child)
1370{ 1370{
1371 struct built_in_command *x; 1371 struct built_in_command *x;
1372#ifdef BB_FEATURE_SH_STANDALONE_SHELL 1372#ifdef BB_FEATURE_SH_STANDALONE_SHELL
1373 struct BB_applet *applet;
1374 char *name; 1373 char *name;
1375#endif 1374#endif
1376 1375
@@ -1415,14 +1414,12 @@ static int pseudo_exec(struct child_prog *child)
1415 name = get_last_path_component(name); 1414 name = get_last_path_component(name);
1416#endif 1415#endif
1417 1416
1418 /* Do a binary search to find the applet entry given the name. */ 1417 {
1419 if ((applet = find_applet_by_name(name)) != NULL) { 1418 char** argv=child->argv;
1420 int argc_l; 1419 int argc_l;
1421 char** argv=child->argv; 1420 for(argc_l=0;*argv!=NULL; argv++, argc_l++);
1422 for(argc_l=0;*argv!=NULL; argv++, argc_l++); 1421 optind = 1;
1423 applet_name=applet->name; 1422 run_applet_by_name(name, argc_l, child->argv);
1424 optind = 1;
1425 exit((*(applet->main)) (argc_l, child->argv));
1426 } 1423 }
1427#endif 1424#endif
1428 1425
@@ -1750,7 +1747,7 @@ int shell_main(int argc_l, char **argv_l)
1750 interactive = TRUE; 1747 interactive = TRUE;
1751 break; 1748 break;
1752 default: 1749 default:
1753 usage(shell_usage); 1750 show_usage();
1754 } 1751 }
1755 } 1752 }
1756 /* A shell is interactive if the `-i' flag was given, or if all of 1753 /* A shell is interactive if the `-i' flag was given, or if all of
diff --git a/shell/lash.c b/shell/lash.c
index b1a7b93cf..9519538dc 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -1370,7 +1370,6 @@ static int pseudo_exec(struct child_prog *child)
1370{ 1370{
1371 struct built_in_command *x; 1371 struct built_in_command *x;
1372#ifdef BB_FEATURE_SH_STANDALONE_SHELL 1372#ifdef BB_FEATURE_SH_STANDALONE_SHELL
1373 struct BB_applet *applet;
1374 char *name; 1373 char *name;
1375#endif 1374#endif
1376 1375
@@ -1415,14 +1414,12 @@ static int pseudo_exec(struct child_prog *child)
1415 name = get_last_path_component(name); 1414 name = get_last_path_component(name);
1416#endif 1415#endif
1417 1416
1418 /* Do a binary search to find the applet entry given the name. */ 1417 {
1419 if ((applet = find_applet_by_name(name)) != NULL) { 1418 char** argv=child->argv;
1420 int argc_l; 1419 int argc_l;
1421 char** argv=child->argv; 1420 for(argc_l=0;*argv!=NULL; argv++, argc_l++);
1422 for(argc_l=0;*argv!=NULL; argv++, argc_l++); 1421 optind = 1;
1423 applet_name=applet->name; 1422 run_applet_by_name(name, argc_l, child->argv);
1424 optind = 1;
1425 exit((*(applet->main)) (argc_l, child->argv));
1426 } 1423 }
1427#endif 1424#endif
1428 1425
@@ -1750,7 +1747,7 @@ int shell_main(int argc_l, char **argv_l)
1750 interactive = TRUE; 1747 interactive = TRUE;
1751 break; 1748 break;
1752 default: 1749 default:
1753 usage(shell_usage); 1750 show_usage();
1754 } 1751 }
1755 } 1752 }
1756 /* A shell is interactive if the `-i' flag was given, or if all of 1753 /* A shell is interactive if the `-i' flag was given, or if all of
diff --git a/sleep.c b/sleep.c
index 61b7ce404..d21af19b3 100644
--- a/sleep.c
+++ b/sleep.c
@@ -29,7 +29,7 @@
29extern int sleep_main(int argc, char **argv) 29extern int sleep_main(int argc, char **argv)
30{ 30{
31 if ((argc < 2) || (**(argv + 1) == '-')) { 31 if ((argc < 2) || (**(argv + 1) == '-')) {
32 usage(sleep_usage); 32 show_usage();
33 } 33 }
34 34
35 if (sleep(atoi(*(++argv))) != 0) 35 if (sleep(atoi(*(++argv))) != 0)
diff --git a/sort.c b/sort.c
index 2aef2d955..4984f5dfe 100644
--- a/sort.c
+++ b/sort.c
@@ -56,7 +56,7 @@ int sort_main(int argc, char **argv)
56 break; 56 break;
57#endif 57#endif
58 default: 58 default:
59 usage(sort_usage); 59 show_usage();
60 } 60 }
61 } 61 }
62 62
diff --git a/swaponoff.c b/swaponoff.c
index 74f6ec36e..8dda0972a 100644
--- a/swaponoff.c
+++ b/swaponoff.c
@@ -107,5 +107,5 @@ extern int swap_on_off_main(int argc, char **argv)
107 return EXIT_SUCCESS; 107 return EXIT_SUCCESS;
108 108
109 usage_and_exit: 109 usage_and_exit:
110 usage((whichApp == SWAPON_APP) ? swapon_usage : swapoff_usage); 110 show_usage();
111} 111}
diff --git a/sync.c b/sync.c
index f95c24c6c..fc5a42b8a 100644
--- a/sync.c
+++ b/sync.c
@@ -28,6 +28,6 @@
28extern int sync_main(int argc, char **argv) 28extern int sync_main(int argc, char **argv)
29{ 29{
30 if (argc > 1 && **(argv + 1) == '-') 30 if (argc > 1 && **(argv + 1) == '-')
31 usage(sync_usage); 31 show_usage();
32 return(sync()); 32 return(sync());
33} 33}
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index 85c63b8a5..352bde158 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -122,7 +122,7 @@ extern int logger_main(int argc, char **argv)
122 strncpy(name, optarg, sizeof(name)); 122 strncpy(name, optarg, sizeof(name));
123 break; 123 break;
124 default: 124 default:
125 usage(logger_usage); 125 show_usage();
126 } 126 }
127 } 127 }
128 128
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 7bd4bdcb2..872728b5b 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -519,7 +519,7 @@ extern int syslogd_main(int argc, char **argv)
519 break; 519 break;
520#endif 520#endif
521 default: 521 default:
522 usage(syslogd_usage); 522 show_usage();
523 } 523 }
524 } 524 }
525 525
diff --git a/syslogd.c b/syslogd.c
index 7bd4bdcb2..872728b5b 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -519,7 +519,7 @@ extern int syslogd_main(int argc, char **argv)
519 break; 519 break;
520#endif 520#endif
521 default: 521 default:
522 usage(syslogd_usage); 522 show_usage();
523 } 523 }
524 } 524 }
525 525
diff --git a/tail.c b/tail.c
index d45b29c4c..a3b8f6d23 100644
--- a/tail.c
+++ b/tail.c
@@ -103,7 +103,7 @@ int tail_main(int argc, char **argv)
103 break; 103 break;
104#endif 104#endif
105 default: 105 default:
106 usage(tail_usage); 106 show_usage();
107 } 107 }
108 } 108 }
109 109
diff --git a/tar.c b/tar.c
index fb0fcc614..62f1b1d35 100644
--- a/tar.c
+++ b/tar.c
@@ -214,7 +214,7 @@ extern int tar_main(int argc, char **argv)
214 int opt; 214 int opt;
215 215
216 if (argc <= 1) 216 if (argc <= 1)
217 usage(tar_usage); 217 show_usage();
218 218
219 if (argv[1][0] != '-') { 219 if (argv[1][0] != '-') {
220 char *tmp = xmalloc(strlen(argv[1]) + 2); 220 char *tmp = xmalloc(strlen(argv[1]) + 2);
@@ -283,7 +283,7 @@ extern int tar_main(int argc, char **argv)
283 break; 283 break;
284#endif 284#endif
285 default: 285 default:
286 usage(tar_usage); 286 show_usage();
287 } 287 }
288 } 288 }
289 289
diff --git a/tee.c b/tee.c
index aa3098c6a..439cf7dc5 100644
--- a/tee.c
+++ b/tee.c
@@ -38,7 +38,7 @@ tee_main(int argc, char **argv)
38 mode = "a"; 38 mode = "a";
39 break; 39 break;
40 default: 40 default:
41 usage(tee_usage); 41 show_usage();
42 } 42 }
43 } 43 }
44 44
diff --git a/telnet.c b/telnet.c
index b08effed7..ed92a8403 100644
--- a/telnet.c
+++ b/telnet.c
@@ -498,7 +498,7 @@ extern int telnet_main(int argc, char** argv)
498 498
499 cfmakeraw(&G.termios_raw); 499 cfmakeraw(&G.termios_raw);
500 500
501 if (argc < 2) usage(telnet_usage); 501 if (argc < 2) show_usage();
502 port = (argc > 2)? getport(argv[2]): 23; 502 port = (argc > 2)? getport(argv[2]): 23;
503 503
504 G.buf = xmalloc(DATABUFSIZE); 504 G.buf = xmalloc(DATABUFSIZE);
diff --git a/touch.c b/touch.c
index e174baa47..a3256d559 100644
--- a/touch.c
+++ b/touch.c
@@ -44,13 +44,13 @@ extern int touch_main(int argc, char **argv)
44 create = FALSE; 44 create = FALSE;
45 break; 45 break;
46 default: 46 default:
47 usage(touch_usage); 47 show_usage();
48 } 48 }
49 } 49 }
50 } 50 }
51 51
52 if (argc < 1) { 52 if (argc < 1) {
53 usage(touch_usage); 53 show_usage();
54 } 54 }
55 55
56 while (argc > 0) { 56 while (argc > 0) {
diff --git a/tr.c b/tr.c
index 36f29de44..92f399e14 100644
--- a/tr.c
+++ b/tr.c
@@ -170,7 +170,7 @@ extern int tr_main(int argc, char **argv)
170 sq_fl = TRUE; 170 sq_fl = TRUE;
171 break; 171 break;
172 default: 172 default:
173 usage(tr_usage); 173 show_usage();
174 } 174 }
175 } 175 }
176 index++; 176 index++;
diff --git a/tty.c b/tty.c
index 2a64b149d..d71d8dedb 100644
--- a/tty.c
+++ b/tty.c
@@ -32,7 +32,7 @@ extern int tty_main(int argc, char **argv)
32 32
33 if (argc > 1) { 33 if (argc > 1) {
34 if (argv[1][0] != '-' || argv[1][1] != 's') 34 if (argv[1][0] != '-' || argv[1][1] != 's')
35 usage(tty_usage); 35 show_usage();
36 } else { 36 } else {
37 tty = ttyname(0); 37 tty = ttyname(0);
38 if (tty) 38 if (tty)
diff --git a/umount.c b/umount.c
index 39842d232..c160ec284 100644
--- a/umount.c
+++ b/umount.c
@@ -235,7 +235,7 @@ static int umount_all(int useMtab)
235extern int umount_main(int argc, char **argv) 235extern int umount_main(int argc, char **argv)
236{ 236{
237 if (argc < 2) { 237 if (argc < 2) {
238 usage(umount_usage); 238 show_usage();
239 } 239 }
240#ifdef BB_FEATURE_CLEAN_UP 240#ifdef BB_FEATURE_CLEAN_UP
241 atexit(mtab_free); 241 atexit(mtab_free);
@@ -269,7 +269,7 @@ extern int umount_main(int argc, char **argv)
269 case 'v': 269 case 'v':
270 break; /* ignore -v */ 270 break; /* ignore -v */
271 default: 271 default:
272 usage(umount_usage); 272 show_usage();
273 } 273 }
274 } 274 }
275 275
diff --git a/uname.c b/uname.c
index deaffd700..899da7792 100644
--- a/uname.c
+++ b/uname.c
@@ -106,7 +106,7 @@ int uname_main(int argc, char **argv)
106 PRINT_MACHINE); 106 PRINT_MACHINE);
107 break; 107 break;
108 default: 108 default:
109 usage(uname_usage); 109 show_usage();
110 } 110 }
111 } 111 }
112 } 112 }
diff --git a/unix2dos.c b/unix2dos.c
index 553ad0c34..37da9a9cc 100644
--- a/unix2dos.c
+++ b/unix2dos.c
@@ -30,7 +30,7 @@ int unix2dos_main( int argc, char **argv ) {
30 if (argc > 1) { 30 if (argc > 1) {
31 c = *argv[1]; 31 c = *argv[1];
32 if (c == '-') { 32 if (c == '-') {
33 usage(unix2dos_usage); 33 show_usage();
34 } 34 }
35 } 35 }
36 c = getchar(); 36 c = getchar();
diff --git a/update.c b/update.c
index 309ce0cbd..2cf4a98b2 100644
--- a/update.c
+++ b/update.c
@@ -64,7 +64,7 @@ extern int update_main(int argc, char **argv)
64 flush_duration = atoi(optarg); 64 flush_duration = atoi(optarg);
65 break; 65 break;
66 default: 66 default:
67 usage(update_usage); 67 show_usage();
68 } 68 }
69 } 69 }
70 70
diff --git a/usage.c b/usage.c
index 7f998086b..1515c0898 100644
--- a/usage.c
+++ b/usage.c
@@ -1,1635 +1,2 @@
1#include "busybox.h" 1#define USAGE_MESSAGES
2 2#include <usage.h>
3#if defined BB_AR
4const char ar_usage[] =
5 "ar -[ovR]{ptx} archive filenames"
6#ifndef BB_FEATURE_TRIVIAL_HELP
7 "\n\nExtract or list files from an ar archive.\n\n"
8 "Options:\n"
9 "\t-o\t\tpreserve original dates\n"
10 "\t-p\t\textract to stdout\n"
11 "\t-t\t\tlist\n"
12 "\t-x\t\textract\n"
13 "\t-v\t\tverbosely list files processed\n"
14 "\t-R\t\trecursive action"
15#endif
16 ;
17#endif
18
19#if defined BB_BASENAME
20const char basename_usage[] =
21 "basename FILE [SUFFIX]"
22#ifndef BB_FEATURE_TRIVIAL_HELP
23 "\n\nStrips directory path and suffixes from FILE.\n"
24 "If specified, also removes any trailing SUFFIX."
25#endif
26 ;
27#endif
28
29#if defined BB_CAT
30const char cat_usage[] =
31 "cat [FILE]..."
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\n\nConcatenates FILE(s) and prints them to stdout."
34#endif
35 ;
36#endif
37
38#if defined BB_CHMOD_CHOWN_CHGRP
39const char chgrp_usage[] =
40 "chgrp [OPTION]... GROUP FILE..."
41#ifndef BB_FEATURE_TRIVIAL_HELP
42 "\n\nChange the group membership of each FILE to GROUP.\n"
43 "\nOptions:\n\t-R\tChanges files and directories recursively."
44#endif
45 ;
46#endif
47
48#if defined BB_CHMOD_CHOWN_CHGRP
49const char chmod_usage[] =
50 "chmod [-R] MODE[,MODE]... FILE..."
51#ifndef BB_FEATURE_TRIVIAL_HELP
52 "\n\nEach MODE is one or more of the letters ugoa, one of the symbols +-= and\n"
53 "one or more of the letters rwxst.\n\n"
54 "\nOptions:\n\t-R\tChanges files and directories recursively."
55#endif
56 ;
57#endif
58
59#if defined BB_CHMOD_CHOWN_CHGRP
60const char chown_usage[] =
61 "chown [OPTION]... OWNER[<.|:>[GROUP] FILE..."
62#ifndef BB_FEATURE_TRIVIAL_HELP
63 "\n\nChange the owner and/or group of each FILE to OWNER and/or GROUP.\n"
64 "\nOptions:\n\t-R\tChanges files and directories recursively."
65#endif
66 ;
67#endif
68
69#if defined BB_CHROOT
70const char chroot_usage[] =
71 "chroot NEWROOT [COMMAND...]"
72#ifndef BB_FEATURE_TRIVIAL_HELP
73 "\n\nRun COMMAND with root directory set to NEWROOT."
74#endif
75 ;
76#endif
77
78#if defined BB_CHVT
79const char chvt_usage[] =
80 "chvt N"
81#ifndef BB_FEATURE_TRIVIAL_HELP
82 "\n\nChanges the foreground virtual terminal to /dev/ttyN"
83#endif
84 ;
85#endif
86
87#if defined BB_CLEAR
88const char clear_usage[] =
89 "clear"
90#ifndef BB_FEATURE_TRIVIAL_HELP
91 "\n\nClear screen."
92#endif
93 ;
94#endif
95
96#if defined BB_CMP
97const char cmp_usage[] =
98 "cmp FILE1 [FILE2]"
99#ifndef BB_FEATURE_TRIVIAL_HELP
100 "\n\nCompare files."
101#endif
102 ;
103#endif
104
105#if defined BB_CP_MV
106const char cp_usage[] =
107 "cp [OPTION]... SOURCE DEST\n"
108 " or: cp [OPTION]... SOURCE... DIRECTORY"
109#ifndef BB_FEATURE_TRIVIAL_HELP
110 "\n\nCopies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n"
111 "\n"
112 "\t-a\tSame as -dpR\n"
113 "\t-d\tPreserves links\n"
114 "\t-p\tPreserves file attributes if possible\n"
115 "\t-f\tforce (implied; ignored) - always set\n"
116 "\t-R\tCopies directories recursively"
117#endif
118 ;
119#endif
120
121#if defined BB_CUT
122const char cut_usage[] =
123 "cut [OPTION]... [FILE]..."
124#ifndef BB_FEATURE_TRIVIAL_HELP
125 "\n\nPrints selected fields from each input FILE to standard output.\n\n"
126 "Options:\n"
127 "\t-b LIST\tOutput only bytes from LIST\n"
128 "\t-c LIST\tOutput only characters from LIST\n"
129 "\t-d CHAR\tUse CHAR instead of tab as the field delimiter\n"
130 "\t-s\tOutput only the lines containing delimiter\n"
131 "\t-f N\tPrint only these fields\n"
132 "\t-n\tIgnored"
133#endif
134 ;
135#endif
136
137#if defined BB_DATE
138const char date_usage[] =
139 "date [OPTION]... [+FORMAT]\n"
140 " or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]"
141#ifndef BB_FEATURE_TRIVIAL_HELP
142 "\n\nDisplays the current time in the given FORMAT, or sets the system date.\n"
143 "\nOptions:\n\t-R\t\tOutputs RFC-822 compliant date string\n"
144 "\t-d STRING\tdisplay time described by STRING, not `now'\n"
145 "\t-s\t\tSets time described by STRING\n"
146 "\t-u\t\tPrints or sets Coordinated Universal Time"
147#endif
148 ;
149#endif
150
151#if defined BB_DC
152const char dc_usage[] =
153 "dc expression ..."
154#ifndef BB_FEATURE_TRIVIAL_HELP
155 "\n\nThis is a Tiny RPN calculator that understands the\n"
156 "following operations: +, -, /, *, and, or, not, eor.\n"
157 "i.e. 'dc 2 2 add' -> 4, and 'dc 8 8 \\* 2 2 + /' -> 16"
158#endif
159 ;
160#endif
161
162#if defined BB_DD
163const char dd_usage[] =
164 "dd [if=FILE] [of=FILE] [bs=N] [count=N] [skip=N] [seek=N] [conv=notrunc|sync]"
165#ifndef BB_FEATURE_TRIVIAL_HELP
166 "\n\nCopy a file, converting and formatting according to options\n\n"
167 "\tif=FILE\tread from FILE instead of stdin\n"
168 "\tof=FILE\twrite to FILE instead of stdout\n"
169 "\tbs=N\tread and write N bytes at a time\n"
170 "\tcount=N\tcopy only N input blocks\n"
171 "\tskip=N\tskip N input blocks\n"
172 "\tseek=N\tskip N output blocks\n"
173 "\tconv=notrunc\tdon't truncate output file\n"
174 "\tconv=sync\tpad blocks with zeros\n"
175 "\n"
176 "Numbers may be suffixed by c (x1), w (x2), b (x512), kD (x1000), k (x1024),\n"
177 "MD (x1000000), M (x1048576), GD (x1000000000) or G (x1073741824)."
178#endif
179 ;
180#endif
181
182#if defined BB_DEALLOCVT
183const char deallocvt_usage[] =
184 "deallocvt N"
185#ifndef BB_FEATURE_TRIVIAL_HELP
186 "\n\nDeallocate unused virtual terminal /dev/ttyN"
187#endif
188 ;
189#endif
190
191#if defined BB_DF
192const char df_usage[] =
193 "df [-?"
194#ifdef BB_FEATURE_HUMAN_READABLE
195 "hm"
196#endif
197 "k] [filesystem ...]\n"
198#ifndef BB_FEATURE_TRIVIAL_HELP
199 "\n\nPrint the filesystem space used and space available."
200 "Options:\n"
201 "\t-?\tshow usage information\n"
202#ifdef BB_FEATURE_HUMAN_READABLE
203 "\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n"
204 "\t-m\tprint sizes in megabytes\n"
205 "\t-k\tprint sizes in kilobytes(default)\n"
206#else
207 "\t-k\tprint sizes in kilobytes(compatability)\n"
208#endif
209#endif
210 ;
211#endif
212
213#if defined BB_DIRNAME
214const char dirname_usage[] =
215 "dirname [FILENAME ...]"
216#ifndef BB_FEATURE_TRIVIAL_HELP
217 "\n\nStrips non-directory suffix from FILENAME"
218#endif
219 ;
220#endif
221
222#if defined BB_DMESG
223const char dmesg_usage[] =
224 "dmesg [-c] [-n LEVEL] [-s SIZE]"
225#ifndef BB_FEATURE_TRIVIAL_HELP
226 "\n\nPrints or controls the kernel ring buffer\n\n"
227 "Options:\n"
228 "\t-c\t\tClears the ring buffer's contents after printing\n"
229 "\t-n LEVEL\tSets console logging level\n"
230 "\t-s SIZE\t\tUse a buffer of size SIZE"
231#endif
232 ;
233#endif
234
235#if defined BB_DOS2UNIX
236const char dos2unix_usage[] =
237 "dos2unix < dosfile > unixfile"
238#ifndef BB_FEATURE_TRIVIAL_HELP
239 "\n\nConverts a text file from dos format to unix format."
240#endif
241 ;
242#endif
243
244#if defined BB_DPKG
245const char dpkg_usage[] =
246 "udpkg <-i|-r|--unpack|--configure> my.deb\n"
247 "WORK IN PROGRESS, only usefull for debian-installer\n"
248#ifndef BB_FEATURE_TRIVIAL_HELP
249#endif
250 ;
251#endif
252
253#if defined BB_DPKG_DEB
254const char dpkg_deb_usage[] =
255 "dpkg-deb [-cexX] file directory"
256#ifndef BB_FEATURE_TRIVIAL_HELP
257 "\n\nPerform actions on debian packages (.debs)\n\n"
258 "Options:\n"
259 "\t-c\tList contents of filesystem tree (verbose)\n"
260 "\t-l\tList contents of filesystem tree (.list format)\n"
261 "\t-e\tExtract control files to directory\n"
262 "\t-x\tExctract packages filesystem tree to directory\n"
263 "\t-X\tVerbose extract"
264#endif
265 ;
266#endif
267
268#if defined BB_DU
269const char du_usage[] =
270 "du [-?ls"
271#ifdef BB_FEATURE_HUMAN_READABLE
272 "hm"
273#endif
274 "k] [FILE]...\n"
275#ifndef BB_FEATURE_TRIVIAL_HELP
276 "\n\nSummarizes disk space used for each FILE and/or directory.\n"
277 "Disk space is printed in units of 1024 bytes.\n\n"
278 "Options:\n"
279 "\t-?\tshow usage information\n"
280 "\t-l\tcount sizes many times if hard linked\n"
281 "\t-s\tdisplay only a total for each argument"
282#ifdef BB_FEATURE_HUMAN_READABLE
283 "\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n"
284 "\t-m\tprint sizes in megabytes\n"
285 "\t-k\tprint sizes in kilobytes(default)\n"
286#else
287 "\t-k\tprint sizes in kilobytes(compatability)\n"
288#endif
289#endif
290 ;
291#endif
292
293#if defined BB_DUMPKMAP
294const char dumpkmap_usage[] =
295 "dumpkmap > keymap"
296#ifndef BB_FEATURE_TRIVIAL_HELP
297 "\n\nPrints out a binary keyboard translation table to standard input."
298#endif
299 ;
300#endif
301
302#if defined BB_DUTMP
303const char dutmp_usage[] =
304 "dutmp [FILE]"
305#ifndef BB_FEATURE_TRIVIAL_HELP
306 "\n\nDump utmp file format (pipe delimited) from FILE\n"
307 "or stdin to stdout. (i.e. 'dutmp /var/run/utmp')"
308#endif
309 ;
310#endif
311
312#if defined BB_ECHO
313const char echo_usage[] =
314 "echo [-neE] [ARG ...]"
315#ifndef BB_FEATURE_TRIVIAL_HELP
316 "\n\nPrints the specified ARGs to stdout\n\n"
317 "Options:\n"
318 "\t-n\tsuppress trailing newline\n"
319 "\t-e\tinterpret backslash-escaped characters (i.e. \\t=tab etc)\n"
320 "\t-E\tdisable interpretation of backslash-escaped characters"
321#endif
322 ;
323#endif
324
325#if defined BB_EXPR
326const char expr_usage[] =
327 "expr EXPRESSION"
328#ifndef BB_FEATURE_TRIVIAL_HELP
329"\n\nPrints the value of EXPRESSION to standard output.\n\n"
330"EXPRESSION may be:\n"
331"ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2\n"
332"ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0\n"
333"ARG1 < ARG2 ARG1 is less than ARG2\n"
334"ARG1 <= ARG2 ARG1 is less than or equal to ARG2\n"
335"ARG1 = ARG2 ARG1 is equal to ARG2\n"
336"ARG1 != ARG2 ARG1 is unequal to ARG2\n"
337"ARG1 >= ARG2 ARG1 is greater than or equal to ARG2\n"
338"ARG1 > ARG2 ARG1 is greater than ARG2\n"
339"ARG1 + ARG2 arithmetic sum of ARG1 and ARG2\n"
340"ARG1 - ARG2 arithmetic difference of ARG1 and ARG2\n"
341"ARG1 * ARG2 arithmetic product of ARG1 and ARG2\n"
342"ARG1 / ARG2 arithmetic quotient of ARG1 divided by ARG2\n"
343"ARG1 % ARG2 arithmetic remainder of ARG1 divided by ARG2\n"
344"STRING : REGEXP anchored pattern match of REGEXP in STRING\n"
345"match STRING REGEXP same as STRING : REGEXP\n"
346"substr STRING POS LENGTH substring of STRING, POS counted from 1\n"
347"index STRING CHARS index in STRING where any CHARS is found, or 0\n"
348"length STRING length of STRING\n"
349"quote TOKEN interpret TOKEN as a string, even if it is a \n"
350" keyword like `match' or an operator like `/'\n"
351"( EXPRESSION ) value of EXPRESSION\n\n"
352"Beware that many operators need to be escaped or quoted for shells.\n"
353"Comparisons are arithmetic if both ARGs are numbers, else\n"
354"lexicographical. Pattern matches return the string matched between \n"
355"\\( and \\) or null; if \\( and \\) are not used, they return the number \n"
356"of characters matched or 0."
357
358#endif
359 ;
360#endif
361
362
363#if defined BB_TRUE_FALSE
364const char false_usage[] =
365 "false"
366#ifndef BB_FEATURE_TRIVIAL_HELP
367 "\n\nReturn an exit code of FALSE (1)."
368#endif
369 ;
370#endif
371
372#if defined BB_FDFLUSH
373const char fdflush_usage[] =
374 "fdflush DEVICE"
375#ifndef BB_FEATURE_TRIVIAL_HELP
376 "\n\nForces floppy disk drive to detect disk change"
377#endif
378 ;
379#endif
380
381#if defined BB_FIND
382const char find_usage[] =
383 "find [PATH...] [EXPRESSION]"
384#ifndef BB_FEATURE_TRIVIAL_HELP
385 "\n\nSearch for files in a directory hierarchy. The default PATH is\n"
386 "the current directory; default EXPRESSION is '-print'\n\n"
387 "\nEXPRESSION may consist of:\n"
388 "\t-follow\t\tDereference symbolic links.\n"
389 "\t-name PATTERN\tFile name (leading directories removed) matches PATTERN.\n"
390#ifdef BB_FEATURE_FIND_TYPE
391 "\t-type X\t\tFiletype matches X (where X is one of: f,d,l,b,c,...)\n"
392#endif
393#ifdef BB_FEATURE_FIND_PERM
394 "\t-perm PERMS\tPermissions match any of (+NNN); all of (-NNN); or exactly (NNN)\n"
395#endif
396#ifdef BB_FEATURE_FIND_MTIME
397 "\t-mtime TIME\tModified time is greater than (+N); less than (-N); or exactly (N) days\n"
398#endif
399#endif
400 ;
401#endif
402
403#if defined BB_FREE
404const char free_usage[] =
405 "free"
406#ifndef BB_FEATURE_TRIVIAL_HELP
407 "\n\nDisplays the amount of free and used system memory"
408#endif
409 ;
410#endif
411
412#if defined BB_FREERAMDISK
413const char freeramdisk_usage[] =
414 "freeramdisk DEVICE"
415#ifndef BB_FEATURE_TRIVIAL_HELP
416 "\n\nFrees all memory used by the specified ramdisk."
417#endif
418 ;
419#endif
420
421#if defined BB_FSCK_MINIX
422const char fsck_minix_usage[] =
423 "Usage: fsck.minix [-larvsmf] /dev/name"
424#ifndef BB_FEATURE_TRIVIAL_HELP
425 "\n\nPerforms a consistency check for MINIX filesystems.\n\n"
426 "Options:\n"
427 "\t-l\tLists all filenames\n"
428 "\t-r\tPerform interactive repairs\n"
429 "\t-a\tPerform automatic repairs\n"
430 "\t-v\tverbose\n"
431 "\t-s\tOutputs super-block information\n"
432 "\t-m\tActivates MINIX-like \"mode not cleared\" warnings\n"
433 "\t-f\tForce file system check."
434#endif
435 ;
436#endif
437
438#if defined BB_GETOPT
439const char getopt_usage[] =
440"getopt [OPTIONS]..."
441#ifndef BB_FEATURE_TRIVIAL_HELP
442"\nParse command options\n"
443" -a, --alternative Allow long options starting with single -\n"
444" -l, --longoptions=longopts Long options to be recognized\n"
445" -n, --name=progname The name under which errors are reported\n"
446" -o, --options=optstring Short options to be recognized\n"
447" -q, --quiet Disable error reporting by getopt(3)\n"
448" -Q, --quiet-output No normal output\n"
449" -s, --shell=shell Set shell quoting conventions\n"
450" -T, --test Test for getopt(1) version\n"
451" -u, --unqote Do not quote the output"
452#endif
453;
454#endif
455
456#if defined BB_GREP
457const char grep_usage[] =
458 "grep [-ihHnqvs] pattern [files...]"
459#ifndef BB_FEATURE_TRIVIAL_HELP
460 "\n\nSearch for PATTERN in each FILE or standard input.\n\n"
461 "Options:\n"
462 "\t-H\tprefix output lines with filename where match was found\n"
463 "\t-h\tsuppress the prefixing filename on output\n"
464 "\t-i\tignore case distinctions\n"
465 "\t-n\tprint line number with output lines\n"
466 "\t-q\tbe quiet. Returns 0 if result was found, 1 otherwise\n"
467 "\t-v\tselect non-matching lines\n"
468 "\t-s\tsuppress file open/read error messages"
469#endif
470 ;
471#endif
472
473#if defined BB_GUNZIP
474const char gunzip_usage[] =
475 "gunzip [OPTION]... FILE"
476#ifndef BB_FEATURE_TRIVIAL_HELP
477 "\n\nUncompress FILE (or standard input if FILE is '-').\n\n"
478 "Options:\n"
479 "\t-c\tWrite output to standard output\n"
480 "\t-t\tTest compressed file integrity"
481#endif
482 ;
483#endif
484
485#if defined BB_GZIP
486const char gzip_usage[] =
487 "gzip [OPTION]... FILE"
488#ifndef BB_FEATURE_TRIVIAL_HELP
489 "\n\nCompress FILE with maximum compression.\n"
490 "When FILE is '-', reads standard input. Implies -c.\n\n"
491 "Options:\n"
492 "\t-c\tWrite output to standard output instead of FILE.gz\n"
493 "\t-d\tdecompress"
494#endif
495 ;
496#endif
497
498#if defined BB_HALT
499const char halt_usage[] =
500 "halt"
501#ifndef BB_FEATURE_TRIVIAL_HELP
502 "\n\nHalt the system."
503#endif
504 ;
505#endif
506
507#if defined BB_HEAD
508const char head_usage[] =
509 "head [OPTION] [FILE]..."
510#ifndef BB_FEATURE_TRIVIAL_HELP
511 "\n\nPrint first 10 lines of each FILE to standard output.\n"
512 "With more than one FILE, precede each with a header giving the\n"
513 "file name. With no FILE, or when FILE is -, read standard input.\n\n"
514
515 "Options:\n" "\t-n NUM\t\tPrint first NUM lines instead of first 10"
516#endif
517 ;
518#endif
519
520#if defined BB_HOSTID
521const char hostid_usage[] =
522 "hostid"
523#ifndef BB_FEATURE_TRIVIAL_HELP
524 "\n\nPrint out a unique 32-bit identifier for the machine."
525#endif
526 ;
527#endif
528
529#if defined BB_HOSTNAME
530const char hostname_usage[] =
531 "hostname [OPTION] {hostname | -F file}"
532#ifndef BB_FEATURE_TRIVIAL_HELP
533 "\n\nGet or set the hostname or DNS domain name. If a hostname is given\n"
534 "(or a file with the -F parameter), the host name will be set.\n\n"
535
536 "Options:\n"
537 "\t-s\t\tShort\n"
538 "\t-i\t\tAddresses for the hostname\n"
539 "\t-d\t\tDNS domain name\n"
540 "\t-F, --file FILE\tUse the contents of FILE to specify the hostname"
541#endif
542 ;
543#endif
544
545#if defined BB_ID
546const char id_usage[] =
547 "id [OPTIONS]... [USERNAME]"
548#ifndef BB_FEATURE_TRIVIAL_HELP
549 "\n\nPrint information for USERNAME or the current user\n\n"
550 "Options:\n"
551 "\t-g\tprints only the group ID\n"
552 "\t-u\tprints only the user ID\n"
553 "\t-n\tprint a name instead of a number (with for -ug)\n"
554 "\t-r\tprints the real user ID instead of the effective ID (with -ug)"
555#endif
556 ;
557#endif
558
559#if defined BB_IFCONFIG
560const char ifconfig_usage[] =
561 "ifconfig [-a] [-i] [-v] <interface> [<address>]"
562#ifndef BB_FEATURE_TRIVIAL_HELP
563 "\n\nconfigure a network interface\n\n"
564 "Options:\n"
565 " [[-]broadcast [<address>]] [[-]pointopoint [<address>]]\n"
566 " [netmask <address>] [dstaddr <address>] [tunnel <adress>]\n"
567#ifdef SIOCSKEEPALIVE
568 " [outfill <NN>] [keepalive <NN>]\n"
569#endif
570 " [hw ether <address>] [metric <NN>] [mtu <NN>]\n"
571 " [[-]trailers] [[-]arp] [[-]allmulti]\n"
572 " [multicast] [[-]promisc]\n"
573 " [mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]\n"
574 " [up|down] ..."
575#endif
576 ;
577#endif
578
579#if defined BB_INSMOD
580const char insmod_usage[] =
581 "insmod [OPTION]... MODULE [symbol=value]..."
582#ifndef BB_FEATURE_TRIVIAL_HELP
583 "\n\nLoads the specified kernel modules into the kernel.\n\n"
584 "Options:\n"
585 "\t-f\tForce module to load into the wrong kernel version.\n"
586 "\t-k\tMake module autoclean-able.\n"
587 "\t-v\tverbose output\n"
588 "\t-L\tLock to prevent simultaneous loads of a module\n"
589 "\t-x\tdo not export externs"
590#endif
591 ;
592#endif
593
594#if defined BB_KILL
595const char kill_usage[] =
596 "kill [-signal] process-id [process-id ...]"
597#ifndef BB_FEATURE_TRIVIAL_HELP
598 "\n\nSend a signal (default is SIGTERM) to the specified process(es).\n\n"
599 "Options:\n" "\t-l\tList all signal names and numbers."
600#endif
601 ;
602#endif
603
604#if defined BB_KILLALL
605const char killall_usage[] =
606 "killall [-signal] process-name [process-name ...]"
607#ifndef BB_FEATURE_TRIVIAL_HELP
608 "\n\nSend a signal (default is SIGTERM) to the specified process(es).\n\n"
609 "Options:\n" "\t-l\tList all signal names and numbers."
610#endif
611 ;
612#endif
613
614#if defined BB_LENGTH
615const char length_usage[] =
616 "length STRING"
617#ifndef BB_FEATURE_TRIVIAL_HELP
618 "\n\nPrints out the length of the specified STRING."
619#endif
620 ;
621#endif
622
623#if defined BB_LN
624const char ln_usage[] =
625 "ln [OPTION] TARGET... LINK_NAME|DIRECTORY"
626#ifndef BB_FEATURE_TRIVIAL_HELP
627 "\n\nCreate a link named LINK_NAME or DIRECTORY to the specified TARGET\n"
628 "\nYou may use '--' to indicate that all following arguments are non-options.\n\n"
629 "Options:\n"
630 "\t-s\tmake symbolic links instead of hard links\n"
631 "\t-f\tremove existing destination files\n"
632 "\t-n\tno dereference symlinks - treat like normal file"
633#endif
634 ;
635#endif
636
637#if defined BB_LOADACM
638const char loadacm_usage[] =
639 "loadacm < mapfile"
640#ifndef BB_FEATURE_TRIVIAL_HELP
641 "\n\nLoads an acm from standard input."
642#endif
643 ;
644#endif
645
646#if defined BB_LOADFONT
647const char loadfont_usage[] =
648 "loadfont < font"
649#ifndef BB_FEATURE_TRIVIAL_HELP
650 "\n\nLoads a console font from standard input."
651#endif
652 ;
653#endif
654
655#if defined BB_LOADKMAP
656const char loadkmap_usage[] =
657 "loadkmap < keymap"
658#ifndef BB_FEATURE_TRIVIAL_HELP
659 "\n\nLoads a binary keyboard translation table from standard input."
660#endif
661 ;
662#endif
663
664#if defined BB_LOGGER
665const char logger_usage[] =
666 "logger [OPTION]... [MESSAGE]"
667#ifndef BB_FEATURE_TRIVIAL_HELP
668 "\n\nWrite MESSAGE to the system log. If MESSAGE is omitted, log stdin.\n\n"
669 "Options:\n"
670 "\t-s\tLog to stderr as well as the system log.\n"
671 "\t-t\tLog using the specified tag (defaults to user name).\n"
672 "\t-p\tEnter the message with the specified priority.\n"
673 "\t\tThis may be numerical or a ``facility.level'' pair."
674#endif
675 ;
676#endif
677
678#if defined BB_LOGNAME
679const char logname_usage[] =
680 "logname"
681#ifndef BB_FEATURE_TRIVIAL_HELP
682 "\n\nPrint the name of the current user."
683#endif
684 ;
685#endif
686
687#if defined BB_LS
688const char ls_usage[] =
689 "ls [-1Aa"
690#ifdef BB_FEATURE_LS_TIMESTAMPS
691 "c"
692#endif
693 "Cd"
694#ifdef BB_FEATURE_LS_TIMESTAMPS
695 "e"
696#endif
697#ifdef BB_FEATURE_LS_FILETYPES
698 "F"
699#endif
700 "iln"
701#ifdef BB_FEATURE_LS_FILETYPES
702 "p"
703#endif
704#ifdef BB_FEATURE_LS_FOLLOWLINKS
705 "L"
706#endif
707#ifdef BB_FEATURE_LS_RECURSIVE
708 "R"
709#endif
710#ifdef BB_FEATURE_LS_SORTFILES
711 "rS"
712#endif
713 "s"
714#ifdef BB_FEATURE_AUTOWIDTH
715 "T"
716#endif
717#ifdef BB_FEATURE_LS_TIMESTAMPS
718 "tu"
719#endif
720#ifdef BB_FEATURE_LS_SORTFILES
721 "v"
722#endif
723#ifdef BB_FEATURE_AUTOWIDTH
724 "w"
725#endif
726 "x"
727#ifdef BB_FEATURE_LS_SORTFILES
728 "X"
729#endif
730#ifdef BB_FEATURE_HUMAN_READABLE
731 "h"
732#endif
733 "k] [filenames...]\n"
734#ifndef BB_FEATURE_TRIVIAL_HELP
735 "\n\nList directory contents\n\n"
736 "Options:\n"
737 "\t-1\tlist files in a single column\n"
738 "\t-A\tdo not list implied . and ..\n"
739 "\t-a\tdo not hide entries starting with .\n"
740 "\t-C\tlist entries by columns\n"
741#ifdef BB_FEATURE_LS_TIMESTAMPS
742 "\t-c\twith -l: show ctime (the time of last\n"
743 "\t\tmodification of file status information)\n"
744#endif
745 "\t-d\tlist directory entries instead of contents\n"
746#ifdef BB_FEATURE_LS_TIMESTAMPS
747 "\t-e\tlist both full date and full time\n"
748#endif
749#ifdef BB_FEATURE_LS_FILETYPES
750 "\t-F\tappend indicator (one of */=@|) to entries\n"
751#endif
752 "\t-i\tlist the i-node for each file\n"
753 "\t-l\tuse a long listing format\n"
754 "\t-n\tlist numeric UIDs and GIDs instead of names\n"
755#ifdef BB_FEATURE_LS_FILETYPES
756 "\t-p\tappend indicator (one of /=@|) to entries\n"
757#endif
758#ifdef BB_FEATURE_LS_FOLLOWLINKS
759 "\t-L\tlist entries pointed to by symbolic links\n"
760#endif
761#ifdef BB_FEATURE_LS_RECURSIVE
762 "\t-R\tlist subdirectories recursively\n"
763#endif
764#ifdef BB_FEATURE_LS_SORTFILES
765 "\t-r\tsort the listing in reverse order\n"
766 "\t-S\tsort the listing by file size\n"
767#endif
768 "\t-s\tlist the size of each file, in blocks\n"
769#ifdef BB_FEATURE_AUTOWIDTH
770 "\t-T NUM\tassume Tabstop every NUM columns\n"
771#endif
772#ifdef BB_FEATURE_LS_TIMESTAMPS
773 "\t-t\twith -l: show modification time (the time of last\n"
774 "\t\tchange of the file)\n"
775 "\t-u\twith -l: show access time (the time of last\n"
776 "\t\taccess of the file)\n"
777#endif
778#ifdef BB_FEATURE_LS_SORTFILES
779 "\t-v\tsort the listing by version\n"
780#endif
781#ifdef BB_FEATURE_AUTOWIDTH
782 "\t-w NUM\tassume the terminal is NUM columns wide\n"
783#endif
784 "\t-x\tlist entries by lines instead of by columns\n"
785#ifdef BB_FEATURE_LS_SORTFILES
786 "\t-X\tsort the listing by extension\n"
787#endif
788
789#ifdef BB_FEATURE_HUMAN_READABLE
790 "\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n"
791 "\t-k\tprint sizes in kilobytes(default)\n"
792#else
793 "\t-k\tprint sizes in kilobytes(compatability)"
794#endif
795
796#endif /* BB_FEATURE_TRIVIAL_HELP */
797 ;
798#endif /* BB_LS */
799
800#if defined BB_LSMOD
801const char lsmod_usage[] =
802 "lsmod"
803#ifndef BB_FEATURE_TRIVIAL_HELP
804 "\n\nList the currently loaded kernel modules."
805#endif
806 ;
807#endif
808
809#if defined BB_MAKEDEVS
810const char makedevs_usage[] =
811 "makedevs NAME TYPE MAJOR MINOR FIRST LAST [s]"
812#ifndef BB_FEATURE_TRIVIAL_HELP
813 "\n\nCreates a range of block or character special files\n\n"
814 "TYPEs include:\n"
815 "\tb:\tMake a block (buffered) device.\n"
816 "\tc or u:\tMake a character (un-buffered) device.\n"
817 "\tp:\tMake a named pipe. MAJOR and MINOR are ignored for named pipes.\n\n"
818 "FIRST specifies the number appended to NAME to create the first device.\n"
819 "LAST specifies the number of the last item that should be created.\n"
820 "If 's' is the last argument, the base device is created as well.\n\n"
821 "For example:\n"
822 "\tmakedevs /dev/ttyS c 4 66 2 63 -> ttyS2-ttyS63\n"
823 "\tmakedevs /dev/hda b 3 0 0 8 s -> hda,hda1-hda8"
824#endif
825 ;
826#endif
827
828#if defined BB_MD5SUM
829const char md5sum_usage[] =
830 "md5sum [OPTION] [FILE]...\n"
831 "or: md5sum [OPTION] -c [FILE]"
832#ifndef BB_FEATURE_TRIVIAL_HELP
833 "\n\nPrint or check MD5 checksums.\n\n"
834 "Options:\n"
835 "With no FILE, or when FILE is -, read standard input.\n\n"
836 "\t-b\tread files in binary mode\n"
837 "\t-c\tcheck MD5 sums against given list\n"
838 "\t-t\tread files in text mode (default)\n"
839 "\t-g\tread a string\n"
840 "\nThe following two options are useful only when verifying checksums:\n"
841 "\t-s,\tdon't output anything, status code shows success\n"
842 "\t-w,\twarn about improperly formated MD5 checksum lines"
843#endif
844 ;
845#endif
846
847#if defined BB_MKDIR
848const char mkdir_usage[] =
849 "mkdir [OPTION] DIRECTORY..."
850#ifndef BB_FEATURE_TRIVIAL_HELP
851 "\n\nCreate the DIRECTORY(ies), if they do not already exist\n\n"
852
853 "Options:\n"
854 "\t-m\tset permission mode (as in chmod), not rwxrwxrwx - umask\n"
855 "\t-p\tno error if existing, make parent directories as needed"
856#endif
857 ;
858#endif
859
860#if defined BB_MKFIFO
861const char mkfifo_usage[] =
862 "mkfifo [OPTIONS] name"
863#ifndef BB_FEATURE_TRIVIAL_HELP
864 "\n\nCreates a named pipe (identical to 'mknod name p')\n\n"
865 "Options:\n"
866 "\t-m\tcreate the pipe using the specified mode (default a=rw)"
867#endif
868 ;
869#endif
870
871#if defined BB_MKFS_MINIX
872const char mkfs_minix_usage[] =
873 "mkfs.minix [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]"
874#ifndef BB_FEATURE_TRIVIAL_HELP
875 "\n\nMake a MINIX filesystem.\n\n"
876 "Options:\n"
877 "\t-c\t\tCheck the device for bad blocks\n"
878 "\t-n [14|30]\tSpecify the maximum length of filenames\n"
879 "\t-i INODES\tSpecify the number of inodes for the filesystem\n"
880 "\t-l FILENAME\tRead the bad blocks list from FILENAME\n"
881 "\t-v\t\tMake a Minix version 2 filesystem"
882#endif
883 ;
884#endif
885
886#if defined BB_MKNOD
887const char mknod_usage[] =
888 "mknod [OPTIONS] NAME TYPE MAJOR MINOR"
889#ifndef BB_FEATURE_TRIVIAL_HELP
890 "\n\nCreate a special file (block, character, or pipe).\n\n"
891 "Options:\n"
892 "\t-m\tcreate the special file using the specified mode (default a=rw)\n\n"
893 "TYPEs include:\n"
894 "\tb:\tMake a block (buffered) device.\n"
895 "\tc or u:\tMake a character (un-buffered) device.\n"
896 "\tp:\tMake a named pipe. MAJOR and MINOR are ignored for named pipes."
897#endif
898 ;
899#endif
900
901#if defined BB_MKSWAP
902const char mkswap_usage[] =
903 "mkswap [-c] [-v0|-v1] device [block-count]"
904#ifndef BB_FEATURE_TRIVIAL_HELP
905 "\n\nPrepare a disk partition to be used as a swap partition.\n\n"
906 "Options:\n" "\t-c\t\tCheck for read-ability.\n"
907 "\t-v0\t\tMake version 0 swap [max 128 Megs].\n"
908 "\t-v1\t\tMake version 1 swap [big!] (default for kernels > 2.1.117).\n"
909 "\tblock-count\tNumber of block to use (default is entire partition)."
910#endif
911 ;
912#endif
913
914#if defined BB_MKTEMP
915const char mktemp_usage[] =
916 "mktemp [-q] TEMPLATE"
917#ifndef BB_FEATURE_TRIVIAL_HELP
918 "\n\nCreates a temporary file with its name based on TEMPLATE.\n"
919 "TEMPLATE is any name with six `Xs' (i.e. /tmp/temp.XXXXXX)."
920#endif
921 ;
922#endif
923
924#if defined BB_MORE
925const char more_usage[] =
926 "more [FILE ...]"
927#ifndef BB_FEATURE_TRIVIAL_HELP
928 "\n\nMore is a filter for viewing FILE one screenful at a time."
929#endif
930 ;
931#endif
932
933#if defined BB_MOUNT
934const char mount_usage[] =
935 "mount [flags] device directory [-o options,more-options]"
936#ifndef BB_FEATURE_TRIVIAL_HELP
937 "\n\nMount a filesystem\n\n"
938 "Flags:\n"
939 "\t-a:\t\tMount all filesystems in fstab.\n"
940#ifdef BB_MTAB
941 "\t-f:\t\t\"Fake\" mount. Add entry to mount table but don't mount it.\n"
942 "\t-n:\t\tDon't write a mount table entry.\n"
943#endif
944 "\t-o option:\tOne of many filesystem options, listed below.\n"
945 "\t-r:\t\tMount the filesystem read-only.\n"
946 "\t-t fs-type:\tSpecify the filesystem type.\n"
947 "\t-w:\t\tMount for reading and writing (default).\n"
948 "\n"
949 "Options for use with the \"-o\" flag:\n"
950 "\tasync/sync:\tWrites are asynchronous / synchronous.\n"
951 "\tatime/noatime:\tEnable / disable updates to inode access times.\n"
952 "\tdev/nodev:\tAllow use of special device files / disallow them.\n"
953 "\texec/noexec:\tAllow use of executable files / disallow them.\n"
954#if defined BB_FEATURE_MOUNT_LOOP
955 "\tloop:\t\tMounts a file via loop device.\n"
956#endif
957 "\tsuid/nosuid:\tAllow set-user-id-root programs / disallow them.\n"
958 "\tremount:\tRe-mount a currently-mounted filesystem, changing its flags.\n"
959 "\tro/rw:\t\tMount for read-only / read-write.\n"
960 "\nThere are EVEN MORE flags that are specific to each filesystem.\n"
961 "You'll have to see the written documentation for those."
962#endif
963 ;
964#endif
965
966#if defined BB_MT
967const char mt_usage[] =
968 "mt [-f device] opcode value"
969#ifndef BB_FEATURE_TRIVIAL_HELP
970 "\n\nControl magnetic tape drive operation\n"
971 "\nAvailable Opcodes:\n\n"
972 "bsf bsfm bsr bss datacompression drvbuffer eof eom erase\n"
973 "fsf fsfm fsr fss load lock mkpart nop offline ras1 ras2\n"
974 "ras3 reset retension rew rewoffline seek setblk setdensity\n"
975 "setpart tell unload unlock weof wset"
976#endif
977 ;
978#endif
979
980#if defined BB_CP_MV
981const char mv_usage[] =
982 "mv SOURCE DEST\n"
983 " or: mv SOURCE... DIRECTORY"
984#ifndef BB_FEATURE_TRIVIAL_HELP
985 "\n\nRename SOURCE to DEST, or move SOURCE(s) to DIRECTORY."
986#endif
987 ;
988#endif
989
990#if defined BB_NC
991const char nc_usage[] =
992 "nc [-p PORT] IP PORT\n"
993 " or: nc -l -p PORT"
994#ifndef BB_FEATURE_TRIVIAL_HELP
995 "\n\nNetcat opens a pipe to IP:PORT\n"
996 "Options:\n"
997 "\t-l\tListen on the socket.\n"
998 "\t-p PORT\tBind the local port to PORT."
999#endif
1000 ;
1001#endif
1002
1003#if defined BB_NSLOOKUP
1004const char nslookup_usage[] =
1005 "nslookup [HOST]"
1006#ifndef BB_FEATURE_TRIVIAL_HELP
1007 "\n\nQueries the nameserver for the IP address of the given HOST"
1008#endif
1009;
1010#endif
1011
1012#if defined BB_PING
1013#if defined BB_FEATURE_SIMPLE_PING
1014const char ping_usage[] =
1015 "ping host"
1016#ifndef BB_FEATURE_TRIVIAL_HELP
1017 "\n\nSend ICMP ECHO_REQUEST packets to network hosts"
1018#endif
1019 ;
1020#else /* ! defined BB_FEATURE_SIMPLE_PING */
1021const char ping_usage[] =
1022 "ping [OPTION]... host"
1023#ifndef BB_FEATURE_TRIVIAL_HELP
1024 "\n\nSend ICMP ECHO_REQUEST packets to network hosts.\n\n"
1025 "Options:\n"
1026 "\t-c COUNT\tSend only COUNT pings.\n"
1027 "\t-s SIZE\t\tSend SIZE data bytes in packets (default=56).\n"
1028 "\t-q\t\tQuiet mode, only displays output at start\n"
1029 "\t\t\tand when finished."
1030#endif
1031 ;
1032#endif
1033#endif
1034
1035#if defined BB_PIVOT_ROOT
1036const char pivot_root_usage[] =
1037 "pivot_root new_root put_old"
1038#ifndef BB_FEATURE_TRIVIAL_HELP
1039 "\n\nMove the current root file system to put_old and make new_root\n"
1040 "the new root file system."
1041#endif
1042 ;
1043#endif
1044
1045#if defined BB_POWEROFF
1046const char poweroff_usage[] =
1047 "poweroff"
1048#ifndef BB_FEATURE_TRIVIAL_HELP
1049 "\n\nHalt the system and request that the kernel shut off the power."
1050#endif
1051 ;
1052#endif
1053
1054#if defined BB_PRINTF
1055const char printf_usage[] =
1056 "printf FORMAT [ARGUMENT...]"
1057#ifndef BB_FEATURE_TRIVIAL_HELP
1058 "\n\nFormats and prints ARGUMENT(s) according to FORMAT,\n"
1059 "Where FORMAT controls the output exactly as in C printf."
1060#endif
1061 ;
1062#endif
1063
1064#if defined BB_PS
1065const char ps_usage[] =
1066 "ps"
1067#ifndef BB_FEATURE_TRIVIAL_HELP
1068 "\n\nReport process status\n"
1069 "\nThis version of ps accepts no options."
1070#endif
1071 ;
1072#endif
1073
1074#if defined BB_PWD
1075const char pwd_usage[] =
1076 "pwd"
1077#ifndef BB_FEATURE_TRIVIAL_HELP
1078 "\n\nPrint the full filename of the current working directory."
1079#endif
1080 ;
1081#endif
1082
1083#if defined BB_RDATE
1084const char rdate_usage[] =
1085 "rdate [OPTION] HOST"
1086#ifndef BB_FEATURE_TRIVIAL_HELP
1087 "\n\nGet and possibly set the system date and time from a remote HOST.\n"
1088 "Options:\n"
1089 "\t-s\tSet the system date and time (default).\n"
1090 "\t-p\tPrint the date and time."
1091#endif
1092 ;
1093#endif
1094
1095#if defined BB_READLINK
1096const char readlink_usage[] =
1097 "readlink"
1098#ifndef BB_FEATURE_TRIVIAL_HELP
1099 "\n\nRead a symbolic link."
1100#endif
1101 ;
1102#endif
1103
1104#if defined BB_REBOOT
1105const char reboot_usage[] =
1106 "reboot"
1107#ifndef BB_FEATURE_TRIVIAL_HELP
1108 "\n\nReboot the system."
1109#endif
1110 ;
1111#endif
1112
1113#if defined BB_RENICE
1114const char renice_usage[] =
1115 "renice priority pid [pid ...]"
1116#ifndef BB_FEATURE_TRIVIAL_HELP
1117 "\n\nChanges priority of running processes. Allowed priorities range\n"
1118 "from 20 (the process runs only when nothing else is running) to 0\n"
1119 "(default priority) to -20 (almost nothing else ever gets to run)."
1120#endif
1121 ;
1122#endif
1123
1124
1125#if defined BB_RESET
1126const char reset_usage[] =
1127 "reset"
1128#ifndef BB_FEATURE_TRIVIAL_HELP
1129 "\n\nResets the screen."
1130#endif
1131 ;
1132#endif
1133
1134#if defined BB_RM
1135const char rm_usage[] =
1136 "rm [OPTION]... FILE..."
1137#ifndef BB_FEATURE_TRIVIAL_HELP
1138 "\n\nRemove (unlink) the FILE(s). You may use '--' to\n"
1139 "indicate that all following arguments are non-options.\n\n"
1140 "Options:\n"
1141 "\t-f\t\tremove existing destinations, never prompt\n"
1142 "\t-r or -R\tremove the contents of directories recursively"
1143#endif
1144 ;
1145#endif
1146
1147#if defined BB_RMDIR
1148const char rmdir_usage[] =
1149 "rmdir [OPTION]... DIRECTORY..."
1150#ifndef BB_FEATURE_TRIVIAL_HELP
1151 "\n\nRemove the DIRECTORY(ies), if they are empty."
1152#endif
1153 ;
1154#endif
1155
1156#if defined BB_RMMOD
1157const char rmmod_usage[] =
1158 "rmmod [OPTION]... [MODULE]..."
1159#ifndef BB_FEATURE_TRIVIAL_HELP
1160 "\n\nUnloads the specified kernel modules from the kernel.\n\n"
1161 "Options:\n"
1162 "\t-a\tTry to remove all unused kernel modules."
1163#endif
1164 ;
1165#endif
1166
1167#if defined BB_ROUTE
1168const char route_usage[] =
1169 "route [{add|del|flush}]"
1170#ifndef BB_FEATURE_TRIVIAL_HELP
1171 "\n\nEdit the kernel's routing tables"
1172#endif
1173 ;
1174#endif
1175
1176#if defined BB_RPMUNPACK
1177const char rpmunpack_usage[] =
1178 "rpmunpack < package.rpm | gunzip | cpio -idmuv"
1179#ifndef BB_FEATURE_TRIVIAL_HELP
1180 "\n\nExtracts an rpm archive."
1181#endif
1182 ;
1183#endif
1184
1185#if defined BB_SED
1186const char sed_usage[] =
1187 "sed [-Vhnef] pattern [files...]"
1188#ifndef BB_FEATURE_TRIVIAL_HELP
1189 "\n\n"
1190 "-n\t\tsuppress automatic printing of pattern space\n"
1191 "-e script\tadd the script to the commands to be executed\n"
1192 "-f scriptfile\tadd the contents of script-file to the commands to be executed\n"
1193 "-h\t\tdisplay this help message\n"
1194 "\n"
1195 "If no -e or -f is given, the first non-option argument is taken as the\n"
1196 "sed script to interpret. All remaining arguments are names of input\n"
1197 "files; if no input files are specified, then the standard input is read."
1198#endif
1199 ;
1200#endif
1201
1202#if defined BB_SETKEYCODES
1203const char setkeycodes_usage[] =
1204 "setkeycodes SCANCODE KEYCODE ..."
1205#ifndef BB_FEATURE_TRIVIAL_HELP
1206 "\n\nSet entries into the kernel's scancode-to-keycode map,\n"
1207 "allowing unusual keyboards to generate usable keycodes.\n\n"
1208 "SCANCODE may be either xx or e0xx (hexadecimal),\n"
1209 "and KEYCODE is given in decimal"
1210#endif
1211 ;
1212#endif
1213
1214#if defined BB_SH
1215const char shell_usage[] =
1216 "sh [FILE]...\n"
1217 " or: sh -c command [args]..."
1218#ifndef BB_FEATURE_TRIVIAL_HELP
1219 "\n\nlash: The BusyBox command interpreter (shell)."
1220#endif
1221 ;
1222#endif
1223
1224#if defined BB_SLEEP
1225const char sleep_usage[] =
1226 "sleep N"
1227#ifndef BB_FEATURE_TRIVIAL_HELP
1228 "\n\nPause for N seconds."
1229#endif
1230 ;
1231#endif
1232
1233#if defined BB_SORT
1234const char sort_usage[] =
1235 "sort [-n]"
1236#ifdef BB_FEATURE_SORT_REVERSE
1237 " [-r]"
1238#endif
1239 " [FILE]..."
1240#ifndef BB_FEATURE_TRIVIAL_HELP
1241 "\n\nSorts lines of text in the specified files"
1242#endif
1243 ;
1244#endif
1245
1246#if defined BB_STTY
1247const char stty_usage[] =
1248 "stty [-a|g] [-F device] [SETTING]..."
1249#ifndef BB_FEATURE_TRIVIAL_HELP
1250 "\n\nWithout arguments, prints baud rate, line discipline,"
1251 "\nand deviations from stty sane."
1252 "\n -F device open and use the specified device instead of stdin"
1253 "\n -a print all current settings in human-readable form. Or"
1254 "\n -g print in a stty-readable form"
1255 "\n [SETTING] see in documentation"
1256#endif
1257 ;
1258#endif
1259
1260#if defined BB_SWAPONOFF
1261const char swapoff_usage[] =
1262 "swapoff [OPTION] [device]"
1263#ifndef BB_FEATURE_TRIVIAL_HELP
1264 "\n\nStop swapping virtual memory pages on the given device.\n\n"
1265 "Options:\n"
1266 "\t-a\tStop swapping on all swap devices"
1267#endif
1268 ;
1269#endif
1270
1271#if defined BB_SWAPONOFF
1272const char swapon_usage[] =
1273 "swapon [OPTION] [device]"
1274#ifndef BB_FEATURE_TRIVIAL_HELP
1275 "\n\nStart swapping virtual memory pages on the given device.\n\n"
1276 "Options:\n"
1277 "\t-a\tStart swapping on all swap devices"
1278#endif
1279 ;
1280#endif
1281
1282#if defined BB_SYNC
1283const char sync_usage[] =
1284 "sync"
1285#ifndef BB_FEATURE_TRIVIAL_HELP
1286 "\n\nWrite all buffered filesystem blocks to disk."
1287#endif
1288 ;
1289#endif
1290
1291#if defined BB_SYSLOGD
1292const char syslogd_usage[] =
1293 "syslogd [OPTION]..."
1294#ifndef BB_FEATURE_TRIVIAL_HELP
1295 "\n\nLinux system and kernel (provides klogd) logging utility.\n"
1296 "Note that this version of syslogd/klogd ignores /etc/syslog.conf.\n\n"
1297 "Options:\n"
1298 "\t-m NUM\t\tInterval between MARK lines (default=20min, 0=off)\n"
1299 "\t-n\t\tRun as a foreground process\n"
1300#ifdef BB_FEATURE_KLOGD
1301 "\t-K\t\tDo not start up the klogd process\n"
1302#endif
1303 "\t-O FILE\t\tUse an alternate log file (default=/var/log/messages)"
1304#ifdef BB_FEATURE_REMOTE_LOG
1305 "\n\t-R HOST[:PORT]\t\tLog remotely to IP or hostname on PORT (default PORT=514/UDP)\n"
1306 "\t-L\t\tLog locally as well as network logging (default is network only)"
1307#endif
1308#endif
1309 ;
1310#endif
1311
1312#if defined BB_TAIL
1313const char tail_usage[] =
1314 "tail [OPTION]... [FILE]..."
1315#ifndef BB_FEATURE_TRIVIAL_HELP
1316 "\n\nPrint last 10 lines of each FILE to standard output.\n"
1317 "With more than one FILE, precede each with a header giving the\n"
1318 "file name. With no FILE, or when FILE is -, read standard input.\n\n"
1319 "Options:\n"
1320#ifndef BB_FEATURE_SIMPLE_TAIL
1321 "\t-c N[kbm]\toutput the last N bytes\n"
1322#endif
1323 "\t-n N[kbm]\tprint last N lines instead of last 10\n"
1324 "\t-f\t\toutput data as the file grows"
1325#ifndef BB_FEATURE_SIMPLE_TAIL
1326 "\n\t-q\t\tnever output headers giving file names\n"
1327 "\t-s SEC\t\twait SEC seconds between reads with -f\n"
1328 "\t-v\t\talways output headers giving file names\n\n"
1329 "If the first character of N (bytes or lines) is a `+', output begins with \n"
1330 "the Nth item from the start of each file, otherwise, print the last N items\n"
1331 "in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2)."
1332//#else
1333// "\nIf the first character of N (bytes or lines) is a `+', output begins with \n"
1334// "the Nth item from the start of each file."
1335#endif
1336#endif
1337 ;
1338#endif
1339
1340#if defined BB_TAR
1341const char tar_usage[] =
1342#ifdef BB_FEATURE_TAR_CREATE
1343 "tar -[cxtvO] "
1344#else
1345 "tar -[xtvO] "
1346#endif
1347#if defined BB_FEATURE_TAR_EXCLUDE
1348 "[--exclude File] "
1349 "[-X File]"
1350#endif
1351 "[-f tarFile] [FILE(s)] ..."
1352#ifndef BB_FEATURE_TRIVIAL_HELP
1353 "\n\nCreate, extract, or list files from a tar file.\n\n"
1354 "Main operation mode:\n"
1355#ifdef BB_FEATURE_TAR_CREATE
1356 "\tc\t\tcreate\n"
1357#endif
1358 "\tx\t\textract\n"
1359 "\tt\t\tlist\n"
1360 "\nFile selection:\n"
1361 "\tf\t\tname of tarfile or \"-\" for stdin\n"
1362 "\tO\t\textract to stdout\n"
1363#if defined BB_FEATURE_TAR_EXCLUDE
1364 "\texclude\t\tfile to exclude\n"
1365 "\tX\t\tfile with names to exclude\n"
1366#endif
1367 "\nInformative output:\n"
1368 "\tv\t\tverbosely list files processed"
1369#endif
1370 ;
1371#endif
1372
1373#if defined BB_TEE
1374const char tee_usage[] =
1375 "tee [OPTION]... [FILE]..."
1376#ifndef BB_FEATURE_TRIVIAL_HELP
1377 "\n\nCopy standard input to each FILE, and also to standard output.\n\n"
1378 "Options:\n" "\t-a\tappend to the given FILEs, do not overwrite"
1379#endif
1380 ;
1381#endif
1382
1383#if defined BB_TELNET
1384const char telnet_usage[] =
1385 "telnet host [port]"
1386#ifndef BB_FEATURE_TRIVIAL_HELP
1387 "\n\nTelnet is used to establish interactive communication with another\n"
1388 "computer over a network using the TELNET protocol."
1389#endif
1390 ;
1391#endif
1392
1393#if defined BB_TEST
1394const char test_usage[] =
1395 "test EXPRESSION\n"
1396 "or [ EXPRESSION ]"
1397#ifndef BB_FEATURE_TRIVIAL_HELP
1398 "\n\nChecks file types and compares values returning an exit\n"
1399 "code determined by the value of EXPRESSION."
1400#endif
1401 ;
1402#endif
1403
1404#if defined BB_TOUCH
1405const char touch_usage[] =
1406 "touch [-c] file [file ...]"
1407#ifndef BB_FEATURE_TRIVIAL_HELP
1408 "\n\nUpdate the last-modified date on the given file[s].\n\n"
1409 "Options:\n"
1410 "\t-c\tDo not create any files"
1411#endif
1412 ;
1413#endif
1414
1415#if defined BB_TR
1416const char tr_usage[] =
1417 "tr [-cds] STRING1 [STRING2]"
1418#ifndef BB_FEATURE_TRIVIAL_HELP
1419 "\n\nTranslate, squeeze, and/or delete characters from\n"
1420 "standard input, writing to standard output.\n\n"
1421 "Options:\n"
1422 "\t-c\ttake complement of STRING1\n"
1423 "\t-d\tdelete input characters coded STRING1\n"
1424 "\t-s\tsqueeze multiple output characters of STRING2 into one character"
1425#endif
1426 ;
1427#endif
1428
1429#if defined BB_TRUE_FALSE
1430const char true_usage[] =
1431 "true"
1432#ifndef BB_FEATURE_TRIVIAL_HELP
1433 "\n\nReturn an exit code of TRUE (0)."
1434#endif
1435 ;
1436#endif
1437
1438#if defined BB_TTY
1439const char tty_usage[] =
1440 "tty"
1441#ifndef BB_FEATURE_TRIVIAL_HELP
1442 "\n\nPrint the file name of the terminal connected to standard input.\n\n"
1443 "Options:\n"
1444 "\t-s\tprint nothing, only return an exit status"
1445#endif
1446 ;
1447#endif
1448
1449#if defined BB_UMOUNT
1450const char umount_usage[] =
1451 "umount [flags] filesystem|directory"
1452#ifndef BB_FEATURE_TRIVIAL_HELP
1453 "\nUnmount file systems\n"
1454 "\nFlags:\n" "\t-a:\tUnmount all file systems"
1455#ifdef BB_MTAB
1456 " in /etc/mtab\n\t-n:\tDon't erase /etc/mtab entries\n"
1457#else
1458 "\n"
1459#endif
1460 "\t-r:\tTry to remount devices as read-only if mount is busy"
1461#if defined BB_FEATURE_MOUNT_FORCE
1462 "\n\t-f:\tForce filesystem umount (i.e. unreachable NFS server)"
1463#endif
1464#if defined BB_FEATURE_MOUNT_LOOP
1465 "\n\t-l:\tDo not free loop device (if a loop device has been used)"
1466#endif
1467#endif
1468 ;
1469#endif
1470
1471#if defined BB_UNAME
1472const char uname_usage[] =
1473 "uname [OPTION]..."
1474#ifndef BB_FEATURE_TRIVIAL_HELP
1475 "\n\nPrint certain system information. With no OPTION, same as -s.\n\n"
1476 "Options:\n"
1477 "\t-a\tprint all information\n"
1478 "\t-m\tthe machine (hardware) type\n"
1479 "\t-n\tprint the machine's network node hostname\n"
1480 "\t-r\tprint the operating system release\n"
1481 "\t-s\tprint the operating system name\n"
1482
1483 "\t-p\tprint the host processor type\n"
1484 "\t-v\tprint the operating system version"
1485#endif
1486 ;
1487#endif
1488
1489#if defined BB_UNIQ
1490const char uniq_usage[] =
1491 "uniq [OPTION]... [INPUT [OUTPUT]]"
1492#ifndef BB_FEATURE_TRIVIAL_HELP
1493 "\n\nDiscard all but one of successive identical lines from INPUT\n"
1494 "(or standard input), writing to OUTPUT (or standard output).\n"
1495 "Options:\n"
1496 "\t-c\tprefix lines by the number of occurrences\n"
1497 "\t-d\tonly print duplicate lines\n"
1498 "\t-u\tonly print unique lines"
1499#endif
1500 ;
1501#endif
1502
1503#if defined BB_UNIX2DOS
1504const char unix2dos_usage[] =
1505 "unix2dos < unixfile > dosfile"
1506#ifndef BB_FEATURE_TRIVIAL_HELP
1507 "\n\nConverts a text file from unix format to dos format."
1508#endif
1509 ;
1510#endif
1511
1512#if defined BB_UPDATE
1513const char update_usage[] =
1514 "update [options]"
1515#ifndef BB_FEATURE_TRIVIAL_HELP
1516 "\n\nPeriodically flushes filesystem buffers.\n\n"
1517 "Options:\n"
1518 "\t-S\tforce use of sync(2) instead of flushing\n"
1519 "\t-s SECS\tcall sync this often (default 30)\n"
1520 "\t-f SECS\tflush some buffers this often (default 5)"
1521#endif
1522 ;
1523#endif
1524
1525#if defined BB_UPTIME
1526const char uptime_usage[] =
1527 "uptime"
1528#ifndef BB_FEATURE_TRIVIAL_HELP
1529 "\n\nDisplay the time since the last boot."
1530#endif
1531 ;
1532#endif
1533
1534#if defined BB_USLEEP
1535const char usleep_usage[] =
1536 "usleep N"
1537#ifndef BB_FEATURE_TRIVIAL_HELP
1538 "\n\nPause for N microseconds."
1539#endif
1540 ;
1541#endif
1542
1543#if defined BB_UUDECODE
1544const char uudecode_usage[] =
1545 "uudecode [FILE]..."
1546#ifndef BB_FEATURE_TRIVIAL_HELP
1547 "\n\nUudecode a file that is uuencoded.\n\n"
1548 "Options:\n"
1549 "\t-o FILE\tdirect output to FILE"
1550#endif
1551 ;
1552#endif
1553
1554#if defined BB_UUENCODE
1555const char uuencode_usage[] =
1556 "uuencode [OPTION] [INFILE] REMOTEFILE"
1557#ifndef BB_FEATURE_TRIVIAL_HELP
1558 "\n\nUuencode a file.\n\n"
1559 "Options:\n"
1560 "\t-m\tuse base64 encoding as of RFC1521"
1561#endif
1562 ;
1563#endif
1564
1565#if defined BB_WATCHDOG
1566const char watchdog_usage[] =
1567 "watchdog dev\n"
1568#ifndef BB_FEATURE_TRIVIAL_HELP
1569 "\nPeriodically write to watchdog device \"dev\".\n"
1570#endif
1571 ;
1572#endif
1573
1574#if defined BB_WC
1575const char wc_usage[] =
1576 "wc [OPTION]... [FILE]..."
1577#ifndef BB_FEATURE_TRIVIAL_HELP
1578 "\n\nPrint line, word, and byte counts for each FILE, and a total line if\n"
1579 "more than one FILE is specified. With no FILE, read standard input.\n\n"
1580 "Options:\n"
1581 "\t-c\tprint the byte counts\n"
1582 "\t-l\tprint the newline counts\n"
1583
1584 "\t-L\tprint the length of the longest line\n"
1585 "\t-w\tprint the word counts"
1586#endif
1587 ;
1588#endif
1589
1590#if defined BB_WGET
1591const char wget_usage[] = "wget [-c] [-O file] url"
1592#ifndef BB_FEATURE_TRIVIAL_HELP
1593 "\n\nwget retrieves files via HTTP\n\n"
1594 "Options:\n"
1595 "\t-c\tcontinue retrieval of aborted transfers\n"
1596 "\t-O\tsave to filename ('-' for stdout)"
1597#endif
1598 ;
1599#endif
1600
1601#if defined BB_WHICH
1602const char which_usage[] =
1603 "which [COMMAND ...]"
1604#ifndef BB_FEATURE_TRIVIAL_HELP
1605 "\n\nLocates a COMMAND."
1606#endif
1607 ;
1608#endif
1609
1610#if defined BB_WHOAMI
1611const char whoami_usage[] =
1612 "whoami"
1613#ifndef BB_FEATURE_TRIVIAL_HELP
1614 "\n\nPrints the user name associated with the current effective user id."
1615#endif
1616 ;
1617#endif
1618
1619#if defined BB_XARGS
1620const char xargs_usage[] = "xargs [COMMAND] [ARGS...]"
1621#ifndef BB_FEATURE_TRIVIAL_HELP
1622 "\n\nExecutes COMMAND on every item given by standard input."
1623#endif
1624 ;
1625#endif
1626
1627#if defined BB_YES
1628const char yes_usage[] =
1629 "yes [OPTION]... [STRING]..."
1630#ifndef BB_FEATURE_TRIVIAL_HELP
1631 "\n\nRepeatedly outputs a line with all specified STRING(s), or `y'."
1632#endif
1633 ;
1634#endif
1635
diff --git a/usleep.c b/usleep.c
index 86dc0501b..c67c365b8 100644
--- a/usleep.c
+++ b/usleep.c
@@ -28,7 +28,7 @@
28extern int usleep_main(int argc, char **argv) 28extern int usleep_main(int argc, char **argv)
29{ 29{
30 if ((argc < 2) || (**(argv + 1) == '-')) { 30 if ((argc < 2) || (**(argv + 1) == '-')) {
31 usage(usleep_usage); 31 show_usage();
32 } 32 }
33 33
34 usleep(atoi(*(++argv))); /* return void */ 34 usleep(atoi(*(++argv))); /* return void */
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index c21f84c9a..47f9f4474 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -53,21 +53,21 @@ int dmesg_main(int argc, char **argv)
53 case 'n': 53 case 'n':
54 cmd = 8; 54 cmd = 8;
55 if (optarg == NULL) 55 if (optarg == NULL)
56 usage(dmesg_usage); 56 show_usage();
57 level = atoi(optarg); 57 level = atoi(optarg);
58 break; 58 break;
59 case 's': 59 case 's':
60 if (optarg == NULL) 60 if (optarg == NULL)
61 usage(dmesg_usage); 61 show_usage();
62 bufsize = atoi(optarg); 62 bufsize = atoi(optarg);
63 break; 63 break;
64 default: 64 default:
65 usage(dmesg_usage); 65 show_usage();
66 } 66 }
67 } 67 }
68 68
69 if (optind < argc) { 69 if (optind < argc) {
70 goto end; 70 show_usage();
71 } 71 }
72 72
73 if (cmd == 8) { 73 if (cmd == 8) {
@@ -97,7 +97,4 @@ int dmesg_main(int argc, char **argv)
97 if (lastc != '\n') 97 if (lastc != '\n')
98 putchar('\n'); 98 putchar('\n');
99 return EXIT_SUCCESS; 99 return EXIT_SUCCESS;
100 end:
101 usage(dmesg_usage);
102 return EXIT_FAILURE;
103} 100}
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c
index fcf8ddd28..f10cceae0 100644
--- a/util-linux/fdflush.c
+++ b/util-linux/fdflush.c
@@ -35,7 +35,7 @@ extern int fdflush_main(int argc, char **argv)
35 int fd; 35 int fd;
36 36
37 if (argc <= 1 || **(++argv) == '-') 37 if (argc <= 1 || **(++argv) == '-')
38 usage(fdflush_usage); 38 show_usage();
39 39
40 if ((fd = open(*argv, 0)) < 0) 40 if ((fd = open(*argv, 0)) < 0)
41 perror_msg_and_die("%s", *argv); 41 perror_msg_and_die("%s", *argv);
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c
index 8f90f40b5..cf25fae6a 100644
--- a/util-linux/freeramdisk.c
+++ b/util-linux/freeramdisk.c
@@ -40,7 +40,7 @@ freeramdisk_main(int argc, char **argv)
40 int f; 40 int f;
41 41
42 if (argc != 2 || *argv[1] == '-') { 42 if (argc != 2 || *argv[1] == '-') {
43 usage(freeramdisk_usage); 43 show_usage();
44 } 44 }
45 45
46 if ((f = open(argv[1], O_RDWR)) == -1) { 46 if ((f = open(argv[1], O_RDWR)) == -1) {
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index 9d7622006..2b4c65144 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -283,11 +283,6 @@ static void leave(int status)
283 exit(status); 283 exit(status);
284} 284}
285 285
286static void show_usage(void)
287{
288 usage(fsck_minix_usage);
289}
290
291static void die(const char *str) 286static void die(const char *str)
292{ 287{
293 error_msg("%s", str); 288 error_msg("%s", str);
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index 625263184..eb28d5d07 100644
--- a/util-linux/getopt.c
+++ b/util-linux/getopt.c
@@ -372,7 +372,7 @@ int getopt_main(int argc, char *argv[])
372 quote=0; 372 quote=0;
373 break; 373 break;
374 default: 374 default:
375 usage(getopt_usage); 375 show_usage();
376 } 376 }
377 377
378 if (!optstr) { 378 if (!optstr) {
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index 9b40faac6..6b4a3e2d1 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -255,13 +255,6 @@ static inline int bit(char * a,unsigned int i)
255#define mark_zone(x) (setbit(zone_map,(x)-FIRSTZONE+1)) 255#define mark_zone(x) (setbit(zone_map,(x)-FIRSTZONE+1))
256#define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1)) 256#define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1))
257 257
258static void show_usage() __attribute__ ((noreturn));
259
260static void show_usage()
261{
262 usage(mkfs_minix_usage);
263}
264
265/* 258/*
266 * Check to make certain that our new filesystem won't be created on 259 * Check to make certain that our new filesystem won't be created on
267 * an already mounted partition. Code adapted from mke2fs, Copyright 260 * an already mounted partition. Code adapted from mke2fs, Copyright
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c
index 7d690ad99..48637e889 100644
--- a/util-linux/mkswap.c
+++ b/util-linux/mkswap.c
@@ -287,7 +287,7 @@ int mkswap_main(int argc, char **argv)
287 287
288 PAGES = strtol(argv[0], &tmp, 0) / blocks_per_page; 288 PAGES = strtol(argv[0], &tmp, 0) / blocks_per_page;
289 if (*tmp) 289 if (*tmp)
290 usage(mkswap_usage); 290 show_usage();
291 } else 291 } else
292 device_name = argv[0]; 292 device_name = argv[0];
293 } else { 293 } else {
@@ -302,13 +302,13 @@ int mkswap_main(int argc, char **argv)
302 version = atoi(argv[0] + 2); 302 version = atoi(argv[0] + 2);
303 break; 303 break;
304 default: 304 default:
305 usage(mkswap_usage); 305 show_usage();
306 } 306 }
307 } 307 }
308 } 308 }
309 if (!device_name) { 309 if (!device_name) {
310 error_msg("error: Nowhere to set up swap on?"); 310 error_msg("error: Nowhere to set up swap on?");
311 usage(mkswap_usage); 311 show_usage();
312 } 312 }
313 sz = get_size(device_name); 313 sz = get_size(device_name);
314 if (!PAGES) { 314 if (!PAGES) {
@@ -331,12 +331,12 @@ int mkswap_main(int argc, char **argv)
331 } 331 }
332 if (version != 0 && version != 1) { 332 if (version != 0 && version != 1) {
333 error_msg("error: unknown version %d", version); 333 error_msg("error: unknown version %d", version);
334 usage(mkswap_usage); 334 show_usage();
335 } 335 }
336 if (PAGES < 10) { 336 if (PAGES < 10) {
337 error_msg("error: swap area needs to be at least %ldkB", 337 error_msg("error: swap area needs to be at least %ldkB",
338 (long) (10 * pagesize / 1024)); 338 (long) (10 * pagesize / 1024));
339 usage(mkswap_usage); 339 show_usage();
340 } 340 }
341#if 0 341#if 0
342 maxpages = ((version == 0) ? V0_MAX_PAGES : V1_MAX_PAGES); 342 maxpages = ((version == 0) ? V0_MAX_PAGES : V1_MAX_PAGES);
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 79813ba18..2f5bba59d 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -505,5 +505,5 @@ singlemount:
505 goto singlemount; 505 goto singlemount;
506 506
507goodbye: 507goodbye:
508 usage(mount_usage); 508 show_usage();
509} 509}
diff --git a/util-linux/pivot_root.c b/util-linux/pivot_root.c
index 92fe4aeab..e00710148 100644
--- a/util-linux/pivot_root.c
+++ b/util-linux/pivot_root.c
@@ -20,7 +20,7 @@ static _syscall2(int,pivot_root,const char *,new_root,const char *,put_old)
20int pivot_root_main(int argc, char **argv) 20int pivot_root_main(int argc, char **argv)
21{ 21{
22 if (argc != 3) 22 if (argc != 3)
23 usage(pivot_root_usage); 23 show_usage();
24 24
25 if (pivot_root(argv[1],argv[2]) < 0) 25 if (pivot_root(argv[1],argv[2]) < 0)
26 perror_msg_and_die("pivot_root"); 26 perror_msg_and_die("pivot_root");
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index d350be877..38a7689e9 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -95,14 +95,14 @@ int rdate_main(int argc, char **argv)
95 /* Interpret command line args */ 95 /* Interpret command line args */
96 /* do special-case option parsing */ 96 /* do special-case option parsing */
97 if (argv[1] && (strcmp(argv[1], "--help") == 0)) 97 if (argv[1] && (strcmp(argv[1], "--help") == 0))
98 usage(rdate_usage); 98 show_usage();
99 99
100 /* do normal option parsing */ 100 /* do normal option parsing */
101 while ((opt = getopt(argc, argv, "Hsp")) > 0) { 101 while ((opt = getopt(argc, argv, "Hsp")) > 0) {
102 switch (opt) { 102 switch (opt) {
103 default: 103 default:
104 case 'H': 104 case 'H':
105 usage(rdate_usage); 105 show_usage();
106 break; 106 break;
107 case 's': 107 case 's':
108 setdate++; 108 setdate++;
@@ -117,7 +117,7 @@ int rdate_main(int argc, char **argv)
117 if (printdate==0 && setdate==0) setdate++; 117 if (printdate==0 && setdate==0) setdate++;
118 118
119 if (optind == argc) { 119 if (optind == argc) {
120 usage(rdate_usage); 120 show_usage();
121 } 121 }
122 122
123 if ((time= askremotedate(argv[optind])) == (time_t)-1) { 123 if ((time= askremotedate(argv[optind])) == (time_t)-1) {
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 74f6ec36e..8dda0972a 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -107,5 +107,5 @@ extern int swap_on_off_main(int argc, char **argv)
107 return EXIT_SUCCESS; 107 return EXIT_SUCCESS;
108 108
109 usage_and_exit: 109 usage_and_exit:
110 usage((whichApp == SWAPON_APP) ? swapon_usage : swapoff_usage); 110 show_usage();
111} 111}
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 39842d232..c160ec284 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -235,7 +235,7 @@ static int umount_all(int useMtab)
235extern int umount_main(int argc, char **argv) 235extern int umount_main(int argc, char **argv)
236{ 236{
237 if (argc < 2) { 237 if (argc < 2) {
238 usage(umount_usage); 238 show_usage();
239 } 239 }
240#ifdef BB_FEATURE_CLEAN_UP 240#ifdef BB_FEATURE_CLEAN_UP
241 atexit(mtab_free); 241 atexit(mtab_free);
@@ -269,7 +269,7 @@ extern int umount_main(int argc, char **argv)
269 case 'v': 269 case 'v':
270 break; /* ignore -v */ 270 break; /* ignore -v */
271 default: 271 default:
272 usage(umount_usage); 272 show_usage();
273 } 273 }
274 } 274 }
275 275
diff --git a/utility.c b/utility.c
index 368dfc5fe..818523c38 100644
--- a/utility.c
+++ b/utility.c
@@ -40,6 +40,7 @@
40#define bb_need_full_version 40#define bb_need_full_version
41#define BB_DECLARE_EXTERN 41#define BB_DECLARE_EXTERN
42#include "messages.c" 42#include "messages.c"
43#include "usage.h"
43 44
44#include <stdio.h> 45#include <stdio.h>
45#include <string.h> 46#include <string.h>
@@ -76,12 +77,23 @@ const char mtab_file[] = "/proc/mounts";
76# endif 77# endif
77#endif 78#endif
78 79
79extern void usage(const char *usage) 80static struct BB_applet *applet_using;
81
82extern void show_usage(void)
80{ 83{
81 fprintf(stderr, "%s\n\nUsage: %s\n\n", full_version, usage); 84 static const char no_help[] = "No help available.\n";
85
86 const char *usage_string = no_help;
87
88 if (applet_using->usage_index >= 0) {
89 usage_string = usage_messages[applet_using->usage_index];
90 }
91 fprintf(stderr, "%s\n\nUsage: %s %s\n", full_version,
92 applet_using->name, usage_string);
82 exit(EXIT_FAILURE); 93 exit(EXIT_FAILURE);
83} 94}
84 95
96
85static void verror_msg(const char *s, va_list p) 97static void verror_msg(const char *s, va_list p)
86{ 98{
87 fflush(stdout); 99 fflush(stdout);
@@ -1702,6 +1714,17 @@ struct BB_applet *find_applet_by_name(const char *name)
1702 applet_name_compare); 1714 applet_name_compare);
1703} 1715}
1704 1716
1717void run_applet_by_name(const char *name, int argc, char **argv)
1718{
1719 /* Do a binary search to find the applet entry given the name. */
1720 if ((applet_using = find_applet_by_name(name)) != NULL) {
1721 applet_name = applet_using->name;
1722 if (argv[1] && strcmp(argv[1], "--help") == 0)
1723 show_usage();
1724 exit((*(applet_using->main)) (argc, argv));
1725 }
1726}
1727
1705#if defined BB_DD || defined BB_TAIL 1728#if defined BB_DD || defined BB_TAIL
1706unsigned long parse_number(const char *numstr, 1729unsigned long parse_number(const char *numstr,
1707 const struct suffix_mult *suffixes) 1730 const struct suffix_mult *suffixes)
diff --git a/uudecode.c b/uudecode.c
index cccc52872..c0e8cea8c 100644
--- a/uudecode.c
+++ b/uudecode.c
@@ -292,7 +292,7 @@ int uudecode_main (int argc,
292 break; 292 break;
293 293
294 default: 294 default:
295 usage(uudecode_usage); 295 show_usage();
296 } 296 }
297 } 297 }
298 298
diff --git a/uuencode.c b/uuencode.c
index 73098ba26..8d5af4a8a 100644
--- a/uuencode.c
+++ b/uuencode.c
@@ -167,7 +167,7 @@ int uuencode_main (int argc,
167 break; 167 break;
168 168
169 default: 169 default:
170 usage(uuencode_usage); 170 show_usage();
171 } 171 }
172 } 172 }
173 173
@@ -188,7 +188,7 @@ int uuencode_main (int argc,
188 188
189 case 0: 189 case 0:
190 default: 190 default:
191 usage(uuencode_usage); 191 show_usage();
192 } 192 }
193 193
194 printf("begin%s %o %s\n", trans_ptr == uu_std ? "" : "-base64", 194 printf("begin%s %o %s\n", trans_ptr == uu_std ? "" : "-base64",
diff --git a/watchdog.c b/watchdog.c
index 7026cc005..65d0fc35f 100644
--- a/watchdog.c
+++ b/watchdog.c
@@ -31,7 +31,7 @@ extern int watchdog_main(int argc, char **argv)
31 int fd; 31 int fd;
32 32
33 if (argc != 2) { 33 if (argc != 2) {
34 usage(watchdog_usage); 34 show_usage();
35 } 35 }
36 36
37 if ((fd=open(argv[1], O_WRONLY)) == -1) { 37 if ((fd=open(argv[1], O_WRONLY)) == -1) {
diff --git a/wc.c b/wc.c
index 619c161a7..f41687422 100644
--- a/wc.c
+++ b/wc.c
@@ -126,7 +126,7 @@ int wc_main(int argc, char **argv)
126 print_words = 1; 126 print_words = 1;
127 break; 127 break;
128 default: 128 default:
129 usage(wc_usage); 129 show_usage();
130 } 130 }
131 } 131 }
132 132
diff --git a/wget.c b/wget.c
index c134427e4..d1aacefa6 100644
--- a/wget.c
+++ b/wget.c
@@ -105,12 +105,12 @@ int wget_main(int argc, char **argv)
105 fname_out = (strcmp(optarg, "-") == 0 ? (char *)1 : optarg); 105 fname_out = (strcmp(optarg, "-") == 0 ? (char *)1 : optarg);
106 break; 106 break;
107 default: 107 default:
108 usage(wget_usage); 108 show_usage();
109 } 109 }
110 } 110 }
111 111
112 if (argc - optind != 1) 112 if (argc - optind != 1)
113 usage(wget_usage); 113 show_usage();
114 114
115 /* 115 /*
116 * Use the proxy if necessary. 116 * Use the proxy if necessary.
@@ -533,7 +533,7 @@ progressmeter(int flag)
533 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 533 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
534 * SUCH DAMAGE. 534 * SUCH DAMAGE.
535 * 535 *
536 * $Id: wget.c,v 1.26 2001/02/01 16:49:30 kraai Exp $ 536 * $Id: wget.c,v 1.27 2001/02/14 21:23:06 andersen Exp $
537 */ 537 */
538 538
539 539
diff --git a/which.c b/which.c
index 981a8acf5..1908db30a 100644
--- a/which.c
+++ b/which.c
@@ -33,7 +33,7 @@ extern int which_main(int argc, char **argv)
33 int i, count=1, found, status = EXIT_SUCCESS; 33 int i, count=1, found, status = EXIT_SUCCESS;
34 34
35 if (argc <= 1 || **(argv + 1) == '-') 35 if (argc <= 1 || **(argv + 1) == '-')
36 usage(which_usage); 36 show_usage();
37 argc--; 37 argc--;
38 38
39 path_list = getenv("PATH"); 39 path_list = getenv("PATH");
diff --git a/whoami.c b/whoami.c
index 398e37315..54df0bf12 100644
--- a/whoami.c
+++ b/whoami.c
@@ -31,7 +31,7 @@ extern int whoami_main(int argc, char **argv)
31 uid_t uid = geteuid(); 31 uid_t uid = geteuid();
32 32
33 if (argc > 1) 33 if (argc > 1)
34 usage(whoami_usage); 34 show_usage();
35 35
36 my_getpwuid(user, uid); 36 my_getpwuid(user, uid);
37 if (*user) { 37 if (*user) {
diff --git a/yes.c b/yes.c
index 0ce49499f..0a8ad83a7 100644
--- a/yes.c
+++ b/yes.c
@@ -29,7 +29,7 @@ extern int yes_main(int argc, char **argv)
29 int i; 29 int i;
30 30
31 if (argc >= 2 && *argv[1] == '-') 31 if (argc >= 2 && *argv[1] == '-')
32 usage(yes_usage); 32 show_usage();
33 33
34 if (argc == 1) { 34 if (argc == 1) {
35 while (1) 35 while (1)