aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2000-07-16 20:57:15 +0000
committerMatt Kraai <kraai@debian.org>2000-07-16 20:57:15 +0000
commitbf181b9338152759fd56c8009e9a962a84808e7c (patch)
treee8c416c791c690f661c513340662e4e98ff3464a
parent3bd8bd89ee9d0b65bf279e1ecad826a5f2f0a217 (diff)
downloadbusybox-w32-bf181b9338152759fd56c8009e9a962a84808e7c.tar.gz
busybox-w32-bf181b9338152759fd56c8009e9a962a84808e7c.tar.bz2
busybox-w32-bf181b9338152759fd56c8009e9a962a84808e7c.zip
Extract usage information into a separate file.
-rw-r--r--Makefile2
-rw-r--r--applets/usage.c1204
-rw-r--r--ar.c12
-rw-r--r--archival/ar.c12
-rw-r--r--archival/gunzip.c14
-rw-r--r--archival/gzip.c13
-rw-r--r--archival/tar.c31
-rw-r--r--basename.c8
-rw-r--r--cat.c7
-rw-r--r--chmod_chown_chgrp.c23
-rw-r--r--chroot.c9
-rw-r--r--chvt.c7
-rw-r--r--console-tools/chvt.c7
-rw-r--r--console-tools/deallocvt.c7
-rw-r--r--console-tools/dumpkmap.c8
-rw-r--r--console-tools/loadacm.c6
-rw-r--r--console-tools/loadfont.c6
-rw-r--r--console-tools/loadkmap.c8
-rw-r--r--console-tools/setkeycodes.c11
-rw-r--r--coreutils/basename.c8
-rw-r--r--coreutils/cat.c7
-rw-r--r--coreutils/chroot.c9
-rw-r--r--coreutils/cut.c14
-rw-r--r--coreutils/date.c11
-rw-r--r--coreutils/dd.c17
-rw-r--r--coreutils/df.c6
-rw-r--r--coreutils/dirname.c7
-rw-r--r--coreutils/du.c13
-rw-r--r--coreutils/echo.c13
-rw-r--r--coreutils/head.c13
-rw-r--r--coreutils/id.c11
-rw-r--r--coreutils/length.c7
-rw-r--r--coreutils/ln.c13
-rw-r--r--coreutils/logname.c6
-rw-r--r--coreutils/ls.c57
-rw-r--r--coreutils/md5sum.c17
-rw-r--r--coreutils/mkdir.c12
-rw-r--r--coreutils/mkfifo.c8
-rw-r--r--coreutils/mknod.c12
-rw-r--r--coreutils/printf.c7
-rw-r--r--coreutils/rm.c11
-rw-r--r--coreutils/rmdir.c7
-rw-r--r--coreutils/sleep.c6
-rw-r--r--coreutils/sort.c12
-rw-r--r--coreutils/sync.c7
-rw-r--r--coreutils/tail.c34
-rw-r--r--coreutils/tee.c14
-rw-r--r--coreutils/test.c9
-rw-r--r--coreutils/touch.c10
-rw-r--r--coreutils/tr.c13
-rw-r--r--coreutils/tty.c8
-rw-r--r--coreutils/uname.c18
-rw-r--r--coreutils/uniq.c10
-rw-r--r--coreutils/usleep.c6
-rw-r--r--coreutils/uudecode.c9
-rw-r--r--coreutils/uuencode.c9
-rw-r--r--coreutils/wc.c13
-rw-r--r--coreutils/whoami.c6
-rw-r--r--coreutils/yes.c7
-rw-r--r--cp_mv.c22
-rw-r--r--cut.c14
-rw-r--r--date.c11
-rw-r--r--dc.c8
-rw-r--r--dd.c17
-rw-r--r--deallocvt.c7
-rw-r--r--df.c6
-rw-r--r--dirname.c7
-rw-r--r--dmesg.c10
-rw-r--r--du.c13
-rw-r--r--dumpkmap.c8
-rw-r--r--dutmp.c8
-rw-r--r--echo.c13
-rw-r--r--editors/sed.c16
-rw-r--r--fdflush.c9
-rw-r--r--find.c12
-rw-r--r--findutils/find.c12
-rw-r--r--findutils/grep.c15
-rw-r--r--findutils/which.c7
-rw-r--r--free.c7
-rw-r--r--freeramdisk.c8
-rw-r--r--fsck_minix.c15
-rw-r--r--grep.c15
-rw-r--r--gunzip.c14
-rw-r--r--gzip.c13
-rw-r--r--head.c13
-rw-r--r--hostname.c17
-rw-r--r--id.c11
-rw-r--r--insmod.c14
-rw-r--r--internal.h92
-rw-r--r--kill.c18
-rw-r--r--lash.c8
-rw-r--r--length.c7
-rw-r--r--ln.c13
-rw-r--r--loadacm.c6
-rw-r--r--loadfont.c6
-rw-r--r--loadkmap.c8
-rw-r--r--logger.c14
-rw-r--r--logname.c6
-rw-r--r--ls.c57
-rw-r--r--makedevs.c17
-rw-r--r--md5sum.c17
-rw-r--r--miscutils/dc.c8
-rw-r--r--miscutils/dutmp.c8
-rw-r--r--miscutils/makedevs.c17
-rw-r--r--miscutils/mktemp.c8
-rw-r--r--miscutils/mt.c6
-rw-r--r--miscutils/update.c12
-rw-r--r--mkdir.c12
-rw-r--r--mkfifo.c8
-rw-r--r--mkfs_minix.c13
-rw-r--r--mknod.c12
-rw-r--r--mkswap.c14
-rw-r--r--mktemp.c8
-rw-r--r--modutils/insmod.c14
-rw-r--r--modutils/rmmod.c12
-rw-r--r--more.c6
-rw-r--r--mount.c32
-rw-r--r--mt.c6
-rw-r--r--nc.c6
-rw-r--r--networking/hostname.c17
-rw-r--r--networking/nc.c6
-rw-r--r--networking/nslookup.c9
-rw-r--r--networking/ping.c19
-rw-r--r--networking/telnet.c8
-rw-r--r--nslookup.c9
-rw-r--r--ping.c19
-rw-r--r--printf.c7
-rw-r--r--procps/free.c7
-rw-r--r--procps/kill.c18
-rw-r--r--procps/ps.c8
-rw-r--r--ps.c8
-rw-r--r--rm.c11
-rw-r--r--rmdir.c7
-rw-r--r--rmmod.c12
-rw-r--r--sed.c16
-rw-r--r--setkeycodes.c11
-rw-r--r--sh.c8
-rw-r--r--shell/lash.c8
-rw-r--r--sleep.c6
-rw-r--r--sort.c12
-rw-r--r--swaponoff.c19
-rw-r--r--sync.c7
-rw-r--r--sysklogd/logger.c14
-rw-r--r--sysklogd/syslogd.c15
-rw-r--r--syslogd.c15
-rw-r--r--tail.c34
-rw-r--r--tar.c31
-rw-r--r--tee.c14
-rw-r--r--telnet.c8
-rw-r--r--test.c9
-rw-r--r--touch.c10
-rw-r--r--tr.c13
-rw-r--r--tty.c8
-rw-r--r--umount.c22
-rw-r--r--uname.c18
-rw-r--r--uniq.c10
-rw-r--r--update.c12
-rw-r--r--usage.c1204
-rw-r--r--usleep.c6
-rw-r--r--util-linux/dmesg.c10
-rw-r--r--util-linux/fdflush.c9
-rw-r--r--util-linux/freeramdisk.c8
-rw-r--r--util-linux/fsck_minix.c15
-rw-r--r--util-linux/mkfs_minix.c13
-rw-r--r--util-linux/mkswap.c14
-rw-r--r--util-linux/more.c6
-rw-r--r--util-linux/mount.c32
-rw-r--r--util-linux/swaponoff.c19
-rw-r--r--util-linux/umount.c22
-rw-r--r--uudecode.c9
-rw-r--r--uuencode.c9
-rw-r--r--wc.c13
-rw-r--r--which.c7
-rw-r--r--whoami.c6
-rw-r--r--yes.c7
175 files changed, 2529 insertions, 2050 deletions
diff --git a/Makefile b/Makefile
index 232a17d38..bcaac87c4 100644
--- a/Makefile
+++ b/Makefile
@@ -80,7 +80,7 @@ ifndef $(PREFIX)
80 PREFIX = `pwd`/_install 80 PREFIX = `pwd`/_install
81endif 81endif
82 82
83OBJECTS = $(shell ./busybox.sh) busybox.o messages.o utility.o 83OBJECTS = $(shell ./busybox.sh) busybox.o messages.o usage.o utility.o
84CFLAGS += -DBB_VER='"$(VERSION)"' 84CFLAGS += -DBB_VER='"$(VERSION)"'
85CFLAGS += -DBB_BT='"$(BUILDTIME)"' 85CFLAGS += -DBB_BT='"$(BUILDTIME)"'
86ifdef BB_INIT_SCRIPT 86ifdef BB_INIT_SCRIPT
diff --git a/applets/usage.c b/applets/usage.c
new file mode 100644
index 000000000..d5a34ec28
--- /dev/null
+++ b/applets/usage.c
@@ -0,0 +1,1204 @@
1#include "internal.h"
2
3#if defined BB_AR
4const char ar_usage[] =
5 "ar [optxvV] archive [filenames] \n"
6#ifndef BB_FEATURE_TRIVIAL_HELP
7 "\nExtract or list files from an ar archive.\n\n"
8 "Options:\n"
9 "\to\t\tpreserve original dates\n"
10 "\tp\t\textract to stdout\n"
11 "\tt\t\tlist\n"
12 "\tx\t\textract\n"
13 "\tv\t\tverbosely list files processed\n"
14#endif
15 ;
16#endif
17
18#if defined BB_BASENAME
19const char basename_usage[] =
20 "basename FILE [SUFFIX]\n"
21#ifndef BB_FEATURE_TRIVIAL_HELP
22 "\nStrips directory path and suffixes from FILE.\n"
23 "If specified, also removes any trailing SUFFIX.\n"
24#endif
25 ;
26#endif
27
28#if defined BB_CAT
29const char cat_usage[] =
30 "cat [FILE]...\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nConcatenates FILE(s) and prints them to stdout.\n"
33#endif
34 ;
35#endif
36
37#if defined BB_CHMOD_CHOWN_CHGRP
38const char chgrp_usage[] =
39 "chgrp [OPTION]... GROUP FILE...\n"
40#ifndef BB_FEATURE_TRIVIAL_HELP
41 "\nChange the group membership of each FILE to GROUP.\n"
42 "\nOptions:\n\t-R\tChanges files and directories recursively.\n"
43#endif
44 ;
45#endif
46
47#if defined BB_CHMOD_CHOWN_CHGRP
48const char chmod_usage[] =
49 "chmod [-R] MODE[,MODE]... FILE...\n"
50#ifndef BB_FEATURE_TRIVIAL_HELP
51 "\nEach MODE is one or more of the letters ugoa, one of the symbols +-= and\n"
52 "one or more of the letters rwxst.\n\n"
53 "\nOptions:\n\t-R\tChanges files and directories recursively.\n"
54#endif
55 ;
56#endif
57
58#if defined BB_CHMOD_CHOWN_CHGRP
59const char chown_usage[] =
60 "chown [OPTION]... OWNER[<.|:>[GROUP] FILE...\n"
61#ifndef BB_FEATURE_TRIVIAL_HELP
62 "\nChange the owner and/or group of each FILE to OWNER and/or GROUP.\n"
63 "\nOptions:\n\t-R\tChanges files and directories recursively.\n"
64#endif
65 ;
66#endif
67
68#if defined BB_CHROOT
69const char chroot_usage[] =
70 "chroot NEWROOT [COMMAND...]\n"
71#ifndef BB_FEATURE_TRIVIAL_HELP
72 "\nRun COMMAND with root directory set to NEWROOT.\n"
73#endif
74 ;
75#endif
76
77#if defined BB_CHVT
78const char chvt_usage[] =
79 "chvt N\n"
80#ifndef BB_FEATURE_TRIVIAL_HELP
81 "\nChanges the foreground virtual terminal to /dev/ttyN\n"
82#endif
83 ;
84#endif
85
86#if defined BB_CP_MV
87const char cp_usage[] =
88 "cp [OPTION]... SOURCE DEST\n"
89 " or: cp [OPTION]... SOURCE... DIRECTORY\n"
90#ifndef BB_FEATURE_TRIVIAL_HELP
91 "\nCopies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n"
92 "\n"
93 "\t-a\tSame as -dpR\n"
94 "\t-d\tPreserves links\n"
95 "\t-p\tPreserves file attributes if possible\n"
96 "\t-f\tforce (implied; ignored) - always set\n"
97 "\t-R\tCopies directories recursively\n"
98#endif
99 ;
100#endif
101
102#if defined BB_CUT
103const char cut_usage[] =
104 "cut [OPTION]... [FILE]...\n"
105#ifndef BB_FEATURE_TRIVIAL_HELP
106 "\nPrints selected fields from each input FILE to standard output.\n\n"
107 "Options:\n"
108 "\t-b LIST\tOutput only bytes from LIST\n"
109 "\t-c LIST\tOutput only characters from LIST\n"
110 "\t-d CHAR\tUse CHAR instead of tab as the field delimiter\n"
111 "\t-s\tOnly output Lines if the include DELIM\n"
112 "\t-f N\tPrint only these fields\n"
113 "\t-n\tIgnored\n"
114#endif
115 ;
116#endif
117
118#if defined BB_DATE
119const char date_usage[] =
120 "date [OPTION]... [+FORMAT]\n"
121 " or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]\n"
122#ifndef BB_FEATURE_TRIVIAL_HELP
123 "\nDisplays the current time in the given FORMAT, or sets the system date.\n"
124 "\nOptions:\n\t-R\tOutputs RFC-822 compliant date string\n"
125 "\t-s\tSets time described by STRING\n"
126 "\t-u\tPrints or sets Coordinated Universal Time\n"
127#endif
128 ;
129#endif
130
131#if defined BB_DC
132const char dc_usage[] =
133 "dc expression ...\n"
134#ifndef BB_FEATURE_TRIVIAL_HELP
135 "\nThis is a Tiny RPN calculator that understands the\n"
136 "following operations: +, -, /, *, and, or, not, eor.\n"
137 "i.e. 'dc 2 2 add' -> 4, and 'dc 8 8 \\* 2 2 + /' -> 16\n"
138#endif
139 ;
140#endif
141
142#if defined BB_DD
143const char dd_usage[] =
144 "dd [if=FILE] [of=FILE] [bs=N] [count=N] [skip=N] [seek=N]\n"
145#ifndef BB_FEATURE_TRIVIAL_HELP
146 "\nCopy a file, converting and formatting according to options\n\n"
147 "\tif=FILE\tread from FILE instead of stdin\n"
148 "\tof=FILE\twrite to FILE instead of stdout\n"
149 "\tbs=N\tread and write N bytes at a time\n"
150 "\tcount=N\tcopy only N input blocks\n"
151 "\tskip=N\tskip N input blocks\n"
152 "\tseek=N\tskip N output blocks\n"
153 "\n"
154 "Numbers may be suffixed by w (x2), k (x1024), b (x512), or M (x1024^2)\n"
155#endif
156 ;
157#endif
158
159#if defined BB_DEALLOCVT
160const char deallocvt_usage[] =
161 "deallocvt N\n"
162#ifndef BB_FEATURE_TRIVIAL_HELP
163 "\nDeallocate unused virtual terminal /dev/ttyN\n"
164#endif
165 ;
166#endif
167
168#if defined BB_DF
169const char df_usage[] =
170 "df [filesystem ...]\n"
171#ifndef BB_FEATURE_TRIVIAL_HELP
172 "\nPrint the filesystem space used and space available.\n"
173#endif
174 ;
175#endif
176
177#if defined BB_DIRNAME
178const char dirname_usage[] =
179 "dirname [FILENAME ...]\n"
180#ifndef BB_FEATURE_TRIVIAL_HELP
181 "\nStrips non-directory suffix from FILENAME\n"
182#endif
183 ;
184#endif
185
186#if defined BB_DMESG
187const char dmesg_usage[] =
188 "dmesg [-c] [-n LEVEL] [-s SIZE]\n"
189#ifndef BB_FEATURE_TRIVIAL_HELP
190 "\nPrints or controls the kernel ring buffer\n\n"
191 "Options:\n"
192 "\t-c\t\tClears the ring buffer's contents after printing\n"
193 "\t-n LEVEL\tSets console logging level\n"
194 "\t-s SIZE\t\tUse a buffer of size SIZE\n"
195#endif
196 ;
197#endif
198
199#if defined BB_DU
200const char du_usage[] =
201 "du [OPTION]... [FILE]...\n"
202#ifndef BB_FEATURE_TRIVIAL_HELP
203 "\nSummarizes disk space used for each FILE and/or directory.\n"
204 "Disk space is printed in units of 1024 bytes.\n\n"
205 "Options:\n"
206 "\t-l\tcount sizes many times if hard linked\n"
207 "\t-s\tdisplay only a total for each argument\n"
208#endif
209 ;
210#endif
211
212#if defined BB_DUMPKMAP
213const char dumpkmap_usage[] =
214 "dumpkmap\n"
215#ifndef BB_FEATURE_TRIVIAL_HELP
216 "\nPrints out a binary keyboard translation table to standard input.\n"
217#endif
218 ;
219#endif
220
221#if defined BB_DUTMP
222const char dutmp_usage[] =
223 "dutmp [FILE]\n"
224#ifndef BB_FEATURE_TRIVIAL_HELP
225 "\nDump utmp file format (pipe delimited) from FILE\n"
226 "or stdin to stdout. (i.e. 'dutmp /var/run/utmp')\n"
227#endif
228 ;
229#endif
230
231#if defined BB_ECHO
232const char echo_usage[] =
233 "echo [-neE] [ARG ...]\n"
234#ifndef BB_FEATURE_TRIVIAL_HELP
235 "\nPrints the specified ARGs to stdout\n\n"
236 "Options:\n"
237 "\t-n\tsuppress trailing newline\n"
238 "\t-e\tinterpret backslash-escaped characters (i.e. \\t=tab etc)\n"
239 "\t-E\tdisable interpretation of backslash-escaped characters\n"
240#endif
241 ;
242#endif
243
244#if defined BB_FDFLUSH
245const char fdflush_usage[] =
246 "fdflush DEVICE\n"
247#ifndef BB_FEATURE_TRIVIAL_HELP
248 "\nForces floppy disk drive to detect disk change\n"
249#endif
250 ;
251#endif
252
253#if defined BB_FIND
254const char find_usage[] =
255 "find [PATH...] [EXPRESSION]\n"
256#ifndef BB_FEATURE_TRIVIAL_HELP
257 "\nSearch for files in a directory hierarchy. The default PATH is\n"
258 "the current directory; default EXPRESSION is '-print'\n\n"
259 "\nEXPRESSION may consist of:\n"
260 "\t-follow\t\tDereference symbolic links.\n"
261 "\t-name PATTERN\tFile name (leading directories removed) matches PATTERN.\n"
262 "\t-print\t\tprint the full file name followed by a newline to stdout.\n"
263#endif
264 ;
265#endif
266
267#if defined BB_FREE
268const char free_usage[] =
269 "free\n"
270#ifndef BB_FEATURE_TRIVIAL_HELP
271 "\nDisplays the amount of free and used system memory\n"
272#endif
273 ;
274#endif
275
276#if defined BB_FREERAMDISK
277const char freeramdisk_usage[] =
278 "freeramdisk DEVICE\n"
279#ifndef BB_FEATURE_TRIVIAL_HELP
280 "\nFrees all memory used by the specified ramdisk.\n"
281#endif
282 ;
283#endif
284
285#if defined BB_FSCK_MINIX
286const char fsck_minix_usage[] =
287 "Usage: fsck.minix [-larvsmf] /dev/name\n"
288#ifndef BB_FEATURE_TRIVIAL_HELP
289 "\nPerforms a consistency check for MINIX filesystems.\n\n"
290 "Options:\n"
291 "\t-l\tLists all filenames\n"
292 "\t-r\tPerform interactive repairs\n"
293 "\t-a\tPerform automatic repairs\n"
294 "\t-v\tverbose\n"
295 "\t-s\tOutputs super-block information\n"
296 "\t-m\tActivates MINIX-like \"mode not cleared\" warnings\n"
297 "\t-f\tForce file system check.\n\n"
298#endif
299 ;
300#endif
301
302#if defined BB_GREP
303const char grep_usage[] =
304 "grep [-ihHnqvs] pattern [files...]\n"
305#ifndef BB_FEATURE_TRIVIAL_HELP
306 "\nSearch for PATTERN in each FILE or standard input.\n\n"
307 "Options:\n"
308 "\t-H\tprefix output lines with filename where match was found\n"
309 "\t-h\tsuppress the prefixing filename on output\n"
310 "\t-i\tignore case distinctions\n"
311 "\t-n\tprint line number with output lines\n"
312 "\t-q\tbe quiet. Returns 0 if result was found, 1 otherwise\n"
313 "\t-v\tselect non-matching lines\n"
314 "\t-s\tsuppress file open/read error messages\n\n"
315#endif
316 ;
317#endif
318
319#if defined BB_GUNZIP
320const char gunzip_usage[] =
321 "gunzip [OPTION]... FILE\n"
322#ifndef BB_FEATURE_TRIVIAL_HELP
323 "\nUncompress FILE (or standard input if FILE is '-').\n\n"
324 "Options:\n"
325 "\t-c\tWrite output to standard output\n"
326 "\t-t\tTest compressed file integrity\n"
327#endif
328 ;
329#endif
330
331#if defined BB_GZIP
332const char gzip_usage[] =
333 "gzip [OPTION]... FILE\n"
334#ifndef BB_FEATURE_TRIVIAL_HELP
335 "\nCompress FILE with maximum compression.\n"
336 "When FILE is '-', reads standard input. Implies -c.\n\n"
337 "Options:\n"
338 "\t-c\tWrite output to standard output instead of FILE.gz\n"
339#endif
340 ;
341#endif
342
343#if defined BB_HEAD
344const char head_usage[] =
345 "head [OPTION] [FILE]...\n"
346#ifndef BB_FEATURE_TRIVIAL_HELP
347 "\nPrint first 10 lines of each FILE to standard output.\n"
348 "With more than one FILE, precede each with a header giving the\n"
349 "file name. With no FILE, or when FILE is -, read standard input.\n\n"
350
351 "Options:\n" "\t-n NUM\t\tPrint first NUM lines instead of first 10\n"
352#endif
353 ;
354#endif
355
356#if defined BB_HOSTNAME
357const char hostname_usage[] =
358 "hostname [OPTION] {hostname | -F file}\n"
359#ifndef BB_FEATURE_TRIVIAL_HELP
360 "\nGet or set the hostname or DNS domain name. If a hostname is given\n"
361 "(or a file with the -F parameter), the host name will be set.\n\n"
362 "Options:\n"
363 "\t-s\t\tShort\n"
364
365 "\t-i\t\tAddresses for the hostname\n"
366 "\t-d\t\tDNS domain name\n"
367 "\t-F FILE\t\tUse the contents of FILE to specify the hostname\n"
368#endif
369 ;
370#endif
371
372#if defined BB_ID
373const char id_usage[] =
374 "id [OPTIONS]... [USERNAME]\n"
375#ifndef BB_FEATURE_TRIVIAL_HELP
376 "\nPrint information for USERNAME or the current user\n\n"
377 "Options:\n"
378 "\t-g\tprints only the group ID\n"
379 "\t-u\tprints only the user ID\n"
380 "\t-r\tprints the real user ID instead of the effective ID (with -ug)\n\n"
381#endif
382 ;
383#endif
384
385#if defined BB_INSMOD
386const char insmod_usage[] =
387 "insmod [OPTION]... MODULE [symbol=value]...\n"
388#ifndef BB_FEATURE_TRIVIAL_HELP
389 "\nLoads the specified kernel modules into the kernel.\n\n"
390 "Options:\n"
391 "\t-f\tForce module to load into the wrong kernel version.\n"
392 "\t-k\tMake module autoclean-able.\n"
393 "\t-v\tverbose output\n" "\t-x\tdo not export externs\n"
394#endif
395 ;
396#endif
397
398#if defined BB_KILL
399const char kill_usage[] =
400 "kill [-signal] process-id [process-id ...]\n"
401#ifndef BB_FEATURE_TRIVIAL_HELP
402 "\nSend a signal (default is SIGTERM) to the specified process(es).\n\n"
403 "Options:\n" "\t-l\tList all signal names and numbers.\n\n"
404#endif
405 ;
406#endif
407
408#if defined BB_KILLALL
409const char killall_usage[] =
410 "killall [-signal] process-name [process-name ...]\n"
411#ifndef BB_FEATURE_TRIVIAL_HELP
412 "\nSend a signal (default is SIGTERM) to the specified process(es).\n\n"
413 "Options:\n" "\t-l\tList all signal names and numbers.\n\n"
414#endif
415 ;
416#endif
417
418#if defined BB_LENGTH
419const char length_usage[] =
420 "length STRING\n"
421#ifndef BB_FEATURE_TRIVIAL_HELP
422 "\nPrints out the length of the specified STRING.\n"
423#endif
424 ;
425#endif
426
427#if defined BB_LN
428const char ln_usage[] =
429 "ln [OPTION] TARGET... LINK_NAME|DIRECTORY\n"
430#ifndef BB_FEATURE_TRIVIAL_HELP
431 "\nCreate a link named LINK_NAME or DIRECTORY to the specified TARGET\n"
432 "\nYou may use '--' to indicate that all following arguments are non-options.\n\n"
433 "Options:\n"
434 "\t-s\tmake symbolic links instead of hard links\n"
435
436 "\t-f\tremove existing destination files\n"
437 "\t-n\tno dereference symlinks - treat like normal file\n"
438#endif
439 ;
440#endif
441
442#if defined BB_LOADACM
443const char loadacm_usage[] =
444 "loadacm\n"
445#ifndef BB_FEATURE_TRIVIAL_HELP
446 "\nLoads an acm from standard input.\n"
447#endif
448 ;
449#endif
450
451#if defined BB_LOADFONT
452const char loadfont_usage[] =
453 "loadfont\n"
454#ifndef BB_FEATURE_TRIVIAL_HELP
455 "Loads a console font from standard input.\n"
456#endif
457 ;
458#endif
459
460#if defined BB_LOADKMAP
461const char loadkmap_usage[] =
462 "loadkmap\n"
463#ifndef BB_FEATURE_TRIVIAL_HELP
464 "\nLoads a binary keyboard translation table from standard input.\n"
465#endif
466 ;
467#endif
468
469#if defined BB_LOGGER
470const char logger_usage[] =
471 "logger [OPTION]... [MESSAGE]\n"
472#ifndef BB_FEATURE_TRIVIAL_HELP
473 "\nWrite MESSAGE to the system log. If MESSAGE is '-', log stdin.\n\n"
474 "Options:\n"
475 "\t-s\tLog to stderr as well as the system log.\n"
476 "\t-t\tLog using the specified tag (defaults to user name).\n"
477
478 "\t-p\tEnter the message with the specified priority.\n"
479 "\t\tThis may be numerical or a ``facility.level'' pair.\n"
480#endif
481 ;
482#endif
483
484#if defined BB_LOGNAME
485const char logname_usage[] =
486 "logname\n"
487#ifndef BB_FEATURE_TRIVIAL_HELP
488 "\nPrint the name of the current user.\n"
489#endif
490 ;
491#endif
492
493#if defined BB_LS
494const char ls_usage[] =
495 "ls [-1a"
496#ifdef BB_FEATURE_LS_TIMESTAMPS
497 "c"
498#endif
499 "d"
500#ifdef BB_FEATURE_LS_TIMESTAMPS
501 "e"
502#endif
503 "ln"
504#ifdef BB_FEATURE_LS_FILETYPES
505 "p"
506#endif
507#ifdef BB_FEATURE_LS_TIMESTAMPS
508 "u"
509#endif
510 "xAC"
511#ifdef BB_FEATURE_LS_FILETYPES
512 "F"
513#endif
514#ifdef BB_FEATURE_LS_RECURSIVE
515 "R"
516#endif
517 "] [filenames...]\n"
518#ifndef BB_FEATURE_TRIVIAL_HELP
519 "\nList directory contents\n\n"
520 "Options:\n"
521 "\t-a\tdo not hide entries starting with .\n"
522#ifdef BB_FEATURE_LS_TIMESTAMPS
523 "\t-c\twith -l: show ctime (the time of last\n"
524 "\t\tmodification of file status information)\n"
525#endif
526 "\t-d\tlist directory entries instead of contents\n"
527#ifdef BB_FEATURE_LS_TIMESTAMPS
528 "\t-e\tlist both full date and full time\n"
529#endif
530 "\t-l\tuse a long listing format\n"
531 "\t-n\tlist numeric UIDs and GIDs instead of names\n"
532#ifdef BB_FEATURE_LS_FILETYPES
533 "\t-p\tappend indicator (one of /=@|) to entries\n"
534#endif
535#ifdef BB_FEATURE_LS_TIMESTAMPS
536 "\t-u\twith -l: show access time (the time of last\n"
537 "\t\taccess of the file)\n"
538#endif
539 "\t-x\tlist entries by lines instead of by columns\n"
540 "\t-A\tdo not list implied . and ..\n"
541 "\t-C\tlist entries by columns\n"
542#ifdef BB_FEATURE_LS_FILETYPES
543 "\t-F\tappend indicator (one of */=@|) to entries\n"
544#endif
545#ifdef BB_FEATURE_LS_RECURSIVE
546 "\t-R\tlist subdirectories recursively\n"
547#endif
548#endif
549 ;
550#endif
551
552#if defined BB_MAKEDEVS
553const char makedevs_usage[] =
554 "makedevs NAME TYPE MAJOR MINOR FIRST LAST [s]\n"
555#ifndef BB_FEATURE_TRIVIAL_HELP
556 "\nCreates a range of block or character special files\n\n"
557 "TYPEs include:\n"
558 "\tb:\tMake a block (buffered) device.\n"
559 "\tc or u:\tMake a character (un-buffered) device.\n"
560 "\tp:\tMake a named pipe. MAJOR and MINOR are ignored for named pipes.\n\n"
561 "FIRST specifies the number appended to NAME to create the first device.\n"
562 "LAST specifies the number of the last item that should be created.\n"
563 "If 's' is the last argument, the base device is created as well.\n\n"
564 "For example:\n"
565 "\tmakedevs /dev/ttyS c 4 66 2 63 -> ttyS2-ttyS63\n"
566 "\tmakedevs /dev/hda b 3 0 0 8 s -> hda,hda1-hda8\n"
567#endif
568 ;
569#endif
570
571#if defined BB_MD5SUM
572const char md5sum_usage[] =
573 "md5sum [OPTION] [FILE]...\n"
574 "or: md5sum [OPTION] -c [FILE]\n"
575#ifndef BB_FEATURE_TRIVIAL_HELP
576 "\nPrint or check MD5 checksums.\n\n"
577 "Options:\n"
578 "With no FILE, or when FILE is -, read standard input.\n\n"
579 "\t-b\tread files in binary mode\n"
580 "\t-c\tcheck MD5 sums against given list\n"
581 "\t-t\tread files in text mode (default)\n"
582 "\t-g\tread a string\n"
583 "\nThe following two options are useful only when verifying checksums:\n"
584 "\t-s,\tdon't output anything, status code shows success\n"
585 "\t-w,\twarn about improperly formated MD5 checksum lines\n"
586#endif
587 ;
588#endif
589
590#if defined BB_MKDIR
591const char mkdir_usage[] =
592 "mkdir [OPTION] DIRECTORY...\n"
593#ifndef BB_FEATURE_TRIVIAL_HELP
594 "\nCreate the DIRECTORY(ies), if they do not already exist\n\n"
595 "Options:\n"
596
597 "\t-m\tset permission mode (as in chmod), not rwxrwxrwx - umask\n"
598 "\t-p\tno error if existing, make parent directories as needed\n"
599#endif
600 ;
601#endif
602
603#if defined BB_MKFIFO
604const char mkfifo_usage[] =
605 "mkfifo [OPTIONS] name\n"
606#ifndef BB_FEATURE_TRIVIAL_HELP
607 "\nCreates a named pipe (identical to 'mknod name p')\n\n"
608 "Options:\n"
609 "\t-m\tcreate the pipe using the specified mode (default a=rw)\n"
610#endif
611 ;
612#endif
613
614#if defined BB_MKFS_MINIX
615const char mkfs_minix_usage[] =
616 "mkfs.minix [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n"
617#ifndef BB_FEATURE_TRIVIAL_HELP
618 "\nMake a MINIX filesystem.\n\n"
619 "Options:\n"
620 "\t-c\t\tCheck the device for bad blocks\n"
621 "\t-n [14|30]\tSpecify the maximum length of filenames\n"
622 "\t-i INODES\tSpecify the number of inodes for the filesystem\n"
623 "\t-l FILENAME\tRead the bad blocks list from FILENAME\n"
624 "\t-v\t\tMake a Minix version 2 filesystem\n\n"
625#endif
626 ;
627#endif
628
629#if defined BB_MKNOD
630const char mknod_usage[] =
631 "mknod [OPTIONS] NAME TYPE MAJOR MINOR\n"
632#ifndef BB_FEATURE_TRIVIAL_HELP
633 "\nCreate a special file (block, character, or pipe).\n\n"
634 "Options:\n"
635 "\t-m\tcreate the special file using the specified mode (default a=rw)\n\n"
636 "TYPEs include:\n"
637 "\tb:\tMake a block (buffered) device.\n"
638 "\tc or u:\tMake a character (un-buffered) device.\n"
639 "\tp:\tMake a named pipe. MAJOR and MINOR are ignored for named pipes.\n"
640#endif
641 ;
642#endif
643
644#if defined BB_MKSWAP
645const char mkswap_usage[] =
646 "mkswap [-c] [-v0|-v1] device [block-count]\n"
647#ifndef BB_FEATURE_TRIVIAL_HELP
648 "\nPrepare a disk partition to be used as a swap partition.\n\n"
649 "Options:\n" "\t-c\t\tCheck for read-ability.\n"
650 "\t-v0\t\tMake version 0 swap [max 128 Megs].\n"
651 "\t-v1\t\tMake version 1 swap [big!] (default for kernels > 2.1.117).\n"
652
653 "\tblock-count\tNumber of block to use (default is entire partition).\n"
654#endif
655 ;
656#endif
657
658#if defined BB_MKTEMP
659const char mktemp_usage[] =
660 "mktemp [-q] TEMPLATE\n"
661#ifndef BB_FEATURE_TRIVIAL_HELP
662 "\nCreates a temporary file with its name based on TEMPLATE.\n"
663 "TEMPLATE is any name with six `Xs' (i.e. /tmp/temp.XXXXXX).\n"
664#endif
665 ;
666#endif
667
668#if defined BB_MORE
669const char more_usage[] =
670 "more [FILE ...]\n"
671#ifndef BB_FEATURE_TRIVIAL_HELP
672 "\nMore is a filter for viewing FILE one screenful at a time.\n"
673#endif
674 ;
675#endif
676
677#if defined BB_MOUNT
678const char mount_usage[] =
679 "mount [flags] device directory [-o options,more-options]\n"
680#ifndef BB_FEATURE_TRIVIAL_HELP
681 "\nMount a filesystem\n\n"
682 "Flags:\n"
683 "\t-a:\t\tMount all filesystems in fstab.\n"
684#ifdef BB_MTAB
685 "\t-f:\t\t\"Fake\" mount. Add entry to mount table but don't mount it.\n"
686 "\t-n:\t\tDon't write a mount table entry.\n"
687#endif
688 "\t-o option:\tOne of many filesystem options, listed below.\n"
689 "\t-r:\t\tMount the filesystem read-only.\n"
690 "\t-t fs-type:\tSpecify the filesystem type.\n"
691 "\t-w:\t\tMount for reading and writing (default).\n"
692 "\n"
693 "Options for use with the \"-o\" flag:\n"
694 "\tasync/sync:\tWrites are asynchronous / synchronous.\n"
695 "\tatime/noatime:\tEnable / disable updates to inode access times.\n"
696 "\tdev/nodev:\tAllow use of special device files / disallow them.\n"
697 "\texec/noexec:\tAllow use of executable files / disallow them.\n"
698#if defined BB_FEATURE_MOUNT_LOOP
699 "\tloop:\t\tMounts a file via loop device.\n"
700#endif
701 "\tsuid/nosuid:\tAllow set-user-id-root programs / disallow them.\n"
702 "\tremount:\tRe-mount a currently-mounted filesystem, changing its flags.\n"
703 "\tro/rw:\t\tMount for read-only / read-write.\n"
704 "\nThere are EVEN MORE flags that are specific to each filesystem.\n"
705 "You'll have to see the written documentation for those.\n"
706#endif
707 ;
708#endif
709
710#if defined BB_MT
711const char mt_usage[] =
712 "mt [-f device] opcode value\n"
713#ifndef BB_FEATURE_TRIVIAL_HELP
714 "\nControl magnetic tape drive operation\n"
715#endif
716 ;
717#endif
718
719#if defined BB_CP_MV
720const char mv_usage[] =
721 "mv SOURCE DEST\n"
722 " or: mv SOURCE... DIRECTORY\n"
723#ifndef BB_FEATURE_TRIVIAL_HELP
724 "\nRename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n"
725#endif
726 ;
727#endif
728
729#if defined BB_NC
730const char nc_usage[] =
731 "nc [IP] [port]\n"
732#ifndef BB_FEATURE_TRIVIAL_HELP
733 "\nNetcat opens a pipe to IP:port\n"
734#endif
735 ;
736#endif
737
738#if defined BB_NSLOOKUP
739const char nslookup_usage[] =
740 "nslookup [HOST]\n"
741#ifndef BB_FEATURE_TRIVIAL_HELP
742 "\nQueries the nameserver for the IP address of the given HOST\n"
743#endif
744;
745#endif
746
747#if defined BB_PING
748#if defined BB_FEATURE_SIMPLE_PING
749const char ping_usage[] =
750 "ping host\n"
751#ifndef BB_FEATURE_TRIVIAL_HELP
752 "\nSend ICMP ECHO_REQUEST packets to network hosts\n"
753#endif
754 ;
755#else /* ! defined BB_FEATURE_SIMPLE_PING */
756const char ping_usage[] =
757 "ping [OPTION]... host\n"
758#ifndef BB_FEATURE_TRIVIAL_HELP
759 "\nSend ICMP ECHO_REQUEST packets to network hosts.\n\n"
760 "Options:\n"
761 "\t-c COUNT\tSend only COUNT pings.\n"
762 "\t-s SIZE\t\tSend SIZE data bytes in packets (default=56).\n"
763 "\t-q\t\tQuiet mode, only displays output at start\n"
764 "\t\t\tand when finished.\n"
765#endif
766 ;
767#endif
768#endif
769
770#if defined BB_PRINTF
771const char printf_usage[] =
772 "printf FORMAT [ARGUMENT...]\n"
773#ifndef BB_FEATURE_TRIVIAL_HELP
774 "\nFormats and prints ARGUMENT(s) according to FORMAT,\n"
775 "Where FORMAT controls the output exactly as in C printf.\n"
776#endif
777 ;
778#endif
779
780#if defined BB_PS
781const char ps_usage[] =
782 "ps\n"
783#ifndef BB_FEATURE_TRIVIAL_HELP
784 "\nReport process status\n"
785 "\nThis version of ps accepts no options.\n"
786#endif
787 ;
788#endif
789
790#if defined BB_RM
791const char rm_usage[] =
792 "rm [OPTION]... FILE...\n"
793#ifndef BB_FEATURE_TRIVIAL_HELP
794 "\nRemove (unlink) the FILE(s). You may use '--' to\n"
795 "indicate that all following arguments are non-options.\n\n"
796 "Options:\n"
797 "\t-f\t\tremove existing destinations, never prompt\n"
798 "\t-r or -R\tremove the contents of directories recursively\n"
799#endif
800 ;
801#endif
802
803#if defined BB_RMDIR
804const char rmdir_usage[] =
805 "rmdir [OPTION]... DIRECTORY...\n"
806#ifndef BB_FEATURE_TRIVIAL_HELP
807 "\nRemove the DIRECTORY(ies), if they are empty.\n"
808#endif
809 ;
810#endif
811
812#if defined BB_RMMOD
813const char rmmod_usage[] =
814 "rmmod [OPTION]... [MODULE]...\n"
815#ifndef BB_FEATURE_TRIVIAL_HELP
816 "\nUnloads the specified kernel modules from the kernel.\n\n"
817 "Options:\n"
818 "\t-a\tTry to remove all unused kernel modules.\n"
819#endif
820 ;
821#endif
822
823#if defined BB_SED
824const char sed_usage[] =
825 "sed [-Vhnef] pattern [files...]\n"
826#ifndef BB_FEATURE_TRIVIAL_HELP
827 "\n"
828 "-n\tsuppress automatic printing of pattern space\n"
829 "-e script\tadd the script to the commands to be executed\n"
830 "-f scriptfile\tadd the contents of script-file to the commands to be executed\n"
831 "-h\tdisplay this help message\n"
832 "-V\toutput version information and exit\n"
833 "\n"
834 "If no -e or -f is given, the first non-option argument is taken as the\n"
835 "sed script to interpret. All remaining arguments are names of input\n"
836 "files; if no input files are specified, then the standard input is read.\n"
837#endif
838 ;
839#endif
840
841#if defined BB_SETKEYCODES
842const char setkeycodes_usage[] =
843 "setkeycodes SCANCODE KEYCODE ...\n"
844#ifndef BB_FEATURE_TRIVIAL_HELP
845 "\nSet entries into the kernel's scancode-to-keycode map,\n"
846 "allowing unusual keyboards to generate usable keycodes.\n\n"
847 "SCANCODE may be either xx or e0xx (hexadecimal),\n"
848 "and KEYCODE is given in decimal\n"
849#endif
850 ;
851#endif
852
853#if defined BB_SH
854const char shell_usage[] =
855 "sh [FILE]...\n"
856 " or: sh -c command [args]...\n"
857#ifndef BB_FEATURE_TRIVIAL_HELP
858 "\nlash: The BusyBox command interpreter (shell).\n\n"
859#endif
860 ;
861#endif
862
863#if defined BB_SLEEP
864const char sleep_usage[] =
865 "sleep N\n"
866#ifndef BB_FEATURE_TRIVIAL_HELP
867 "\nPause for N seconds.\n"
868#endif
869 ;
870#endif
871
872#if defined BB_SORT
873const char sort_usage[] =
874 "sort [-n]"
875#ifdef BB_FEATURE_SORT_REVERSE
876 " [-r]"
877#endif
878 " [FILE]...\n"
879#ifndef BB_FEATURE_TRIVIAL_HELP
880 "\nSorts lines of text in the specified files\n"
881#endif
882 ;
883#endif
884
885#if defined BB_SWAPONOFF
886const char swapoff_usage[] =
887 "swapoff [OPTION] [device]\n"
888#ifndef BB_FEATURE_TRIVIAL_HELP
889 "\nStop swapping virtual memory pages on the given device.\n\n"
890 "Options:\n"
891 "\t-a\tStop swapping on all swap devices\n"
892#endif
893 ;
894#endif
895
896#if defined BB_SWAPONOFF
897const char swapon_usage[] =
898 "swapon [OPTION] [device]\n"
899#ifndef BB_FEATURE_TRIVIAL_HELP
900 "\nStart swapping virtual memory pages on the given device.\n\n"
901 "Options:\n"
902 "\t-a\tStart swapping on all swap devices\n"
903#endif
904 ;
905#endif
906
907#if defined BB_SYNC
908const char sync_usage[] =
909 "sync\n"
910#ifndef BB_FEATURE_TRIVIAL_HELP
911 "\nWrite all buffered filesystem blocks to disk.\n"
912#endif
913 ;
914#endif
915
916#if defined BB_SYSLOGD
917const char syslogd_usage[] =
918 "syslogd [OPTION]...\n"
919#ifndef BB_FEATURE_TRIVIAL_HELP
920 "\nLinux system and kernel (provides klogd) logging utility.\n"
921 "Note that this version of syslogd/klogd ignores /etc/syslog.conf.\n\n"
922 "Options:\n"
923 "\t-m NUM\t\tInterval between MARK lines (default=20min, 0=off)\n"
924 "\t-n\t\tRun as a foreground process\n"
925#ifdef BB_FEATURE_KLOGD
926 "\t-K\t\tDo not start up the klogd process\n"
927#endif
928 "\t-O FILE\t\tUse an alternate log file (default=/var/log/messages)\n"
929#endif
930 ;
931#endif
932
933#if defined BB_TAIL
934#if defined BB_FEATURE_SIMPLE_TAIL
935const char tail_usage[] =
936 "tail [OPTION] [FILE]...\n"
937#ifndef BB_FEATURE_TRIVIAL_HELP
938 "\nPrint last 10 lines of each FILE to standard output.\n"
939 "With more than one FILE, precede each with a header giving the\n"
940 "file name. With no FILE, or when FILE is -, read standard input.\n\n"
941 "Options:\n"
942 "\t-n NUM\t\tPrint last NUM lines instead of first 10\n"
943
944 "\t-f\t\tOutput data as the file grows. This version\n"
945 "\t\t\tof 'tail -f' supports only one file at a time.\n"
946#endif
947 ;
948#else /* ! defined BB_FEATURE_SIMPLE_TAIL */
949const char tail_usage[] =
950 "tail [OPTION]... [FILE]...\n"
951#ifndef BB_FEATURE_TRIVIAL_HELP
952 "\nPrint last 10 lines of each FILE to standard output.\n"
953 "With more than one FILE, precede each with a header giving the file name.\n"
954 "With no FILE, or when FILE is -, read standard input.\n"
955 "\n"
956 " -c=N[kbm] output the last N bytes\n"
957 " -f output appended data as the file grows\n"
958 " -n=N output the last N lines, instead of last 10\n"
959 " -q never output headers giving file names\n"
960 " -v always output headers giving file names\n"
961 "\n"
962 "If the first character of N (bytes or lines) is a `+', output begins with \n"
963 "the Nth item from the start of each file, otherwise, print the last N items\n"
964 "in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2).\n"
965#endif
966 ;
967#endif
968#endif
969
970#if defined BB_TAR
971const char tar_usage[] =
972#ifdef BB_FEATURE_TAR_CREATE
973 "tar -[cxtvO] "
974#else
975 "tar -[xtvO] "
976#endif
977#if defined BB_FEATURE_TAR_EXCLUDE
978 "[--exclude File] "
979#endif
980 "[-f tarFile] [FILE] ...\n"
981#ifndef BB_FEATURE_TRIVIAL_HELP
982 "\nCreate, extract, or list files from a tar file. Note that\n"
983 "this version of tar treats hard links as separate files.\n\n"
984 "Main operation mode:\n"
985#ifdef BB_FEATURE_TAR_CREATE
986 "\tc\t\tcreate\n"
987#endif
988 "\tx\t\textract\n"
989 "\tt\t\tlist\n"
990 "\nFile selection:\n"
991 "\tf\t\tname of tarfile or \"-\" for stdin\n"
992 "\tO\t\textract to stdout\n"
993#if defined BB_FEATURE_TAR_EXCLUDE
994 "\t--exclude\tfile to exclude\n"
995#endif
996 "\nInformative output:\n"
997 "\tv\t\tverbosely list files processed\n"
998#endif
999 ;
1000#endif
1001
1002#if defined BB_TEE
1003const char tee_usage[] =
1004 "tee [OPTION]... [FILE]...\n"
1005#ifndef BB_FEATURE_TRIVIAL_HELP
1006 "\nCopy standard input to each FILE, and also to standard output.\n\n"
1007 "Options:\n" "\t-a\tappend to the given FILEs, do not overwrite\n"
1008#endif
1009 ;
1010#endif
1011
1012#if defined BB_TELNET
1013const char telnet_usage[] =
1014 "telnet host [port]\n"
1015#ifndef BB_FEATURE_TRIVIAL_HELP
1016 "\nTelnet is used to establish interactive communication with another\n"
1017 "computer over a network using the TELNET protocol.\n"
1018#endif
1019 ;
1020#endif
1021
1022#if defined BB_TEST
1023const char test_usage[] =
1024 "test EXPRESSION\n"
1025 "or [ EXPRESSION ]\n"
1026#ifndef BB_FEATURE_TRIVIAL_HELP
1027 "\nChecks file types and compares values returning an exit\n"
1028 "code determined by the value of EXPRESSION.\n"
1029#endif
1030 ;
1031#endif
1032
1033#if defined BB_TOUCH
1034const char touch_usage[] =
1035 "touch [-c] file [file ...]\n"
1036#ifndef BB_FEATURE_TRIVIAL_HELP
1037 "\nUpdate the last-modified date on the given file[s].\n\n"
1038 "Options:\n"
1039 "\t-c\tDo not create any files\n"
1040#endif
1041 ;
1042#endif
1043
1044#if defined BB_TR
1045const char tr_usage[] =
1046 "tr [-cds] STRING1 [STRING2]\n"
1047#ifndef BB_FEATURE_TRIVIAL_HELP
1048 "\nTranslate, squeeze, and/or delete characters from\n"
1049 "standard input, writing to standard output.\n\n"
1050 "Options:\n"
1051 "\t-c\ttake complement of STRING1\n"
1052 "\t-d\tdelete input characters coded STRING1\n"
1053 "\t-s\tsqueeze multiple output characters of STRING2 into one character\n"
1054#endif
1055 ;
1056#endif
1057
1058#if defined BB_TTY
1059const char tty_usage[] =
1060 "tty\n"
1061#ifndef BB_FEATURE_TRIVIAL_HELP
1062 "\nPrint the file name of the terminal connected to standard input.\n\n"
1063 "Options:\n"
1064 "\t-s\tprint nothing, only return an exit status\n"
1065#endif
1066 ;
1067#endif
1068
1069#if defined BB_UMOUNT
1070const char umount_usage[] =
1071 "umount [flags] filesystem|directory\n"
1072#ifndef BB_FEATURE_TRIVIAL_HELP
1073 "Unmount file systems\n"
1074 "\nFlags:\n" "\t-a:\tUnmount all file systems"
1075#ifdef BB_MTAB
1076 " in /etc/mtab\n\t-n:\tDon't erase /etc/mtab entries\n"
1077#else
1078 "\n"
1079#endif
1080 "\t-r:\tTry to remount devices as read-only if mount is busy\n"
1081#if defined BB_FEATURE_MOUNT_FORCE
1082 "\t-f:\tForce filesystem umount (i.e. unreachable NFS server)\n"
1083#endif
1084#if defined BB_FEATURE_MOUNT_LOOP
1085 "\t-l:\tDo not free loop device (if a loop device has been used)\n"
1086#endif
1087#endif
1088 ;
1089#endif
1090
1091#if defined BB_UNAME
1092const char uname_usage[] =
1093 "uname [OPTION]...\n"
1094#ifndef BB_FEATURE_TRIVIAL_HELP
1095 "\nPrint certain system information. With no OPTION, same as -s.\n\n"
1096 "Options:\n"
1097 "\t-a\tprint all information\n"
1098 "\t-m\tthe machine (hardware) type\n"
1099 "\t-n\tprint the machine's network node hostname\n"
1100 "\t-r\tprint the operating system release\n"
1101 "\t-s\tprint the operating system name\n"
1102
1103 "\t-p\tprint the host processor type\n"
1104 "\t-v\tprint the operating system version\n"
1105#endif
1106 ;
1107#endif
1108
1109#if defined BB_UNIQ
1110const char uniq_usage[] =
1111 "uniq [OPTION]... [INPUT [OUTPUT]]\n"
1112#ifndef BB_FEATURE_TRIVIAL_HELP
1113 "\nDiscard all but one of successive identical lines from INPUT\n"
1114 "(or standard input), writing to OUTPUT (or standard output).\n"
1115#endif
1116 ;
1117#endif
1118
1119#if defined BB_UPDATE
1120const char update_usage[] =
1121 "update [options]\n"
1122#ifndef BB_FEATURE_TRIVIAL_HELP
1123 "\nPeriodically flushes filesystem buffers.\n\n"
1124 "Options:\n"
1125 "\t-S\tforce use of sync(2) instead of flushing\n"
1126 "\t-s SECS\tcall sync this often (default 30)\n"
1127 "\t-f SECS\tflush some buffers this often (default 5)\n"
1128#endif
1129 ;
1130#endif
1131
1132#if defined BB_USLEEP
1133const char usleep_usage[] =
1134 "usleep N\n"
1135#ifndef BB_FEATURE_TRIVIAL_HELP
1136 "\nPause for N microseconds.\n"
1137#endif
1138 ;
1139#endif
1140
1141#if defined BB_UUDECODE
1142const char uudecode_usage[] =
1143 "uudecode [FILE]...\n"
1144#ifndef BB_FEATURE_TRIVIAL_HELP
1145 "\nUudecode a file that is uuencoded.\n\n"
1146 "Options:\n"
1147 "\t-o FILE\tdirect output to FILE\n"
1148#endif
1149 ;
1150#endif
1151
1152#if defined BB_UUENCODE
1153const char uuencode_usage[] =
1154 "uuencode [OPTION] [INFILE] REMOTEFILE\n"
1155#ifndef BB_FEATURE_TRIVIAL_HELP
1156 "\nUuencode a file.\n\n"
1157 "Options:\n"
1158 "\t-m\tuse base64 encoding as of RFC1521\n"
1159#endif
1160 ;
1161#endif
1162
1163#if defined BB_WC
1164const char wc_usage[] =
1165 "wc [OPTION]... [FILE]...\n"
1166#ifndef BB_FEATURE_TRIVIAL_HELP
1167 "\nPrint line, word, and byte counts for each FILE, and a total line if\n"
1168 "more than one FILE is specified. With no FILE, read standard input.\n\n"
1169 "Options:\n"
1170 "\t-c\tprint the byte counts\n"
1171 "\t-l\tprint the newline counts\n"
1172
1173 "\t-L\tprint the length of the longest line\n"
1174 "\t-w\tprint the word counts\n"
1175#endif
1176 ;
1177#endif
1178
1179#if defined BB_WHICH
1180const char which_usage[] =
1181 "which [COMMAND ...]\n"
1182#ifndef BB_FEATURE_TRIVIAL_HELP
1183 "\nLocates a COMMAND.\n"
1184#endif
1185 ;
1186#endif
1187
1188#if defined BB_WHOAMI
1189const char whoami_usage[] =
1190 "whoami\n"
1191#ifndef BB_FEATURE_TRIVIAL_HELP
1192 "\nPrints the user name associated with the current effective user id.\n"
1193#endif
1194 ;
1195#endif
1196
1197#if defined BB_YES
1198const char yes_usage[] =
1199 "yes [OPTION]... [STRING]...\n"
1200#ifndef BB_FEATURE_TRIVIAL_HELP
1201 "\nRepeatedly outputs a line with all specified STRING(s), or `y'.\n"
1202#endif
1203 ;
1204#endif
diff --git a/ar.c b/ar.c
index a43cc1dff..d8c8d465b 100644
--- a/ar.c
+++ b/ar.c
@@ -65,18 +65,6 @@ struct ArInfo {
65}; 65};
66typedef struct ArInfo ArInfo; 66typedef struct ArInfo ArInfo;
67 67
68static const char ar_usage[] = "ar [optxvV] archive [filenames] \n"
69#ifndef BB_FEATURE_TRIVIAL_HELP
70 "\nExtract or list files from an ar archive.\n\n"
71 "Options:\n"
72 "\to\t\tpreserve original dates\n"
73 "\tp\t\textract to stdout\n"
74 "\tt\t\tlist\n"
75 "\tx\t\textract\n"
76 "\tv\t\tverbosely list files processed\n"
77#endif
78 ;
79
80/* 68/*
81 * Display details of a file, verbosly if funct=2 69 * Display details of a file, verbosly if funct=2
82 */ 70 */
diff --git a/archival/ar.c b/archival/ar.c
index a43cc1dff..d8c8d465b 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -65,18 +65,6 @@ struct ArInfo {
65}; 65};
66typedef struct ArInfo ArInfo; 66typedef struct ArInfo ArInfo;
67 67
68static const char ar_usage[] = "ar [optxvV] archive [filenames] \n"
69#ifndef BB_FEATURE_TRIVIAL_HELP
70 "\nExtract or list files from an ar archive.\n\n"
71 "Options:\n"
72 "\to\t\tpreserve original dates\n"
73 "\tp\t\textract to stdout\n"
74 "\tt\t\tlist\n"
75 "\tx\t\textract\n"
76 "\tv\t\tverbosely list files processed\n"
77#endif
78 ;
79
80/* 68/*
81 * Display details of a file, verbosly if funct=2 69 * Display details of a file, verbosly if funct=2
82 */ 70 */
diff --git a/archival/gunzip.c b/archival/gunzip.c
index de68bd19b..b29bdf7c1 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -30,19 +30,7 @@
30#include "internal.h" 30#include "internal.h"
31#include <getopt.h> 31#include <getopt.h>
32 32
33static const char gunzip_usage[] = 33/* These defines are very important for BusyBox. Without these,
34 "gunzip [OPTION]... FILE\n"
35#ifndef BB_FEATURE_TRIVIAL_HELP
36 "\nUncompress FILE (or standard input if FILE is '-').\n\n"
37 "Options:\n"
38
39 "\t-c\tWrite output to standard output\n"
40 "\t-t\tTest compressed file integrity\n"
41#endif
42 ;
43
44
45 /* These defines are very important for BusyBox. Without these,
46 * huge chunks of ram are pre-allocated making the BusyBox bss 34 * huge chunks of ram are pre-allocated making the BusyBox bss
47 * size Freaking Huge(tm), which is a bad thing.*/ 35 * size Freaking Huge(tm), which is a bad thing.*/
48#define SMALL_MEM 36#define SMALL_MEM
diff --git a/archival/gzip.c b/archival/gzip.c
index 8bc67d9c6..98ce259ca 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -40,19 +40,6 @@
40#define SMALL_MEM 40#define SMALL_MEM
41#define DYN_ALLOC 41#define DYN_ALLOC
42 42
43
44static const char gzip_usage[] =
45 "gzip [OPTION]... FILE\n"
46#ifndef BB_FEATURE_TRIVIAL_HELP
47 "\nCompress FILE with maximum compression.\n"
48 "When FILE is '-', reads standard input. Implies -c.\n\n"
49
50 "Options:\n"
51 "\t-c\tWrite output to standard output instead of FILE.gz\n"
52#endif
53 ;
54
55
56/* I don't like nested includes, but the string and io functions are used 43/* I don't like nested includes, but the string and io functions are used
57 * too often 44 * too often
58 */ 45 */
diff --git a/archival/tar.c b/archival/tar.c
index 353694f33..6f18dc43f 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -50,37 +50,6 @@
50#include <sys/types.h> 50#include <sys/types.h>
51#include <sys/sysmacros.h> 51#include <sys/sysmacros.h>
52 52
53
54static const char tar_usage[] =
55#ifdef BB_FEATURE_TAR_CREATE
56 "tar -[cxtvO] "
57#else
58 "tar -[xtvO] "
59#endif
60#if defined BB_FEATURE_TAR_EXCLUDE
61 "[--exclude File] "
62#endif
63 "[-f tarFile] [FILE] ...\n"
64#ifndef BB_FEATURE_TRIVIAL_HELP
65 "\nCreate, extract, or list files from a tar file. Note that\n"
66 "this version of tar treats hard links as separate files.\n\n"
67 "Main operation mode:\n"
68#ifdef BB_FEATURE_TAR_CREATE
69 "\tc\t\tcreate\n"
70#endif
71 "\tx\t\textract\n"
72 "\tt\t\tlist\n"
73 "\nFile selection:\n"
74 "\tf\t\tname of tarfile or \"-\" for stdin\n"
75 "\tO\t\textract to stdout\n"
76#if defined BB_FEATURE_TAR_EXCLUDE
77 "\t--exclude\tfile to exclude\n"
78#endif
79 "\nInformative output:\n"
80 "\tv\t\tverbosely list files processed\n"
81#endif
82 ;
83
84/* Tar file constants */ 53/* Tar file constants */
85#ifndef MAJOR 54#ifndef MAJOR
86#define MAJOR(dev) (((dev)>>8)&0xff) 55#define MAJOR(dev) (((dev)>>8)&0xff)
diff --git a/basename.c b/basename.c
index 5678c4433..5b83eef49 100644
--- a/basename.c
+++ b/basename.c
@@ -24,14 +24,6 @@
24#include "internal.h" 24#include "internal.h"
25#include <stdio.h> 25#include <stdio.h>
26 26
27const char *basename_usage="basename FILE [SUFFIX]\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nStrips directory path and suffixes from FILE.\n"
30 "If specified, also removes any trailing SUFFIX.\n"
31#endif
32;
33
34
35extern int basename_main(int argc, char **argv) 27extern int basename_main(int argc, char **argv)
36{ 28{
37 int m, n; 29 int m, n;
diff --git a/cat.c b/cat.c
index 6c17ee620..c27f07e82 100644
--- a/cat.c
+++ b/cat.c
@@ -34,13 +34,6 @@ static void print_file(FILE * file)
34 fflush(stdout); 34 fflush(stdout);
35} 35}
36 36
37static const char cat_usage[] =
38 "cat [FILE]...\n"
39#ifndef BB_FEATURE_TRIVIAL_HELP
40 "\nConcatenates FILE(s) and prints them to stdout.\n"
41#endif
42 ;
43
44extern int cat_main(int argc, char **argv) 37extern int cat_main(int argc, char **argv)
45{ 38{
46 FILE *file; 39 FILE *file;
diff --git a/chmod_chown_chgrp.c b/chmod_chown_chgrp.c
index 156a0a9f9..c02f2a3cb 100644
--- a/chmod_chown_chgrp.c
+++ b/chmod_chown_chgrp.c
@@ -43,29 +43,6 @@ static char *theMode = NULL;
43#define CHOWN_APP 2 43#define CHOWN_APP 2
44#define CHMOD_APP 3 44#define CHMOD_APP 3
45 45
46static const char chgrp_usage[] = "chgrp [OPTION]... GROUP FILE...\n"
47#ifndef BB_FEATURE_TRIVIAL_HELP
48 "\nChange the group membership of each FILE to GROUP.\n"
49 "\nOptions:\n\t-R\tChanges files and directories recursively.\n"
50#endif
51 ;
52static const char chown_usage[] =
53 "chown [OPTION]... OWNER[<.|:>[GROUP] FILE...\n"
54#ifndef BB_FEATURE_TRIVIAL_HELP
55 "\nChange the owner and/or group of each FILE to OWNER and/or GROUP.\n"
56 "\nOptions:\n\t-R\tChanges files and directories recursively.\n"
57#endif
58 ;
59static const char chmod_usage[] =
60 "chmod [-R] MODE[,MODE]... FILE...\n"
61#ifndef BB_FEATURE_TRIVIAL_HELP
62 "\nEach MODE is one or more of the letters ugoa, one of the symbols +-= and\n"
63 "one or more of the letters rwxst.\n\n"
64 "\nOptions:\n\t-R\tChanges files and directories recursively.\n"
65#endif
66 ;
67
68
69static int fileAction(const char *fileName, struct stat *statbuf, void* junk) 46static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
70{ 47{
71 switch (whichApp) { 48 switch (whichApp) {
diff --git a/chroot.c b/chroot.c
index 95aed3d17..9b1a5a82d 100644
--- a/chroot.c
+++ b/chroot.c
@@ -27,15 +27,6 @@
27#include <stdio.h> 27#include <stdio.h>
28#include <errno.h> 28#include <errno.h>
29 29
30
31static const char chroot_usage[] = "chroot NEWROOT [COMMAND...]\n"
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\nRun COMMAND with root directory set to NEWROOT.\n"
34#endif
35 ;
36
37
38
39int chroot_main(int argc, char **argv) 30int chroot_main(int argc, char **argv)
40{ 31{
41 char *prog; 32 char *prog;
diff --git a/chvt.c b/chvt.c
index ab0e9218f..87a1248fd 100644
--- a/chvt.c
+++ b/chvt.c
@@ -15,13 +15,6 @@
15#define VT_ACTIVATE 0x5606 /* make vt active */ 15#define VT_ACTIVATE 0x5606 /* make vt active */
16#define VT_WAITACTIVE 0x5607 /* wait for vt active */ 16#define VT_WAITACTIVE 0x5607 /* wait for vt active */
17 17
18const char chvt_usage[] =
19 "chvt N\n"
20#ifndef BB_FEATURE_TRIVIAL_HELP
21 "\nChanges the foreground virtual terminal to /dev/ttyN\n"
22#endif
23 ;
24
25int chvt_main(int argc, char **argv) 18int chvt_main(int argc, char **argv)
26{ 19{
27 int fd, num; 20 int fd, num;
diff --git a/console-tools/chvt.c b/console-tools/chvt.c
index ab0e9218f..87a1248fd 100644
--- a/console-tools/chvt.c
+++ b/console-tools/chvt.c
@@ -15,13 +15,6 @@
15#define VT_ACTIVATE 0x5606 /* make vt active */ 15#define VT_ACTIVATE 0x5606 /* make vt active */
16#define VT_WAITACTIVE 0x5607 /* wait for vt active */ 16#define VT_WAITACTIVE 0x5607 /* wait for vt active */
17 17
18const char chvt_usage[] =
19 "chvt N\n"
20#ifndef BB_FEATURE_TRIVIAL_HELP
21 "\nChanges the foreground virtual terminal to /dev/ttyN\n"
22#endif
23 ;
24
25int chvt_main(int argc, char **argv) 18int chvt_main(int argc, char **argv)
26{ 19{
27 int fd, num; 20 int fd, num;
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c
index 042de8649..9c477d238 100644
--- a/console-tools/deallocvt.c
+++ b/console-tools/deallocvt.c
@@ -13,13 +13,6 @@
13/* From <linux/vt.h> */ 13/* From <linux/vt.h> */
14#define VT_DISALLOCATE 0x5608 /* free memory associated to vt */ 14#define VT_DISALLOCATE 0x5608 /* free memory associated to vt */
15 15
16const char deallocvt_usage[] =
17 "deallocvt N\n"
18#ifndef BB_FEATURE_TRIVIAL_HELP
19 "\nDeallocate unused virtual terminal /dev/ttyN\n"
20#endif
21 ;
22
23int deallocvt_main(int argc, char *argv[]) 16int deallocvt_main(int argc, char *argv[])
24{ 17{
25 int fd, num, i; 18 int fd, num, i;
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c
index f18050529..4ce6e8698 100644
--- a/console-tools/dumpkmap.c
+++ b/console-tools/dumpkmap.c
@@ -38,14 +38,6 @@ struct kbentry {
38#define NR_KEYS 128 38#define NR_KEYS 128
39#define MAX_NR_KEYMAPS 256 39#define MAX_NR_KEYMAPS 256
40 40
41
42static const char dumpkmap_usage[] = "dumpkmap\n"
43#ifndef BB_FEATURE_TRIVIAL_HELP
44 "\nPrints out a binary keyboard translation table to standard input.\n"
45#endif
46 ;
47
48
49int dumpkmap_main(int argc, char **argv) 41int dumpkmap_main(int argc, char **argv)
50{ 42{
51 struct kbentry ke; 43 struct kbentry ke;
diff --git a/console-tools/loadacm.c b/console-tools/loadacm.c
index 9eebf3bb5..2d70ffc5d 100644
--- a/console-tools/loadacm.c
+++ b/console-tools/loadacm.c
@@ -22,12 +22,6 @@
22#include <sys/ioctl.h> 22#include <sys/ioctl.h>
23#include <sys/kd.h> 23#include <sys/kd.h>
24 24
25static const char loadacm_usage[] = "loadacm\n"
26#ifndef BB_FEATURE_TRIVIAL_HELP
27 "\nLoads an acm from standard input.\n"
28#endif
29 ;
30
31typedef unsigned short unicode; 25typedef unsigned short unicode;
32 26
33static long int ctoi(unsigned char *s, int *is_unicode); 27static long int ctoi(unsigned char *s, int *is_unicode);
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index 46a7574c0..622142925 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -30,12 +30,6 @@
30#define PSF_MAXMODE 0x03 30#define PSF_MAXMODE 0x03
31#define PSF_SEPARATOR 0xFFFF 31#define PSF_SEPARATOR 0xFFFF
32 32
33static const char loadfont_usage[] = "loadfont\n"
34#ifndef BB_FEATURE_TRIVIAL_HELP
35 "Loads a console font from standard input.\n"
36#endif
37 ;
38
39struct psf_header { 33struct psf_header {
40 unsigned char magic1, magic2; /* Magic number */ 34 unsigned char magic1, magic2; /* Magic number */
41 unsigned char mode; /* PSF font mode */ 35 unsigned char mode; /* PSF font mode */
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c
index 72247a6e4..488585f9c 100644
--- a/console-tools/loadkmap.c
+++ b/console-tools/loadkmap.c
@@ -38,14 +38,6 @@ struct kbentry {
38#define NR_KEYS 128 38#define NR_KEYS 128
39#define MAX_NR_KEYMAPS 256 39#define MAX_NR_KEYMAPS 256
40 40
41
42static const char loadkmap_usage[] = "loadkmap\n"
43#ifndef BB_FEATURE_TRIVIAL_HELP
44 "\nLoads a binary keyboard translation table from standard input.\n"
45#endif
46 ;
47
48
49int loadkmap_main(int argc, char **argv) 41int loadkmap_main(int argc, char **argv)
50{ 42{
51 struct kbentry ke; 43 struct kbentry ke;
diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c
index 1bdb909ea..284ffa194 100644
--- a/console-tools/setkeycodes.c
+++ b/console-tools/setkeycodes.c
@@ -35,17 +35,6 @@ struct kbkeycode {
35}; 35};
36#define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */ 36#define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */
37 37
38
39static const char setkeycodes_usage[] =
40 "setkeycodes SCANCODE KEYCODE ...\n"
41#ifndef BB_FEATURE_TRIVIAL_HELP
42 "\nSet entries into the kernel's scancode-to-keycode map,\n"
43 "allowing unusual keyboards to generate usable keycodes.\n\n"
44 "SCANCODE may be either xx or e0xx (hexadecimal),\n"
45 "and KEYCODE is given in decimal\n"
46#endif
47 ;
48
49extern int 38extern int
50setkeycodes_main(int argc, char** argv) 39setkeycodes_main(int argc, char** argv)
51{ 40{
diff --git a/coreutils/basename.c b/coreutils/basename.c
index 5678c4433..5b83eef49 100644
--- a/coreutils/basename.c
+++ b/coreutils/basename.c
@@ -24,14 +24,6 @@
24#include "internal.h" 24#include "internal.h"
25#include <stdio.h> 25#include <stdio.h>
26 26
27const char *basename_usage="basename FILE [SUFFIX]\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nStrips directory path and suffixes from FILE.\n"
30 "If specified, also removes any trailing SUFFIX.\n"
31#endif
32;
33
34
35extern int basename_main(int argc, char **argv) 27extern int basename_main(int argc, char **argv)
36{ 28{
37 int m, n; 29 int m, n;
diff --git a/coreutils/cat.c b/coreutils/cat.c
index 6c17ee620..c27f07e82 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -34,13 +34,6 @@ static void print_file(FILE * file)
34 fflush(stdout); 34 fflush(stdout);
35} 35}
36 36
37static const char cat_usage[] =
38 "cat [FILE]...\n"
39#ifndef BB_FEATURE_TRIVIAL_HELP
40 "\nConcatenates FILE(s) and prints them to stdout.\n"
41#endif
42 ;
43
44extern int cat_main(int argc, char **argv) 37extern int cat_main(int argc, char **argv)
45{ 38{
46 FILE *file; 39 FILE *file;
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index 95aed3d17..9b1a5a82d 100644
--- a/coreutils/chroot.c
+++ b/coreutils/chroot.c
@@ -27,15 +27,6 @@
27#include <stdio.h> 27#include <stdio.h>
28#include <errno.h> 28#include <errno.h>
29 29
30
31static const char chroot_usage[] = "chroot NEWROOT [COMMAND...]\n"
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\nRun COMMAND with root directory set to NEWROOT.\n"
34#endif
35 ;
36
37
38
39int chroot_main(int argc, char **argv) 30int chroot_main(int argc, char **argv)
40{ 31{
41 char *prog; 32 char *prog;
diff --git a/coreutils/cut.c b/coreutils/cut.c
index 08b4586a4..8b28fff7a 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -206,20 +206,6 @@ void cut()
206 } 206 }
207} 207}
208 208
209const char cut_usage[] =
210 "cut [OPTION]... [FILE]...\n"
211#ifndef BB_FEATURE_TRIVIAL_HELP
212 "\nPrints selected fields from each input FILE to standard output.\n\n"
213 "Options:\n"
214 "\t-b LIST\tOutput only bytes from LIST\n"
215 "\t-c LIST\tOutput only characters from LIST\n"
216 "\t-d CHAR\tUse CHAR instead of tab as the field delimiter\n"
217 "\t-s\tOnly output Lines if the include DELIM\n"
218 "\t-f N\tPrint only these fields\n"
219 "\t-n\tIgnored\n"
220#endif
221 ;
222
223int cut_main(int argc, char **argv) 209int cut_main(int argc, char **argv)
224{ 210{
225 int i = 1; 211 int i = 1;
diff --git a/coreutils/date.c b/coreutils/date.c
index 3ede1237c..b6fc6c686 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -39,17 +39,6 @@
39 an RFC 822 complient date output for shell scripting 39 an RFC 822 complient date output for shell scripting
40 mail commands */ 40 mail commands */
41 41
42static const char date_usage[] = "date [OPTION]... [+FORMAT]\n"
43 " or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]\n"
44#ifndef BB_FEATURE_TRIVIAL_HELP
45 "\nDisplays the current time in the given FORMAT, or sets the system date.\n"
46 "\nOptions:\n\t-R\tOutputs RFC-822 compliant date string\n"
47 "\t-s\tSets time described by STRING\n"
48 "\t-u\tPrints or sets Coordinated Universal Time\n"
49#endif
50 ;
51
52
53/* Input parsing code is always bulky - used heavy duty libc stuff as 42/* Input parsing code is always bulky - used heavy duty libc stuff as
54 much as possible, missed out a lot of bounds checking */ 43 much as possible, missed out a lot of bounds checking */
55 44
diff --git a/coreutils/dd.c b/coreutils/dd.c
index 6261dfef5..86899194c 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -40,23 +40,6 @@
40typedef unsigned long long int uintmax_t; 40typedef unsigned long long int uintmax_t;
41#endif 41#endif
42 42
43static const char dd_usage[] =
44 "dd [if=FILE] [of=FILE] [bs=N] [count=N] [skip=N] [seek=N]\n"
45#ifndef BB_FEATURE_TRIVIAL_HELP
46 "\nCopy a file, converting and formatting according to options\n\n"
47 "\tif=FILE\tread from FILE instead of stdin\n"
48 "\tof=FILE\twrite to FILE instead of stdout\n"
49 "\tbs=N\tread and write N bytes at a time\n"
50 "\tcount=N\tcopy only N input blocks\n"
51 "\tskip=N\tskip N input blocks\n"
52 "\tseek=N\tskip N output blocks\n"
53 "\n"
54 "Numbers may be suffixed by w (x2), k (x1024), b (x512), or M (x1024^2)\n"
55#endif
56 ;
57
58
59
60extern int dd_main(int argc, char **argv) 43extern int dd_main(int argc, char **argv)
61{ 44{
62 char *inFile = NULL; 45 char *inFile = NULL;
diff --git a/coreutils/df.c b/coreutils/df.c
index 62226ceb8..714c79965 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -28,12 +28,6 @@
28#include <sys/stat.h> 28#include <sys/stat.h>
29#include <sys/vfs.h> 29#include <sys/vfs.h>
30 30
31static const char df_usage[] = "df [filesystem ...]\n"
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\nPrint the filesystem space used and space available.\n"
34#endif
35 ;
36
37extern const char mtab_file[]; /* Defined in utility.c */ 31extern const char mtab_file[]; /* Defined in utility.c */
38 32
39static int df(char *device, const char *mountPoint) 33static int df(char *device, const char *mountPoint)
diff --git a/coreutils/dirname.c b/coreutils/dirname.c
index 0b60ceb88..e63fef30b 100644
--- a/coreutils/dirname.c
+++ b/coreutils/dirname.c
@@ -23,13 +23,6 @@
23#include "internal.h" 23#include "internal.h"
24#include <stdio.h> 24#include <stdio.h>
25 25
26const char dirname_usage[] =
27 "dirname [FILENAME ...]\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nStrips non-directory suffix from FILENAME\n"
30#endif
31 ;
32
33extern int dirname_main(int argc, char **argv) 26extern int dirname_main(int argc, char **argv)
34{ 27{
35 char* s; 28 char* s;
diff --git a/coreutils/du.c b/coreutils/du.c
index f1a44427a..147914c9e 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -35,17 +35,6 @@
35 35
36typedef void (Display) (long, char *); 36typedef void (Display) (long, char *);
37 37
38static const char du_usage[] =
39 "du [OPTION]... [FILE]...\n"
40#ifndef BB_FEATURE_TRIVIAL_HELP
41 "\nSummarizes disk space used for each FILE and/or directory.\n"
42 "Disk space is printed in units of 1024 bytes.\n\n"
43 "Options:\n"
44 "\t-l\tcount sizes many times if hard linked\n"
45 "\t-s\tdisplay only a total for each argument\n"
46#endif
47 ;
48
49static int du_depth = 0; 38static int du_depth = 0;
50static int count_hardlinks = 0; 39static int count_hardlinks = 0;
51 40
@@ -174,7 +163,7 @@ int du_main(int argc, char **argv)
174 return(0); 163 return(0);
175} 164}
176 165
177/* $Id: du.c,v 1.22 2000/07/14 18:38:26 andersen Exp $ */ 166/* $Id: du.c,v 1.23 2000/07/16 20:57:15 kraai Exp $ */
178/* 167/*
179Local Variables: 168Local Variables:
180c-file-style: "linux" 169c-file-style: "linux"
diff --git a/coreutils/echo.c b/coreutils/echo.c
index 387ea3fef..73be8f2e2 100644
--- a/coreutils/echo.c
+++ b/coreutils/echo.c
@@ -25,17 +25,6 @@
25#include "internal.h" 25#include "internal.h"
26#include <stdio.h> 26#include <stdio.h>
27 27
28static const char uname_usage[] =
29 "echo [-neE] [ARG ...]\n"
30#ifndef BB_FEATURE_TRIVIAL_HELP
31 "\nPrints the specified ARGs to stdout\n\n"
32 "Options:\n"
33 "\t-n\tsuppress trailing newline\n"
34 "\t-e\tinterpret backslash-escaped characters (i.e. \\t=tab etc)\n"
35 "\t-E\tdisable interpretation of backslash-escaped characters\n"
36#endif
37 ;
38
39extern int 28extern int
40echo_main(int argc, char** argv) 29echo_main(int argc, char** argv)
41{ 30{
@@ -58,7 +47,7 @@ echo_main(int argc, char** argv)
58 eflag = 0; 47 eflag = 0;
59 break; 48 break;
60 default: 49 default:
61 usage(uname_usage); 50 usage(echo_usage);
62 } 51 }
63 } 52 }
64 53
diff --git a/coreutils/head.c b/coreutils/head.c
index b82678dc2..58b3cae68 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -26,17 +26,6 @@
26#include <errno.h> 26#include <errno.h>
27#include <stdio.h> 27#include <stdio.h>
28 28
29const char head_usage[] =
30 "head [OPTION] [FILE]...\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nPrint first 10 lines of each FILE to standard output.\n"
33 "With more than one FILE, precede each with a header giving the\n"
34 "file name. With no FILE, or when FILE is -, read standard input.\n\n"
35
36 "Options:\n" "\t-n NUM\t\tPrint first NUM lines instead of first 10\n"
37#endif
38 ;
39
40int head(int len, FILE * src) 29int head(int len, FILE * src)
41{ 30{
42 int i; 31 int i;
@@ -111,4 +100,4 @@ int head_main(int argc, char **argv)
111 return(0); 100 return(0);
112} 101}
113 102
114/* $Id: head.c,v 1.12 2000/07/14 01:51:25 kraai Exp $ */ 103/* $Id: head.c,v 1.13 2000/07/16 20:57:15 kraai Exp $ */
diff --git a/coreutils/id.c b/coreutils/id.c
index 69dfe2658..56a2e279f 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -28,17 +28,6 @@
28#include <grp.h> 28#include <grp.h>
29#include <sys/types.h> 29#include <sys/types.h>
30 30
31static const char id_usage[] =
32 "id [OPTIONS]... [USERNAME]\n"
33#ifndef BB_FEATURE_TRIVIAL_HELP
34 "\nPrint information for USERNAME or the current user\n\n"
35 "Options:\n"
36 "\t-g\tprints only the group ID\n"
37 "\t-u\tprints only the user ID\n"
38 "\t-r\tprints the real user ID instead of the effective ID (with -ug)\n\n"
39#endif
40 ;
41
42extern int id_main(int argc, char **argv) 31extern int id_main(int argc, char **argv)
43{ 32{
44 int no_user = 0, no_group = 0, print_real = 0; 33 int no_user = 0, no_group = 0, print_real = 0;
diff --git a/coreutils/length.c b/coreutils/length.c
index 82f50c159..cf4fb1c07 100644
--- a/coreutils/length.c
+++ b/coreutils/length.c
@@ -4,13 +4,6 @@
4#include <string.h> 4#include <string.h>
5#include <stdio.h> 5#include <stdio.h>
6 6
7const char length_usage[] =
8 "length STRING\n"
9#ifndef BB_FEATURE_TRIVIAL_HELP
10 "\nPrints out the length of the specified STRING.\n"
11#endif
12 ;
13
14extern int length_main(int argc, char **argv) 7extern int length_main(int argc, char **argv)
15{ 8{
16 if (argc != 2 || **(argv + 1) == '-') 9 if (argc != 2 || **(argv + 1) == '-')
diff --git a/coreutils/ln.c b/coreutils/ln.c
index 9f7774380..8b8fa1c58 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -30,19 +30,6 @@
30#include <dirent.h> 30#include <dirent.h>
31#include <errno.h> 31#include <errno.h>
32 32
33static const char ln_usage[] =
34 "ln [OPTION] TARGET... LINK_NAME|DIRECTORY\n"
35#ifndef BB_FEATURE_TRIVIAL_HELP
36 "\nCreate a link named LINK_NAME or DIRECTORY to the specified TARGET\n"
37 "\nYou may use '--' to indicate that all following arguments are non-options.\n\n"
38 "Options:\n"
39 "\t-s\tmake symbolic links instead of hard links\n"
40
41 "\t-f\tremove existing destination files\n"
42 "\t-n\tno dereference symlinks - treat like normal file\n"
43#endif
44 ;
45
46static int symlinkFlag = FALSE; 33static int symlinkFlag = FALSE;
47static int removeoldFlag = FALSE; 34static int removeoldFlag = FALSE;
48static int followLinks = TRUE; 35static int followLinks = TRUE;
diff --git a/coreutils/logname.c b/coreutils/logname.c
index 12ebfbde6..a0aff42d6 100644
--- a/coreutils/logname.c
+++ b/coreutils/logname.c
@@ -23,12 +23,6 @@
23#include "internal.h" 23#include "internal.h"
24#include <stdio.h> 24#include <stdio.h>
25 25
26static const char logname_usage[] = "logname\n"
27#ifndef BB_FEATURE_TRIVIAL_HELP
28 "\nPrint the name of the current user.\n"
29#endif
30 ;
31
32extern int logname_main(int argc, char **argv) 26extern int logname_main(int argc, char **argv)
33{ 27{
34 char *user = xmalloc(9); 28 char *user = xmalloc(9);
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 0644cde87..e56e3bcfb 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -427,63 +427,6 @@ static int list_item(const char *name)
427 return 1; 427 return 1;
428} 428}
429 429
430static const char ls_usage[] = "ls [-1a"
431#ifdef BB_FEATURE_LS_TIMESTAMPS
432 "c"
433#endif
434 "d"
435#ifdef BB_FEATURE_LS_TIMESTAMPS
436 "e"
437#endif
438 "ln"
439#ifdef BB_FEATURE_LS_FILETYPES
440 "p"
441#endif
442#ifdef BB_FEATURE_LS_TIMESTAMPS
443 "u"
444#endif
445 "xAC"
446#ifdef BB_FEATURE_LS_FILETYPES
447 "F"
448#endif
449#ifdef BB_FEATURE_LS_RECURSIVE
450 "R"
451#endif
452 "] [filenames...]\n"
453#ifndef BB_FEATURE_TRIVIAL_HELP
454 "\nList directory contents\n\n"
455 "Options:\n"
456 "\t-a\tdo not hide entries starting with .\n"
457#ifdef BB_FEATURE_LS_TIMESTAMPS
458 "\t-c\twith -l: show ctime (the time of last\n"
459 "\t\tmodification of file status information)\n"
460#endif
461 "\t-d\tlist directory entries instead of contents\n"
462#ifdef BB_FEATURE_LS_TIMESTAMPS
463 "\t-e\tlist both full date and full time\n"
464#endif
465 "\t-l\tuse a long listing format\n"
466 "\t-n\tlist numeric UIDs and GIDs instead of names\n"
467#ifdef BB_FEATURE_LS_FILETYPES
468 "\t-p\tappend indicator (one of /=@|) to entries\n"
469#endif
470#ifdef BB_FEATURE_LS_TIMESTAMPS
471 "\t-u\twith -l: show access time (the time of last\n"
472 "\t\taccess of the file)\n"
473#endif
474 "\t-x\tlist entries by lines instead of by columns\n"
475 "\t-A\tdo not list implied . and ..\n"
476 "\t-C\tlist entries by columns\n"
477#ifdef BB_FEATURE_LS_FILETYPES
478 "\t-F\tappend indicator (one of */=@|) to entries\n"
479#endif
480#ifdef BB_FEATURE_LS_RECURSIVE
481 "\t-R\tlist subdirectories recursively\n"
482#endif
483#endif
484 ;
485
486
487#ifdef BB_FEATURE_LS_RECURSIVE 430#ifdef BB_FEATURE_LS_RECURSIVE
488static int dirAction(const char *fileName, struct stat *statbuf, void* junk) 431static int dirAction(const char *fileName, struct stat *statbuf, void* junk)
489{ 432{
diff --git a/coreutils/md5sum.c b/coreutils/md5sum.c
index e6f1c86b4..fad563fe7 100644
--- a/coreutils/md5sum.c
+++ b/coreutils/md5sum.c
@@ -582,23 +582,6 @@ static int status_only = 0; /* With -c, don't generate any output.
582static int warn = 0; /* With -w, print a message to standard error warning 582static int warn = 0; /* With -w, print a message to standard error warning
583 about each improperly formatted MD5 checksum line */ 583 about each improperly formatted MD5 checksum line */
584 584
585static const char md5sum_usage[] =
586 "md5sum [OPTION] [FILE]...\n"
587 "or: md5sum [OPTION] -c [FILE]\n"
588#ifndef BB_FEATURE_TRIVIAL_HELP
589 "\nPrint or check MD5 checksums.\n\n"
590 "Options:\n"
591 "With no FILE, or when FILE is -, read standard input.\n\n"
592 "\t-b\tread files in binary mode\n"
593 "\t-c\tcheck MD5 sums against given list\n"
594 "\t-t\tread files in text mode (default)\n"
595 "\t-g\tread a string\n"
596 "\nThe following two options are useful only when verifying checksums:\n"
597 "\t-s,\tdon't output anything, status code shows success\n"
598 "\t-w,\twarn about improperly formated MD5 checksum lines\n"
599#endif
600;
601
602static int split_3(char *s, 585static int split_3(char *s,
603 size_t s_len, 586 size_t s_len,
604 unsigned char **u, 587 unsigned char **u,
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index f6e08cadc..f824cdcb6 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -29,18 +29,6 @@
29#include <stdio.h> 29#include <stdio.h>
30#include <errno.h> 30#include <errno.h>
31 31
32static const char mkdir_usage[] =
33 "mkdir [OPTION] DIRECTORY...\n"
34#ifndef BB_FEATURE_TRIVIAL_HELP
35 "\nCreate the DIRECTORY(ies), if they do not already exist\n\n"
36 "Options:\n"
37
38 "\t-m\tset permission mode (as in chmod), not rwxrwxrwx - umask\n"
39 "\t-p\tno error if existing, make parent directories as needed\n"
40#endif
41 ;
42
43
44static int parentFlag = FALSE; 32static int parentFlag = FALSE;
45static mode_t mode = 0777; 33static mode_t mode = 0777;
46 34
diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c
index f701a97d5..3db17bbbc 100644
--- a/coreutils/mkfifo.c
+++ b/coreutils/mkfifo.c
@@ -26,14 +26,6 @@
26#include <sys/stat.h> 26#include <sys/stat.h>
27#include <errno.h> 27#include <errno.h>
28 28
29static const char mkfifo_usage[] = "mkfifo [OPTIONS] name\n"
30#ifndef BB_FEATURE_TRIVIAL_HELP
31 "\nCreates a named pipe (identical to 'mknod name p')\n\n"
32 "Options:\n"
33 "\t-m\tcreate the pipe using the specified mode (default a=rw)\n"
34#endif
35 ;
36
37extern int mkfifo_main(int argc, char **argv) 29extern int mkfifo_main(int argc, char **argv)
38{ 30{
39 char *thisarg; 31 char *thisarg;
diff --git a/coreutils/mknod.c b/coreutils/mknod.c
index ac96817ee..b51c8f3e3 100644
--- a/coreutils/mknod.c
+++ b/coreutils/mknod.c
@@ -28,18 +28,6 @@
28#include <fcntl.h> 28#include <fcntl.h>
29#include <unistd.h> 29#include <unistd.h>
30 30
31static const char mknod_usage[] = "mknod [OPTIONS] NAME TYPE MAJOR MINOR\n"
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\nCreate a special file (block, character, or pipe).\n\n"
34 "Options:\n"
35 "\t-m\tcreate the special file using the specified mode (default a=rw)\n\n"
36 "TYPEs include:\n"
37 "\tb:\tMake a block (buffered) device.\n"
38 "\tc or u:\tMake a character (un-buffered) device.\n"
39 "\tp:\tMake a named pipe. MAJOR and MINOR are ignored for named pipes.\n"
40#endif
41 ;
42
43int mknod_main(int argc, char **argv) 31int mknod_main(int argc, char **argv)
44{ 32{
45 char *thisarg; 33 char *thisarg;
diff --git a/coreutils/printf.c b/coreutils/printf.c
index f57289759..6a87fc319 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -137,13 +137,6 @@ static void verify __P((char *s, char *end));
137/* The value to return to the calling program. */ 137/* The value to return to the calling program. */
138static int exit_status; 138static int exit_status;
139 139
140static const char printf_usage[] = "printf FORMAT [ARGUMENT...]\n"
141#ifndef BB_FEATURE_TRIVIAL_HELP
142 "\nFormats and prints ARGUMENT(s) according to FORMAT,\n"
143 "Where FORMAT controls the output exactly as in C printf.\n"
144#endif
145 ;
146
147int printf_main(int argc, char **argv) 140int printf_main(int argc, char **argv)
148{ 141{
149 char *format; 142 char *format;
diff --git a/coreutils/rm.c b/coreutils/rm.c
index 2067d878c..275c05946 100644
--- a/coreutils/rm.c
+++ b/coreutils/rm.c
@@ -29,17 +29,6 @@
29#include <dirent.h> 29#include <dirent.h>
30#include <errno.h> 30#include <errno.h>
31 31
32static const char *rm_usage = "rm [OPTION]... FILE...\n"
33#ifndef BB_FEATURE_TRIVIAL_HELP
34 "\nRemove (unlink) the FILE(s). You may use '--' to\n"
35 "indicate that all following arguments are non-options.\n\n"
36 "Options:\n"
37 "\t-f\t\tremove existing destinations, never prompt\n"
38 "\t-r or -R\tremove the contents of directories recursively\n"
39#endif
40 ;
41
42
43static int recursiveFlag = FALSE; 32static int recursiveFlag = FALSE;
44static int forceFlag = FALSE; 33static int forceFlag = FALSE;
45static const char *srcName; 34static const char *srcName;
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c
index 3c3533fae..500890e40 100644
--- a/coreutils/rmdir.c
+++ b/coreutils/rmdir.c
@@ -26,13 +26,6 @@
26#include <stdio.h> 26#include <stdio.h>
27#include <errno.h> 27#include <errno.h>
28 28
29const char rmdir_usage[] =
30 "rmdir [OPTION]... DIRECTORY...\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nRemove the DIRECTORY(ies), if they are empty.\n"
33#endif
34 ;
35
36extern int rmdir_main(int argc, char **argv) 29extern int rmdir_main(int argc, char **argv)
37{ 30{
38 if (argc == 1 || **(argv + 1) == '-') 31 if (argc == 1 || **(argv + 1) == '-')
diff --git a/coreutils/sleep.c b/coreutils/sleep.c
index c7ab32d4b..d6705c4c3 100644
--- a/coreutils/sleep.c
+++ b/coreutils/sleep.c
@@ -24,12 +24,6 @@
24#include "internal.h" 24#include "internal.h"
25#include <stdio.h> 25#include <stdio.h>
26 26
27const char sleep_usage[] = "sleep N\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nPause for N seconds.\n"
30#endif
31 ;
32
33extern int sleep_main(int argc, char **argv) 27extern int sleep_main(int argc, char **argv)
34{ 28{
35 if ((argc < 2) || (**(argv + 1) == '-')) { 29 if ((argc < 2) || (**(argv + 1) == '-')) {
diff --git a/coreutils/sort.c b/coreutils/sort.c
index c754989ea..6af5c4df3 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -29,16 +29,6 @@
29#include <stdio.h> 29#include <stdio.h>
30#include <errno.h> 30#include <errno.h>
31 31
32static const char sort_usage[] = "sort [-n]"
33#ifdef BB_FEATURE_SORT_REVERSE
34" [-r]"
35#endif
36" [FILE]...\n"
37#ifndef BB_FEATURE_TRIVIAL_HELP
38"\nSorts lines of text in the specified files\n"
39#endif
40;
41
42#ifdef BB_FEATURE_SORT_REVERSE 32#ifdef BB_FEATURE_SORT_REVERSE
43#define APPLY_REVERSE(x) (reverse ? -(x) : (x)) 33#define APPLY_REVERSE(x) (reverse ? -(x) : (x))
44static int reverse = 0; 34static int reverse = 0;
@@ -304,4 +294,4 @@ int sort_main(int argc, char **argv)
304 return(0); 294 return(0);
305} 295}
306 296
307/* $Id: sort.c,v 1.19 2000/07/14 01:51:25 kraai Exp $ */ 297/* $Id: sort.c,v 1.20 2000/07/16 20:57:15 kraai Exp $ */
diff --git a/coreutils/sync.c b/coreutils/sync.c
index f7c14b04c..3737cb1f1 100644
--- a/coreutils/sync.c
+++ b/coreutils/sync.c
@@ -24,13 +24,6 @@
24#include "internal.h" 24#include "internal.h"
25#include <stdio.h> 25#include <stdio.h>
26 26
27const char sync_usage[] =
28 "sync\n"
29#ifndef BB_FEATURE_TRIVIAL_HELP
30 "\nWrite all buffered filesystem blocks to disk.\n"
31#endif
32 ;
33
34extern int sync_main(int argc, char **argv) 27extern int sync_main(int argc, char **argv)
35{ 28{
36 if (argc > 1 && **(argv + 1) == '-') 29 if (argc > 1 && **(argv + 1) == '-')
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 9232356eb..cea63e840 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -72,21 +72,6 @@ static int forever;
72/* If nonzero, print filename headers. */ 72/* If nonzero, print filename headers. */
73static int print_headers; 73static int print_headers;
74 74
75const char tail_usage[] =
76 "tail [OPTION] [FILE]...\n"
77#ifndef BB_FEATURE_TRIVIAL_HELP
78 "\nPrint last 10 lines of each FILE to standard output.\n"
79 "With more than one FILE, precede each with a header giving the\n"
80 "file name. With no FILE, or when FILE is -, read standard input.\n\n"
81 "Options:\n"
82 "\t-n NUM\t\tPrint last NUM lines instead of first 10\n"
83
84 "\t-f\t\tOutput data as the file grows. This version\n"
85 "\t\t\tof 'tail -f' supports only one file at a time.\n"
86#endif
87 ;
88
89
90static void write_header(const char *filename) 75static void write_header(const char *filename)
91{ 76{
92 static int first_file = 1; 77 static int first_file = 1;
@@ -516,25 +501,6 @@ char *program_name;
516/* Nonzero if we have ever read standard input. */ 501/* Nonzero if we have ever read standard input. */
517static int have_read_stdin; 502static int have_read_stdin;
518 503
519
520static const char tail_usage[] = "tail [OPTION]... [FILE]...\n"
521#ifndef BB_FEATURE_TRIVIAL_HELP
522"\nPrint last 10 lines of each FILE to standard output.\n\
523With more than one FILE, precede each with a header giving the file name.\n\
524With no FILE, or when FILE is -, read standard input.\n\
525\n\
526 -c=N[kbm] output the last N bytes\n\
527 -f output appended data as the file grows\n\
528 -n=N output the last N lines, instead of last 10\n\
529 -q never output headers giving file names\n\
530 -v always output headers giving file names\n\
531\n\
532If the first character of N (bytes or lines) is a `+', output begins with \n\
533the Nth item from the start of each file, otherwise, print the last N items\n\
534in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2).\n"
535#endif
536;
537
538static void write_header(const char *filename, const char *comment) 504static void write_header(const char *filename, const char *comment)
539{ 505{
540 static int first_file = 1; 506 static int first_file = 1;
diff --git a/coreutils/tee.c b/coreutils/tee.c
index 67b42a24d..c15408b51 100644
--- a/coreutils/tee.c
+++ b/coreutils/tee.c
@@ -26,18 +26,6 @@
26#include <errno.h> 26#include <errno.h>
27#include <stdio.h> 27#include <stdio.h>
28 28
29static const char tee_usage[] =
30 "tee [OPTION]... [FILE]...\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nCopy standard input to each FILE, and also to standard output.\n\n"
33 "Options:\n" "\t-a\tappend to the given FILEs, do not overwrite\n"
34#if 0
35 "\t-i\tignore interrupt signals\n"
36#endif
37#endif
38;
39
40
41/* FileList _______________________________________________________________ */ 29/* FileList _______________________________________________________________ */
42 30
43#define FL_MAX 1024 31#define FL_MAX 1024
@@ -133,4 +121,4 @@ int tee_main(int argc, char **argv)
133 return(0); 121 return(0);
134} 122}
135 123
136/* $Id: tee.c,v 1.12 2000/07/14 01:51:25 kraai Exp $ */ 124/* $Id: tee.c,v 1.13 2000/07/16 20:57:15 kraai Exp $ */
diff --git a/coreutils/test.c b/coreutils/test.c
index bf1622cde..9a1888b28 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -178,15 +178,6 @@ static int test_eaccess();
178static int is_a_group_member(); 178static int is_a_group_member();
179static void initialize_group_array(); 179static void initialize_group_array();
180 180
181const char test_usage[] =
182 "test EXPRESSION\n"
183 "or [ EXPRESSION ]\n"
184#ifndef BB_FEATURE_TRIVIAL_HELP
185 "\nChecks file types and compares values returning an exit\n"
186 "code determined by the value of EXPRESSION.\n"
187#endif
188 ;
189
190extern int 181extern int
191test_main(int argc, char** argv) 182test_main(int argc, char** argv)
192{ 183{
diff --git a/coreutils/touch.c b/coreutils/touch.c
index ac275423c..afdd265f7 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -30,16 +30,6 @@
30#include <utime.h> 30#include <utime.h>
31#include <errno.h> 31#include <errno.h>
32 32
33
34static const char touch_usage[] = "touch [-c] file [file ...]\n"
35#ifndef BB_FEATURE_TRIVIAL_HELP
36 "\nUpdate the last-modified date on the given file[s].\n\n"
37 "Options:\n"
38 "\t-c\tDo not create any files\n"
39#endif
40 ;
41
42
43extern int touch_main(int argc, char **argv) 33extern int touch_main(int argc, char **argv)
44{ 34{
45 int fd; 35 int fd;
diff --git a/coreutils/tr.c b/coreutils/tr.c
index 2971ef68e..004092477 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -34,19 +34,6 @@
34#define bb_need_write_error 34#define bb_need_write_error
35#include "messages.c" 35#include "messages.c"
36 36
37const char *tr_usage="tr [-cds] STRING1 [STRING2]\n"
38#ifndef BB_FEATURE_TRIVIAL_HELP
39 "\nTranslate, squeeze, and/or delete characters from\n"
40 "standard input, writing to standard output.\n\n"
41 "Options:\n"
42 "\t-c\ttake complement of STRING1\n"
43 "\t-d\tdelete input characters coded STRING1\n"
44 "\t-s\tsqueeze multiple output characters of STRING2 into one character\n"
45#endif
46;
47
48
49
50#ifdef TRUE 37#ifdef TRUE
51#undef TRUE 38#undef TRUE
52#undef FALSE 39#undef FALSE
diff --git a/coreutils/tty.c b/coreutils/tty.c
index f3c7fb74f..bbc051f6b 100644
--- a/coreutils/tty.c
+++ b/coreutils/tty.c
@@ -24,14 +24,6 @@
24#include <stdio.h> 24#include <stdio.h>
25#include <sys/types.h> 25#include <sys/types.h>
26 26
27static const char tty_usage[] = "tty\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nPrint the file name of the terminal connected to standard input.\n\n"
30 "Options:\n"
31 "\t-s\tprint nothing, only return an exit status\n"
32#endif
33 ;
34
35extern int tty_main(int argc, char **argv) 27extern int tty_main(int argc, char **argv)
36{ 28{
37 char *tty; 29 char *tty;
diff --git a/coreutils/uname.c b/coreutils/uname.c
index b7c88ece5..55616dd19 100644
--- a/coreutils/uname.c
+++ b/coreutils/uname.c
@@ -40,24 +40,6 @@
40# include <sys/systeminfo.h> 40# include <sys/systeminfo.h>
41#endif 41#endif
42 42
43
44static const char uname_usage[] =
45 "uname [OPTION]...\n"
46#ifndef BB_FEATURE_TRIVIAL_HELP
47 "\nPrint certain system information. With no OPTION, same as -s.\n\n"
48 "Options:\n"
49 "\t-a\tprint all information\n"
50 "\t-m\tthe machine (hardware) type\n"
51 "\t-n\tprint the machine's network node hostname\n"
52 "\t-r\tprint the operating system release\n"
53 "\t-s\tprint the operating system name\n"
54
55 "\t-p\tprint the host processor type\n"
56 "\t-v\tprint the operating system version\n"
57#endif
58 ;
59
60
61static void print_element(unsigned int mask, char *element); 43static void print_element(unsigned int mask, char *element);
62 44
63/* Values that are bitwise or'd into `toprint'. */ 45/* Values that are bitwise or'd into `toprint'. */
diff --git a/coreutils/uniq.c b/coreutils/uniq.c
index 16b257670..016fc7780 100644
--- a/coreutils/uniq.c
+++ b/coreutils/uniq.c
@@ -27,14 +27,6 @@
27#include <string.h> 27#include <string.h>
28#include <errno.h> 28#include <errno.h>
29 29
30static const char uniq_usage[] =
31 "uniq [OPTION]... [INPUT [OUTPUT]]\n"
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\nDiscard all but one of successive identical lines from INPUT\n"
34 "(or standard input), writing to OUTPUT (or standard output).\n"
35#endif
36 ;
37
38/* max chars in line */ 30/* max chars in line */
39#define UNIQ_MAX 4096 31#define UNIQ_MAX 4096
40 32
@@ -187,4 +179,4 @@ int uniq_main(int argc, char **argv)
187 return(0); 179 return(0);
188} 180}
189 181
190/* $Id: uniq.c,v 1.12 2000/07/14 01:51:25 kraai Exp $ */ 182/* $Id: uniq.c,v 1.13 2000/07/16 20:57:15 kraai Exp $ */
diff --git a/coreutils/usleep.c b/coreutils/usleep.c
index da6cca9ab..fcdf3bbf6 100644
--- a/coreutils/usleep.c
+++ b/coreutils/usleep.c
@@ -25,12 +25,6 @@
25#include <stdlib.h> 25#include <stdlib.h>
26#include <unistd.h> 26#include <unistd.h>
27 27
28const char usleep_usage[] = "usleep N\n"
29#ifndef BB_FEATURE_TRIVIAL_HELP
30 "\nPause for N microseconds.\n"
31#endif
32 ;
33
34extern int usleep_main(int argc, char **argv) 28extern int usleep_main(int argc, char **argv)
35{ 29{
36 if ((argc < 2) || (**(argv + 1) == '-')) { 30 if ((argc < 2) || (**(argv + 1) == '-')) {
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index 12a71a573..90bef9238 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -300,15 +300,6 @@ static int decode (const char *inname,
300 return read_stduu (inname); 300 return read_stduu (inname);
301} 301}
302 302
303static const char uudecode_usage[] =
304 "uudecode [FILE]...\n"
305#ifndef BB_FEATURE_TRIVIAL_HELP
306 "\nUudecode a file that is uuencoded.\n\n"
307 "Options:\n"
308 "\t-o FILE\tdirect output to FILE\n"
309#endif
310;
311
312int uudecode_main (int argc, 303int uudecode_main (int argc,
313 char **argv) 304 char **argv)
314{ 305{
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c
index e107a01e7..1433c7f3b 100644
--- a/coreutils/uuencode.c
+++ b/coreutils/uuencode.c
@@ -180,15 +180,6 @@ static void encode()
180 } 180 }
181} 181}
182 182
183static const char uuencode_usage[] =
184 "uuencode [OPTION] [INFILE] REMOTEFILE\n"
185#ifndef BB_FEATURE_TRIVIAL_HELP
186 "\nUuencode a file.\n\n"
187 "Options:\n"
188 "\t-m\tuse base64 encoding as of RFC1521\n"
189#endif
190;
191
192int uuencode_main (int argc, 183int uuencode_main (int argc,
193 char **argv) 184 char **argv)
194{ 185{
diff --git a/coreutils/wc.c b/coreutils/wc.c
index 3b0e589b6..058444d89 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -23,19 +23,6 @@
23#include "internal.h" 23#include "internal.h"
24#include <stdio.h> 24#include <stdio.h>
25 25
26static const char wc_usage[] = "wc [OPTION]... [FILE]...\n"
27#ifndef BB_FEATURE_TRIVIAL_HELP
28 "\nPrint line, word, and byte counts for each FILE, and a total line if\n"
29 "more than one FILE is specified. With no FILE, read standard input.\n\n"
30 "Options:\n"
31 "\t-c\tprint the byte counts\n"
32 "\t-l\tprint the newline counts\n"
33
34 "\t-L\tprint the length of the longest line\n"
35 "\t-w\tprint the word counts\n"
36#endif
37 ;
38
39static int total_lines, total_words, total_chars, max_length; 26static int total_lines, total_words, total_chars, max_length;
40static int print_lines, print_words, print_chars, print_length; 27static int print_lines, print_words, print_chars, print_length;
41 28
diff --git a/coreutils/whoami.c b/coreutils/whoami.c
index 01dff81f9..84b27fe58 100644
--- a/coreutils/whoami.c
+++ b/coreutils/whoami.c
@@ -24,12 +24,6 @@
24#include <stdio.h> 24#include <stdio.h>
25#include <pwd.h> 25#include <pwd.h>
26 26
27static const char whoami_usage[] = "whoami\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nPrints the user name associated with the current effective user id.\n"
30#endif
31 ;
32
33extern int whoami_main(int argc, char **argv) 27extern int whoami_main(int argc, char **argv)
34{ 28{
35 char *user = xmalloc(9); 29 char *user = xmalloc(9);
diff --git a/coreutils/yes.c b/coreutils/yes.c
index 0191bb003..f41bbb6ef 100644
--- a/coreutils/yes.c
+++ b/coreutils/yes.c
@@ -23,13 +23,6 @@
23#include "internal.h" 23#include "internal.h"
24#include <stdio.h> 24#include <stdio.h>
25 25
26const char yes_usage[] =
27 "yes [OPTION]... [STRING]...\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nRepeatedly outputs a line with all specified STRING(s), or `y'.\n"
30#endif
31 ;
32
33extern int yes_main(int argc, char **argv) 26extern int yes_main(int argc, char **argv)
34{ 27{
35 int i; 28 int i;
diff --git a/cp_mv.c b/cp_mv.c
index 72ba537c5..4c3c7a32c 100644
--- a/cp_mv.c
+++ b/cp_mv.c
@@ -47,28 +47,6 @@
47#define is_mv 1 47#define is_mv 1
48static int dz_i; /* index into cp_mv_usage */ 48static int dz_i; /* index into cp_mv_usage */
49 49
50const char cp_usage[] =
51 "cp [OPTION]... SOURCE DEST\n"
52 " or: cp [OPTION]... SOURCE... DIRECTORY\n"
53#ifndef BB_FEATURE_TRIVIAL_HELP
54 "\nCopies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n"
55 "\n"
56 "\t-a\tSame as -dpR\n"
57 "\t-d\tPreserves links\n"
58 "\t-p\tPreserves file attributes if possible\n"
59 "\t-f\tforce (implied; ignored) - always set\n"
60 "\t-R\tCopies directories recursively\n"
61#endif
62 ;
63
64const char mv_usage[] =
65 "mv SOURCE DEST\n"
66 " or: mv SOURCE... DIRECTORY\n"
67#ifndef BB_FEATURE_TRIVIAL_HELP
68 "\nRename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n"
69#endif
70 ;
71
72static const char *cp_mv_usage[] = /* .rodata */ 50static const char *cp_mv_usage[] = /* .rodata */
73{ 51{
74 cp_usage, 52 cp_usage,
diff --git a/cut.c b/cut.c
index 08b4586a4..8b28fff7a 100644
--- a/cut.c
+++ b/cut.c
@@ -206,20 +206,6 @@ void cut()
206 } 206 }
207} 207}
208 208
209const char cut_usage[] =
210 "cut [OPTION]... [FILE]...\n"
211#ifndef BB_FEATURE_TRIVIAL_HELP
212 "\nPrints selected fields from each input FILE to standard output.\n\n"
213 "Options:\n"
214 "\t-b LIST\tOutput only bytes from LIST\n"
215 "\t-c LIST\tOutput only characters from LIST\n"
216 "\t-d CHAR\tUse CHAR instead of tab as the field delimiter\n"
217 "\t-s\tOnly output Lines if the include DELIM\n"
218 "\t-f N\tPrint only these fields\n"
219 "\t-n\tIgnored\n"
220#endif
221 ;
222
223int cut_main(int argc, char **argv) 209int cut_main(int argc, char **argv)
224{ 210{
225 int i = 1; 211 int i = 1;
diff --git a/date.c b/date.c
index 3ede1237c..b6fc6c686 100644
--- a/date.c
+++ b/date.c
@@ -39,17 +39,6 @@
39 an RFC 822 complient date output for shell scripting 39 an RFC 822 complient date output for shell scripting
40 mail commands */ 40 mail commands */
41 41
42static const char date_usage[] = "date [OPTION]... [+FORMAT]\n"
43 " or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]\n"
44#ifndef BB_FEATURE_TRIVIAL_HELP
45 "\nDisplays the current time in the given FORMAT, or sets the system date.\n"
46 "\nOptions:\n\t-R\tOutputs RFC-822 compliant date string\n"
47 "\t-s\tSets time described by STRING\n"
48 "\t-u\tPrints or sets Coordinated Universal Time\n"
49#endif
50 ;
51
52
53/* Input parsing code is always bulky - used heavy duty libc stuff as 42/* Input parsing code is always bulky - used heavy duty libc stuff as
54 much as possible, missed out a lot of bounds checking */ 43 much as possible, missed out a lot of bounds checking */
55 44
diff --git a/dc.c b/dc.c
index 7b13cb943..fac48e895 100644
--- a/dc.c
+++ b/dc.c
@@ -8,14 +8,6 @@
8 8
9/* Tiny RPN calculator, because "expr" didn't give me bitwise operations. */ 9/* Tiny RPN calculator, because "expr" didn't give me bitwise operations. */
10 10
11static const char dc_usage[] = "dc expression ...\n"
12#ifndef BB_FEATURE_TRIVIAL_HELP
13 "\nThis is a Tiny RPN calculator that understands the\n"
14 "following operations: +, -, /, *, and, or, not, eor.\n"
15 "i.e. 'dc 2 2 add' -> 4, and 'dc 8 8 \\* 2 2 + /' -> 16\n"
16#endif
17 ;
18
19static double stack[100]; 11static double stack[100];
20static unsigned int pointer; 12static unsigned int pointer;
21 13
diff --git a/dd.c b/dd.c
index 6261dfef5..86899194c 100644
--- a/dd.c
+++ b/dd.c
@@ -40,23 +40,6 @@
40typedef unsigned long long int uintmax_t; 40typedef unsigned long long int uintmax_t;
41#endif 41#endif
42 42
43static const char dd_usage[] =
44 "dd [if=FILE] [of=FILE] [bs=N] [count=N] [skip=N] [seek=N]\n"
45#ifndef BB_FEATURE_TRIVIAL_HELP
46 "\nCopy a file, converting and formatting according to options\n\n"
47 "\tif=FILE\tread from FILE instead of stdin\n"
48 "\tof=FILE\twrite to FILE instead of stdout\n"
49 "\tbs=N\tread and write N bytes at a time\n"
50 "\tcount=N\tcopy only N input blocks\n"
51 "\tskip=N\tskip N input blocks\n"
52 "\tseek=N\tskip N output blocks\n"
53 "\n"
54 "Numbers may be suffixed by w (x2), k (x1024), b (x512), or M (x1024^2)\n"
55#endif
56 ;
57
58
59
60extern int dd_main(int argc, char **argv) 43extern int dd_main(int argc, char **argv)
61{ 44{
62 char *inFile = NULL; 45 char *inFile = NULL;
diff --git a/deallocvt.c b/deallocvt.c
index 042de8649..9c477d238 100644
--- a/deallocvt.c
+++ b/deallocvt.c
@@ -13,13 +13,6 @@
13/* From <linux/vt.h> */ 13/* From <linux/vt.h> */
14#define VT_DISALLOCATE 0x5608 /* free memory associated to vt */ 14#define VT_DISALLOCATE 0x5608 /* free memory associated to vt */
15 15
16const char deallocvt_usage[] =
17 "deallocvt N\n"
18#ifndef BB_FEATURE_TRIVIAL_HELP
19 "\nDeallocate unused virtual terminal /dev/ttyN\n"
20#endif
21 ;
22
23int deallocvt_main(int argc, char *argv[]) 16int deallocvt_main(int argc, char *argv[])
24{ 17{
25 int fd, num, i; 18 int fd, num, i;
diff --git a/df.c b/df.c
index 62226ceb8..714c79965 100644
--- a/df.c
+++ b/df.c
@@ -28,12 +28,6 @@
28#include <sys/stat.h> 28#include <sys/stat.h>
29#include <sys/vfs.h> 29#include <sys/vfs.h>
30 30
31static const char df_usage[] = "df [filesystem ...]\n"
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\nPrint the filesystem space used and space available.\n"
34#endif
35 ;
36
37extern const char mtab_file[]; /* Defined in utility.c */ 31extern const char mtab_file[]; /* Defined in utility.c */
38 32
39static int df(char *device, const char *mountPoint) 33static int df(char *device, const char *mountPoint)
diff --git a/dirname.c b/dirname.c
index 0b60ceb88..e63fef30b 100644
--- a/dirname.c
+++ b/dirname.c
@@ -23,13 +23,6 @@
23#include "internal.h" 23#include "internal.h"
24#include <stdio.h> 24#include <stdio.h>
25 25
26const char dirname_usage[] =
27 "dirname [FILENAME ...]\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nStrips non-directory suffix from FILENAME\n"
30#endif
31 ;
32
33extern int dirname_main(int argc, char **argv) 26extern int dirname_main(int argc, char **argv)
34{ 27{
35 char* s; 28 char* s;
diff --git a/dmesg.c b/dmesg.c
index 961e532b0..a8c61c7b4 100644
--- a/dmesg.c
+++ b/dmesg.c
@@ -32,16 +32,6 @@ static inline _syscall3(int, klogctl, int, type, char *, b, int, len);
32# include <sys/klog.h> 32# include <sys/klog.h>
33#endif 33#endif
34 34
35static const char dmesg_usage[] = "dmesg [-c] [-n LEVEL] [-s SIZE]\n"
36#ifndef BB_FEATURE_TRIVIAL_HELP
37 "\nPrints or controls the kernel ring buffer\n\n"
38 "Options:\n"
39 "\t-c\t\tClears the ring buffer's contents after printing\n"
40 "\t-n LEVEL\tSets console logging level\n"
41 "\t-s SIZE\t\tUse a buffer of size SIZE\n"
42#endif
43 ;
44
45int dmesg_main(int argc, char **argv) 35int dmesg_main(int argc, char **argv)
46{ 36{
47 char *buf, c; 37 char *buf, c;
diff --git a/du.c b/du.c
index f1a44427a..147914c9e 100644
--- a/du.c
+++ b/du.c
@@ -35,17 +35,6 @@
35 35
36typedef void (Display) (long, char *); 36typedef void (Display) (long, char *);
37 37
38static const char du_usage[] =
39 "du [OPTION]... [FILE]...\n"
40#ifndef BB_FEATURE_TRIVIAL_HELP
41 "\nSummarizes disk space used for each FILE and/or directory.\n"
42 "Disk space is printed in units of 1024 bytes.\n\n"
43 "Options:\n"
44 "\t-l\tcount sizes many times if hard linked\n"
45 "\t-s\tdisplay only a total for each argument\n"
46#endif
47 ;
48
49static int du_depth = 0; 38static int du_depth = 0;
50static int count_hardlinks = 0; 39static int count_hardlinks = 0;
51 40
@@ -174,7 +163,7 @@ int du_main(int argc, char **argv)
174 return(0); 163 return(0);
175} 164}
176 165
177/* $Id: du.c,v 1.22 2000/07/14 18:38:26 andersen Exp $ */ 166/* $Id: du.c,v 1.23 2000/07/16 20:57:15 kraai Exp $ */
178/* 167/*
179Local Variables: 168Local Variables:
180c-file-style: "linux" 169c-file-style: "linux"
diff --git a/dumpkmap.c b/dumpkmap.c
index f18050529..4ce6e8698 100644
--- a/dumpkmap.c
+++ b/dumpkmap.c
@@ -38,14 +38,6 @@ struct kbentry {
38#define NR_KEYS 128 38#define NR_KEYS 128
39#define MAX_NR_KEYMAPS 256 39#define MAX_NR_KEYMAPS 256
40 40
41
42static const char dumpkmap_usage[] = "dumpkmap\n"
43#ifndef BB_FEATURE_TRIVIAL_HELP
44 "\nPrints out a binary keyboard translation table to standard input.\n"
45#endif
46 ;
47
48
49int dumpkmap_main(int argc, char **argv) 41int dumpkmap_main(int argc, char **argv)
50{ 42{
51 struct kbentry ke; 43 struct kbentry ke;
diff --git a/dutmp.c b/dutmp.c
index c6bc0c794..047b8805f 100644
--- a/dutmp.c
+++ b/dutmp.c
@@ -23,14 +23,6 @@
23#include "messages.c" 23#include "messages.c"
24#include <utmp.h> 24#include <utmp.h>
25 25
26
27static const char dutmp_usage[] = "dutmp [FILE]\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nDump utmp file format (pipe delimited) from FILE\n"
30 "or stdin to stdout. (i.e. 'dutmp /var/run/utmp')\n"
31#endif
32 ;
33
34extern int dutmp_main(int argc, char **argv) 26extern int dutmp_main(int argc, char **argv)
35{ 27{
36 28
diff --git a/echo.c b/echo.c
index 387ea3fef..73be8f2e2 100644
--- a/echo.c
+++ b/echo.c
@@ -25,17 +25,6 @@
25#include "internal.h" 25#include "internal.h"
26#include <stdio.h> 26#include <stdio.h>
27 27
28static const char uname_usage[] =
29 "echo [-neE] [ARG ...]\n"
30#ifndef BB_FEATURE_TRIVIAL_HELP
31 "\nPrints the specified ARGs to stdout\n\n"
32 "Options:\n"
33 "\t-n\tsuppress trailing newline\n"
34 "\t-e\tinterpret backslash-escaped characters (i.e. \\t=tab etc)\n"
35 "\t-E\tdisable interpretation of backslash-escaped characters\n"
36#endif
37 ;
38
39extern int 28extern int
40echo_main(int argc, char** argv) 29echo_main(int argc, char** argv)
41{ 30{
@@ -58,7 +47,7 @@ echo_main(int argc, char** argv)
58 eflag = 0; 47 eflag = 0;
59 break; 48 break;
60 default: 49 default:
61 usage(uname_usage); 50 usage(echo_usage);
62 } 51 }
63 } 52 }
64 53
diff --git a/editors/sed.c b/editors/sed.c
index 1f1e9069c..4d4886e19 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -85,22 +85,6 @@ static int ncmds = 0; /* number of sed commands */
85 85
86/*static char *cur_file = NULL;*/ /* file currently being processed XXX: do I need this? */ 86/*static char *cur_file = NULL;*/ /* file currently being processed XXX: do I need this? */
87 87
88static const char sed_usage[] =
89 "sed [-Vhnef] pattern [files...]\n"
90#ifndef BB_FEATURE_TRIVIAL_HELP
91 "\n"
92 "-n\tsuppress automatic printing of pattern space\n"
93 "-e script\tadd the script to the commands to be executed\n"
94 "-f scriptfile\tadd the contents of script-file to the commands to be executed\n"
95 "-h\tdisplay this help message\n"
96 "-V\toutput version information and exit\n"
97 "\n"
98 "If no -e or -f is given, the first non-option argument is taken as the\n"
99 "sed script to interpret. All remaining arguments are names of input\n"
100 "files; if no input files are specified, then the standard input is read.\n"
101#endif
102 ;
103
104#if 0 88#if 0
105static void destroy_cmd_strs() 89static void destroy_cmd_strs()
106{ 90{
diff --git a/fdflush.c b/fdflush.c
index d9937355f..6bc3e7d66 100644
--- a/fdflush.c
+++ b/fdflush.c
@@ -34,13 +34,8 @@ extern int fdflush_main(int argc, char **argv)
34 int value; 34 int value;
35 int fd; 35 int fd;
36 36
37 if (argc <= 1 || **(++argv) == '-') { 37 if (argc <= 1 || **(++argv) == '-')
38 usage("fdflush DEVICE\n" 38 usage(fdflush_usage);
39#ifndef BB_FEATURE_TRIVIAL_HELP
40 "\nForces floppy disk drive to detect disk change\n"
41#endif
42 );
43 }
44 39
45 fd = open(*argv, 0); 40 fd = open(*argv, 0);
46 if (fd < 0) { 41 if (fd < 0) {
diff --git a/find.c b/find.c
index e18f3c569..1c209aea1 100644
--- a/find.c
+++ b/find.c
@@ -32,18 +32,6 @@ static char *pattern = NULL;
32static char *directory = "."; 32static char *directory = ".";
33static int dereferenceFlag = FALSE; 33static int dereferenceFlag = FALSE;
34 34
35static const char find_usage[] = "find [PATH...] [EXPRESSION]\n"
36#ifndef BB_FEATURE_TRIVIAL_HELP
37 "\nSearch for files in a directory hierarchy. The default PATH is\n"
38 "the current directory; default EXPRESSION is '-print'\n\n"
39 "\nEXPRESSION may consist of:\n"
40 "\t-follow\t\tDereference symbolic links.\n"
41 "\t-name PATTERN\tFile name (leading directories removed) matches PATTERN.\n"
42 "\t-print\t\tprint the full file name followed by a newline to stdout.\n"
43#endif
44 ;
45
46
47static int fileAction(const char *fileName, struct stat *statbuf, void* junk) 35static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
48{ 36{
49 if (pattern == NULL) 37 if (pattern == NULL)
diff --git a/findutils/find.c b/findutils/find.c
index e18f3c569..1c209aea1 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -32,18 +32,6 @@ static char *pattern = NULL;
32static char *directory = "."; 32static char *directory = ".";
33static int dereferenceFlag = FALSE; 33static int dereferenceFlag = FALSE;
34 34
35static const char find_usage[] = "find [PATH...] [EXPRESSION]\n"
36#ifndef BB_FEATURE_TRIVIAL_HELP
37 "\nSearch for files in a directory hierarchy. The default PATH is\n"
38 "the current directory; default EXPRESSION is '-print'\n\n"
39 "\nEXPRESSION may consist of:\n"
40 "\t-follow\t\tDereference symbolic links.\n"
41 "\t-name PATTERN\tFile name (leading directories removed) matches PATTERN.\n"
42 "\t-print\t\tprint the full file name followed by a newline to stdout.\n"
43#endif
44 ;
45
46
47static int fileAction(const char *fileName, struct stat *statbuf, void* junk) 35static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
48{ 36{
49 if (pattern == NULL) 37 if (pattern == NULL)
diff --git a/findutils/grep.c b/findutils/grep.c
index 03945fa25..a2c07c523 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -31,21 +31,6 @@
31extern int optind; /* in unistd.h */ 31extern int optind; /* in unistd.h */
32extern int errno; /* for use with strerror() */ 32extern int errno; /* for use with strerror() */
33 33
34static const char grep_usage[] =
35 "grep [-ihHnqvs] pattern [files...]\n"
36#ifndef BB_FEATURE_TRIVIAL_HELP
37 "\nSearch for PATTERN in each FILE or standard input.\n\n"
38 "Options:\n"
39 "\t-H\tprefix output lines with filename where match was found\n"
40 "\t-h\tsuppress the prefixing filename on output\n"
41 "\t-i\tignore case distinctions\n"
42 "\t-n\tprint line number with output lines\n"
43 "\t-q\tbe quiet. Returns 0 if result was found, 1 otherwise\n"
44 "\t-v\tselect non-matching lines\n"
45 "\t-s\tsuppress file open/read error messages\n\n"
46#endif
47 ;
48
49/* options */ 34/* options */
50static int ignore_case = 0; 35static int ignore_case = 0;
51static int print_filename = 0; 36static int print_filename = 0;
diff --git a/findutils/which.c b/findutils/which.c
index 186bfdad7..943e10a57 100644
--- a/findutils/which.c
+++ b/findutils/which.c
@@ -26,13 +26,6 @@
26#include <sys/stat.h> 26#include <sys/stat.h>
27#include <sys/param.h> 27#include <sys/param.h>
28 28
29const char which_usage[] =
30 "which [COMMAND ...]\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nLocates a COMMAND.\n"
33#endif
34 ;
35
36extern int which_main(int argc, char **argv) 29extern int which_main(int argc, char **argv)
37{ 30{
38 char *path_list, *test, *tmp, *path_parsed; 31 char *path_list, *test, *tmp, *path_parsed;
diff --git a/free.c b/free.c
index 7c9d7f10a..78298cfb6 100644
--- a/free.c
+++ b/free.c
@@ -25,13 +25,6 @@
25#include <stdio.h> 25#include <stdio.h>
26#include <errno.h> 26#include <errno.h>
27 27
28const char free_usage[] =
29 "free\n"
30#ifndef BB_FEATURE_TRIVIAL_HELP
31 "\nDisplays the amount of free and used system memory\n"
32#endif
33 ;
34
35extern int free_main(int argc, char **argv) 28extern int free_main(int argc, char **argv)
36{ 29{
37 struct sysinfo info; 30 struct sysinfo info;
diff --git a/freeramdisk.c b/freeramdisk.c
index 927c16946..2da2427c1 100644
--- a/freeramdisk.c
+++ b/freeramdisk.c
@@ -34,14 +34,6 @@
34/* From linux/fs.h */ 34/* From linux/fs.h */
35#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */ 35#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
36 36
37
38static const char freeramdisk_usage[] =
39 "freeramdisk DEVICE\n"
40#ifndef BB_FEATURE_TRIVIAL_HELP
41 "\nFrees all memory used by the specified ramdisk.\n"
42#endif
43 ;
44
45extern int 37extern int
46freeramdisk_main(int argc, char **argv) 38freeramdisk_main(int argc, char **argv)
47{ 39{
diff --git a/fsck_minix.c b/fsck_minix.c
index ea27c236c..5807b9af5 100644
--- a/fsck_minix.c
+++ b/fsck_minix.c
@@ -288,21 +288,6 @@ static void leave(int status)
288 exit(status); 288 exit(status);
289} 289}
290 290
291const char fsck_minix_usage[] =
292 "Usage: fsck.minix [-larvsmf] /dev/name\n"
293#ifndef BB_FEATURE_TRIVIAL_HELP
294 "\nPerforms a consistency check for MINIX filesystems.\n\n"
295 "Options:\n"
296 "\t-l\tLists all filenames\n"
297 "\t-r\tPerform interactive repairs\n"
298 "\t-a\tPerform automatic repairs\n"
299 "\t-v\tverbose\n"
300 "\t-s\tOutputs super-block information\n"
301 "\t-m\tActivates MINIX-like \"mode not cleared\" warnings\n"
302 "\t-f\tForce file system check.\n\n"
303#endif
304 ;
305
306static void show_usage(void) 291static void show_usage(void)
307{ 292{
308 usage(fsck_minix_usage); 293 usage(fsck_minix_usage);
diff --git a/grep.c b/grep.c
index 03945fa25..a2c07c523 100644
--- a/grep.c
+++ b/grep.c
@@ -31,21 +31,6 @@
31extern int optind; /* in unistd.h */ 31extern int optind; /* in unistd.h */
32extern int errno; /* for use with strerror() */ 32extern int errno; /* for use with strerror() */
33 33
34static const char grep_usage[] =
35 "grep [-ihHnqvs] pattern [files...]\n"
36#ifndef BB_FEATURE_TRIVIAL_HELP
37 "\nSearch for PATTERN in each FILE or standard input.\n\n"
38 "Options:\n"
39 "\t-H\tprefix output lines with filename where match was found\n"
40 "\t-h\tsuppress the prefixing filename on output\n"
41 "\t-i\tignore case distinctions\n"
42 "\t-n\tprint line number with output lines\n"
43 "\t-q\tbe quiet. Returns 0 if result was found, 1 otherwise\n"
44 "\t-v\tselect non-matching lines\n"
45 "\t-s\tsuppress file open/read error messages\n\n"
46#endif
47 ;
48
49/* options */ 34/* options */
50static int ignore_case = 0; 35static int ignore_case = 0;
51static int print_filename = 0; 36static int print_filename = 0;
diff --git a/gunzip.c b/gunzip.c
index de68bd19b..b29bdf7c1 100644
--- a/gunzip.c
+++ b/gunzip.c
@@ -30,19 +30,7 @@
30#include "internal.h" 30#include "internal.h"
31#include <getopt.h> 31#include <getopt.h>
32 32
33static const char gunzip_usage[] = 33/* These defines are very important for BusyBox. Without these,
34 "gunzip [OPTION]... FILE\n"
35#ifndef BB_FEATURE_TRIVIAL_HELP
36 "\nUncompress FILE (or standard input if FILE is '-').\n\n"
37 "Options:\n"
38
39 "\t-c\tWrite output to standard output\n"
40 "\t-t\tTest compressed file integrity\n"
41#endif
42 ;
43
44
45 /* These defines are very important for BusyBox. Without these,
46 * huge chunks of ram are pre-allocated making the BusyBox bss 34 * huge chunks of ram are pre-allocated making the BusyBox bss
47 * size Freaking Huge(tm), which is a bad thing.*/ 35 * size Freaking Huge(tm), which is a bad thing.*/
48#define SMALL_MEM 36#define SMALL_MEM
diff --git a/gzip.c b/gzip.c
index 8bc67d9c6..98ce259ca 100644
--- a/gzip.c
+++ b/gzip.c
@@ -40,19 +40,6 @@
40#define SMALL_MEM 40#define SMALL_MEM
41#define DYN_ALLOC 41#define DYN_ALLOC
42 42
43
44static const char gzip_usage[] =
45 "gzip [OPTION]... FILE\n"
46#ifndef BB_FEATURE_TRIVIAL_HELP
47 "\nCompress FILE with maximum compression.\n"
48 "When FILE is '-', reads standard input. Implies -c.\n\n"
49
50 "Options:\n"
51 "\t-c\tWrite output to standard output instead of FILE.gz\n"
52#endif
53 ;
54
55
56/* I don't like nested includes, but the string and io functions are used 43/* I don't like nested includes, but the string and io functions are used
57 * too often 44 * too often
58 */ 45 */
diff --git a/head.c b/head.c
index b82678dc2..58b3cae68 100644
--- a/head.c
+++ b/head.c
@@ -26,17 +26,6 @@
26#include <errno.h> 26#include <errno.h>
27#include <stdio.h> 27#include <stdio.h>
28 28
29const char head_usage[] =
30 "head [OPTION] [FILE]...\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nPrint first 10 lines of each FILE to standard output.\n"
33 "With more than one FILE, precede each with a header giving the\n"
34 "file name. With no FILE, or when FILE is -, read standard input.\n\n"
35
36 "Options:\n" "\t-n NUM\t\tPrint first NUM lines instead of first 10\n"
37#endif
38 ;
39
40int head(int len, FILE * src) 29int head(int len, FILE * src)
41{ 30{
42 int i; 31 int i;
@@ -111,4 +100,4 @@ int head_main(int argc, char **argv)
111 return(0); 100 return(0);
112} 101}
113 102
114/* $Id: head.c,v 1.12 2000/07/14 01:51:25 kraai Exp $ */ 103/* $Id: head.c,v 1.13 2000/07/16 20:57:15 kraai Exp $ */
diff --git a/hostname.c b/hostname.c
index 60f66c073..77b545ded 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.11 2000/07/14 01:51:25 kraai Exp $ 3 * $Id: hostname.c,v 1.12 2000/07/16 20:57:15 kraai 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>
@@ -30,21 +30,6 @@
30#include <unistd.h> 30#include <unistd.h>
31#include <stdio.h> 31#include <stdio.h>
32 32
33static const char *hostname_usage =
34 "hostname [OPTION] {hostname | -F file}\n"
35#ifndef BB_FEATURE_TRIVIAL_HELP
36 "\nGet or set the hostname or DNS domain name. If a hostname is given\n"
37 "(or a file with the -F parameter), the host name will be set.\n\n"
38 "Options:\n"
39 "\t-s\t\tShort\n"
40
41 "\t-i\t\tAddresses for the hostname\n"
42 "\t-d\t\tDNS domain name\n"
43 "\t-F FILE\t\tUse the contents of FILE to specify the hostname\n"
44#endif
45 ;
46
47
48void do_sethostname(char *s, int isfile) 33void do_sethostname(char *s, int isfile)
49{ 34{
50 FILE *f; 35 FILE *f;
diff --git a/id.c b/id.c
index 69dfe2658..56a2e279f 100644
--- a/id.c
+++ b/id.c
@@ -28,17 +28,6 @@
28#include <grp.h> 28#include <grp.h>
29#include <sys/types.h> 29#include <sys/types.h>
30 30
31static const char id_usage[] =
32 "id [OPTIONS]... [USERNAME]\n"
33#ifndef BB_FEATURE_TRIVIAL_HELP
34 "\nPrint information for USERNAME or the current user\n\n"
35 "Options:\n"
36 "\t-g\tprints only the group ID\n"
37 "\t-u\tprints only the user ID\n"
38 "\t-r\tprints the real user ID instead of the effective ID (with -ug)\n\n"
39#endif
40 ;
41
42extern int id_main(int argc, char **argv) 31extern int id_main(int argc, char **argv)
43{ 32{
44 int no_user = 0, no_group = 0, print_real = 0; 33 int no_user = 0, no_group = 0, print_real = 0;
diff --git a/insmod.c b/insmod.c
index 97c360be7..9daedf938 100644
--- a/insmod.c
+++ b/insmod.c
@@ -70,7 +70,7 @@
70#ifndef MODUTILS_MODULE_H 70#ifndef MODUTILS_MODULE_H
71#define MODUTILS_MODULE_H 1 71#define MODUTILS_MODULE_H 1
72 72
73#ident "$Id: insmod.c,v 1.17 2000/07/14 16:23:32 proski Exp $" 73#ident "$Id: insmod.c,v 1.18 2000/07/16 20:57:15 kraai Exp $"
74 74
75/* This file contains the structures used by the 2.0 and 2.1 kernels. 75/* This file contains the structures used by the 2.0 and 2.1 kernels.
76 We do not use the kernel headers directly because we do not wish 76 We do not use the kernel headers directly because we do not wish
@@ -276,7 +276,7 @@ int delete_module(const char *);
276#ifndef MODUTILS_OBJ_H 276#ifndef MODUTILS_OBJ_H
277#define MODUTILS_OBJ_H 1 277#define MODUTILS_OBJ_H 1
278 278
279#ident "$Id: insmod.c,v 1.17 2000/07/14 16:23:32 proski Exp $" 279#ident "$Id: insmod.c,v 1.18 2000/07/16 20:57:15 kraai Exp $"
280 280
281/* The relocatable object is manipulated using elfin types. */ 281/* The relocatable object is manipulated using elfin types. */
282 282
@@ -560,16 +560,6 @@ _syscall2(unsigned long, create_module, const char *, name, size_t, size)
560#endif 560#endif
561static char m_filename[BUFSIZ + 1] = "\0"; 561static char m_filename[BUFSIZ + 1] = "\0";
562static char m_fullName[BUFSIZ + 1] = "\0"; 562static char m_fullName[BUFSIZ + 1] = "\0";
563static const char insmod_usage[] =
564 "insmod [OPTION]... MODULE [symbol=value]...\n"
565#ifndef BB_FEATURE_TRIVIAL_HELP
566 "\nLoads the specified kernel modules into the kernel.\n\n"
567 "Options:\n"
568 "\t-f\tForce module to load into the wrong kernel version.\n"
569 "\t-k\tMake module autoclean-able.\n"
570 "\t-v\tverbose output\n" "\t-x\tdo not export externs\n"
571#endif
572;
573 563
574/*======================================================================*/ 564/*======================================================================*/
575 565
diff --git a/internal.h b/internal.h
index 50b7869cd..a192679b9 100644
--- a/internal.h
+++ b/internal.h
@@ -208,6 +208,98 @@ extern int which_main(int argc, char** argv);
208extern int whoami_main(int argc, char** argv); 208extern int whoami_main(int argc, char** argv);
209extern int yes_main(int argc, char** argv); 209extern int yes_main(int argc, char** argv);
210 210
211extern const char ar_usage[];
212extern const char basename_usage[];
213extern const char cat_usage[];
214extern const char chgrp_usage[];
215extern const char chmod_usage[];
216extern const char chown_usage[];
217extern const char chroot_usage[];
218extern const char chvt_usage[];
219extern const char cp_usage[];
220extern const char cut_usage[];
221extern const char date_usage[];
222extern const char dc_usage[];
223extern const char dd_usage[];
224extern const char deallocvt_usage[];
225extern const char df_usage[];
226extern const char dirname_usage[];
227extern const char dmesg_usage[];
228extern const char du_usage[];
229extern const char dumpkmap_usage[];
230extern const char dutmp_usage[];
231extern const char echo_usage[];
232extern const char fdflush_usage[];
233extern const char find_usage[];
234extern const char free_usage[];
235extern const char freeramdisk_usage[];
236extern const char fsck_minix_usage[];
237extern const char grep_usage[];
238extern const char gunzip_usage[];
239extern const char gzip_usage[];
240extern const char head_usage[];
241extern const char hostname_usage[];
242extern const char id_usage[];
243extern const char insmod_usage[];
244extern const char kill_usage[];
245extern const char killall_usage[];
246extern const char length_usage[];
247extern const char ln_usage[];
248extern const char loadacm_usage[];
249extern const char loadfont_usage[];
250extern const char loadkmap_usage[];
251extern const char logger_usage[];
252extern const char logname_usage[];
253extern const char ls_usage[];
254extern const char makedevs_usage[];
255extern const char md5sum_usage[];
256extern const char mkdir_usage[];
257extern const char mkfifo_usage[];
258extern const char mkfs_minix_usage[];
259extern const char mknod_usage[];
260extern const char mkswap_usage[];
261extern const char mktemp_usage[];
262extern const char more_usage[];
263extern const char mount_usage[];
264extern const char mt_usage[];
265extern const char mv_usage[];
266extern const char nc_usage[];
267extern const char nslookup_usage[];
268extern const char ping_usage[];
269extern const char printf_usage[];
270extern const char ps_usage[];
271extern const char rm_usage[];
272extern const char rmdir_usage[];
273extern const char rmmod_usage[];
274extern const char sed_usage[];
275extern const char setkeycodes_usage[];
276extern const char shell_usage[];
277extern const char sleep_usage[];
278extern const char sort_usage[];
279extern const char swapoff_usage[];
280extern const char swapon_usage[];
281extern const char sync_usage[];
282extern const char syslogd_usage[];
283extern const char tail_usage[];
284extern const char tar_usage[];
285extern const char tee_usage[];
286extern const char telnet_usage[];
287extern const char test_usage[];
288extern const char touch_usage[];
289extern const char tr_usage[];
290extern const char tty_usage[];
291extern const char umount_usage[];
292extern const char uname_usage[];
293extern const char uniq_usage[];
294extern const char update_usage[];
295extern const char usleep_usage[];
296extern const char uudecode_usage[];
297extern const char uuencode_usage[];
298extern const char wc_usage[];
299extern const char which_usage[];
300extern const char whoami_usage[];
301extern const char yes_usage[];
302
211extern char *applet_name; 303extern char *applet_name;
212 304
213extern void usage(const char *usage) __attribute__ ((noreturn)); 305extern void usage(const char *usage) __attribute__ ((noreturn));
diff --git a/kill.c b/kill.c
index 44cb38395..da46620dd 100644
--- a/kill.c
+++ b/kill.c
@@ -31,24 +31,6 @@
31#include <sys/stat.h> 31#include <sys/stat.h>
32#include <unistd.h> 32#include <unistd.h>
33 33
34static const char *kill_usage =
35 "kill [-signal] process-id [process-id ...]\n"
36#ifndef BB_FEATURE_TRIVIAL_HELP
37 "\nSend a signal (default is SIGTERM) to the specified process(es).\n\n"
38 "Options:\n" "\t-l\tList all signal names and numbers.\n\n"
39#endif
40 ;
41
42#ifdef BB_KILLALL
43static const char *killall_usage =
44 "killall [-signal] process-name [process-name ...]\n"
45#ifndef BB_FEATURE_TRIVIAL_HELP
46 "\nSend a signal (default is SIGTERM) to the specified process(es).\n\n"
47 "Options:\n" "\t-l\tList all signal names and numbers.\n\n"
48#endif
49#endif
50 ;
51
52#define KILL 0 34#define KILL 0
53#define KILLALL 1 35#define KILLALL 1
54 36
diff --git a/lash.c b/lash.c
index d829b6b29..9b3435304 100644
--- a/lash.c
+++ b/lash.c
@@ -137,14 +137,6 @@ static struct builtInCommand bltins_forking[] = {
137 {NULL, NULL, NULL, NULL} 137 {NULL, NULL, NULL, NULL}
138}; 138};
139 139
140static const char shell_usage[] =
141 "sh [FILE]...\n"
142 " or: sh -c command [args]...\n"
143#ifndef BB_FEATURE_TRIVIAL_HELP
144 "\nlash: The BusyBox command interpreter (shell).\n\n"
145#endif
146 ;
147
148static char *prompt = "# "; 140static char *prompt = "# ";
149static char *cwd = NULL; 141static char *cwd = NULL;
150static char *local_pending_command = NULL; 142static char *local_pending_command = NULL;
diff --git a/length.c b/length.c
index 82f50c159..cf4fb1c07 100644
--- a/length.c
+++ b/length.c
@@ -4,13 +4,6 @@
4#include <string.h> 4#include <string.h>
5#include <stdio.h> 5#include <stdio.h>
6 6
7const char length_usage[] =
8 "length STRING\n"
9#ifndef BB_FEATURE_TRIVIAL_HELP
10 "\nPrints out the length of the specified STRING.\n"
11#endif
12 ;
13
14extern int length_main(int argc, char **argv) 7extern int length_main(int argc, char **argv)
15{ 8{
16 if (argc != 2 || **(argv + 1) == '-') 9 if (argc != 2 || **(argv + 1) == '-')
diff --git a/ln.c b/ln.c
index 9f7774380..8b8fa1c58 100644
--- a/ln.c
+++ b/ln.c
@@ -30,19 +30,6 @@
30#include <dirent.h> 30#include <dirent.h>
31#include <errno.h> 31#include <errno.h>
32 32
33static const char ln_usage[] =
34 "ln [OPTION] TARGET... LINK_NAME|DIRECTORY\n"
35#ifndef BB_FEATURE_TRIVIAL_HELP
36 "\nCreate a link named LINK_NAME or DIRECTORY to the specified TARGET\n"
37 "\nYou may use '--' to indicate that all following arguments are non-options.\n\n"
38 "Options:\n"
39 "\t-s\tmake symbolic links instead of hard links\n"
40
41 "\t-f\tremove existing destination files\n"
42 "\t-n\tno dereference symlinks - treat like normal file\n"
43#endif
44 ;
45
46static int symlinkFlag = FALSE; 33static int symlinkFlag = FALSE;
47static int removeoldFlag = FALSE; 34static int removeoldFlag = FALSE;
48static int followLinks = TRUE; 35static int followLinks = TRUE;
diff --git a/loadacm.c b/loadacm.c
index 9eebf3bb5..2d70ffc5d 100644
--- a/loadacm.c
+++ b/loadacm.c
@@ -22,12 +22,6 @@
22#include <sys/ioctl.h> 22#include <sys/ioctl.h>
23#include <sys/kd.h> 23#include <sys/kd.h>
24 24
25static const char loadacm_usage[] = "loadacm\n"
26#ifndef BB_FEATURE_TRIVIAL_HELP
27 "\nLoads an acm from standard input.\n"
28#endif
29 ;
30
31typedef unsigned short unicode; 25typedef unsigned short unicode;
32 26
33static long int ctoi(unsigned char *s, int *is_unicode); 27static long int ctoi(unsigned char *s, int *is_unicode);
diff --git a/loadfont.c b/loadfont.c
index 46a7574c0..622142925 100644
--- a/loadfont.c
+++ b/loadfont.c
@@ -30,12 +30,6 @@
30#define PSF_MAXMODE 0x03 30#define PSF_MAXMODE 0x03
31#define PSF_SEPARATOR 0xFFFF 31#define PSF_SEPARATOR 0xFFFF
32 32
33static const char loadfont_usage[] = "loadfont\n"
34#ifndef BB_FEATURE_TRIVIAL_HELP
35 "Loads a console font from standard input.\n"
36#endif
37 ;
38
39struct psf_header { 33struct psf_header {
40 unsigned char magic1, magic2; /* Magic number */ 34 unsigned char magic1, magic2; /* Magic number */
41 unsigned char mode; /* PSF font mode */ 35 unsigned char mode; /* PSF font mode */
diff --git a/loadkmap.c b/loadkmap.c
index 72247a6e4..488585f9c 100644
--- a/loadkmap.c
+++ b/loadkmap.c
@@ -38,14 +38,6 @@ struct kbentry {
38#define NR_KEYS 128 38#define NR_KEYS 128
39#define MAX_NR_KEYMAPS 256 39#define MAX_NR_KEYMAPS 256
40 40
41
42static const char loadkmap_usage[] = "loadkmap\n"
43#ifndef BB_FEATURE_TRIVIAL_HELP
44 "\nLoads a binary keyboard translation table from standard input.\n"
45#endif
46 ;
47
48
49int loadkmap_main(int argc, char **argv) 41int loadkmap_main(int argc, char **argv)
50{ 42{
51 struct kbentry ke; 43 struct kbentry ke;
diff --git a/logger.c b/logger.c
index 981748bb5..0e1ce8dce 100644
--- a/logger.c
+++ b/logger.c
@@ -47,20 +47,6 @@ extern CODE prioritynames[];
47extern CODE facilitynames[]; 47extern CODE facilitynames[];
48#endif 48#endif
49 49
50static const char logger_usage[] =
51 "logger [OPTION]... [MESSAGE]\n"
52#ifndef BB_FEATURE_TRIVIAL_HELP
53 "\nWrite MESSAGE to the system log. If MESSAGE is '-', log stdin.\n\n"
54 "Options:\n"
55 "\t-s\tLog to stderr as well as the system log.\n"
56 "\t-t\tLog using the specified tag (defaults to user name).\n"
57
58 "\t-p\tEnter the message with the specified priority.\n"
59 "\t\tThis may be numerical or a ``facility.level'' pair.\n"
60#endif
61 ;
62
63
64/* Decode a symbolic name to a numeric value 50/* Decode a symbolic name to a numeric value
65 * this function is based on code 51 * this function is based on code
66 * Copyright (c) 1983, 1993 52 * Copyright (c) 1983, 1993
diff --git a/logname.c b/logname.c
index 12ebfbde6..a0aff42d6 100644
--- a/logname.c
+++ b/logname.c
@@ -23,12 +23,6 @@
23#include "internal.h" 23#include "internal.h"
24#include <stdio.h> 24#include <stdio.h>
25 25
26static const char logname_usage[] = "logname\n"
27#ifndef BB_FEATURE_TRIVIAL_HELP
28 "\nPrint the name of the current user.\n"
29#endif
30 ;
31
32extern int logname_main(int argc, char **argv) 26extern int logname_main(int argc, char **argv)
33{ 27{
34 char *user = xmalloc(9); 28 char *user = xmalloc(9);
diff --git a/ls.c b/ls.c
index 0644cde87..e56e3bcfb 100644
--- a/ls.c
+++ b/ls.c
@@ -427,63 +427,6 @@ static int list_item(const char *name)
427 return 1; 427 return 1;
428} 428}
429 429
430static const char ls_usage[] = "ls [-1a"
431#ifdef BB_FEATURE_LS_TIMESTAMPS
432 "c"
433#endif
434 "d"
435#ifdef BB_FEATURE_LS_TIMESTAMPS
436 "e"
437#endif
438 "ln"
439#ifdef BB_FEATURE_LS_FILETYPES
440 "p"
441#endif
442#ifdef BB_FEATURE_LS_TIMESTAMPS
443 "u"
444#endif
445 "xAC"
446#ifdef BB_FEATURE_LS_FILETYPES
447 "F"
448#endif
449#ifdef BB_FEATURE_LS_RECURSIVE
450 "R"
451#endif
452 "] [filenames...]\n"
453#ifndef BB_FEATURE_TRIVIAL_HELP
454 "\nList directory contents\n\n"
455 "Options:\n"
456 "\t-a\tdo not hide entries starting with .\n"
457#ifdef BB_FEATURE_LS_TIMESTAMPS
458 "\t-c\twith -l: show ctime (the time of last\n"
459 "\t\tmodification of file status information)\n"
460#endif
461 "\t-d\tlist directory entries instead of contents\n"
462#ifdef BB_FEATURE_LS_TIMESTAMPS
463 "\t-e\tlist both full date and full time\n"
464#endif
465 "\t-l\tuse a long listing format\n"
466 "\t-n\tlist numeric UIDs and GIDs instead of names\n"
467#ifdef BB_FEATURE_LS_FILETYPES
468 "\t-p\tappend indicator (one of /=@|) to entries\n"
469#endif
470#ifdef BB_FEATURE_LS_TIMESTAMPS
471 "\t-u\twith -l: show access time (the time of last\n"
472 "\t\taccess of the file)\n"
473#endif
474 "\t-x\tlist entries by lines instead of by columns\n"
475 "\t-A\tdo not list implied . and ..\n"
476 "\t-C\tlist entries by columns\n"
477#ifdef BB_FEATURE_LS_FILETYPES
478 "\t-F\tappend indicator (one of */=@|) to entries\n"
479#endif
480#ifdef BB_FEATURE_LS_RECURSIVE
481 "\t-R\tlist subdirectories recursively\n"
482#endif
483#endif
484 ;
485
486
487#ifdef BB_FEATURE_LS_RECURSIVE 430#ifdef BB_FEATURE_LS_RECURSIVE
488static int dirAction(const char *fileName, struct stat *statbuf, void* junk) 431static int dirAction(const char *fileName, struct stat *statbuf, void* junk)
489{ 432{
diff --git a/makedevs.c b/makedevs.c
index 5072095b5..99dbc0bd5 100644
--- a/makedevs.c
+++ b/makedevs.c
@@ -16,23 +16,6 @@
16#include <sys/types.h> 16#include <sys/types.h>
17#include <sys/stat.h> 17#include <sys/stat.h>
18 18
19static const char makedevs_usage[] =
20 "makedevs NAME TYPE MAJOR MINOR FIRST LAST [s]\n"
21#ifndef BB_FEATURE_TRIVIAL_HELP
22 "\nCreates a range of block or character special files\n\n"
23 "TYPEs include:\n"
24 "\tb:\tMake a block (buffered) device.\n"
25 "\tc or u:\tMake a character (un-buffered) device.\n"
26 "\tp:\tMake a named pipe. MAJOR and MINOR are ignored for named pipes.\n\n"
27 "FIRST specifies the number appended to NAME to create the first device.\n"
28 "LAST specifies the number of the last item that should be created.\n"
29 "If 's' is the last argument, the base device is created as well.\n\n"
30 "For example:\n"
31 "\tmakedevs /dev/ttyS c 4 66 2 63 -> ttyS2-ttyS63\n"
32 "\tmakedevs /dev/hda b 3 0 0 8 s -> hda,hda1-hda8\n"
33#endif
34 ;
35
36int makedevs_main(int argc, char **argv) 19int makedevs_main(int argc, char **argv)
37{ 20{
38 21
diff --git a/md5sum.c b/md5sum.c
index e6f1c86b4..fad563fe7 100644
--- a/md5sum.c
+++ b/md5sum.c
@@ -582,23 +582,6 @@ static int status_only = 0; /* With -c, don't generate any output.
582static int warn = 0; /* With -w, print a message to standard error warning 582static int warn = 0; /* With -w, print a message to standard error warning
583 about each improperly formatted MD5 checksum line */ 583 about each improperly formatted MD5 checksum line */
584 584
585static const char md5sum_usage[] =
586 "md5sum [OPTION] [FILE]...\n"
587 "or: md5sum [OPTION] -c [FILE]\n"
588#ifndef BB_FEATURE_TRIVIAL_HELP
589 "\nPrint or check MD5 checksums.\n\n"
590 "Options:\n"
591 "With no FILE, or when FILE is -, read standard input.\n\n"
592 "\t-b\tread files in binary mode\n"
593 "\t-c\tcheck MD5 sums against given list\n"
594 "\t-t\tread files in text mode (default)\n"
595 "\t-g\tread a string\n"
596 "\nThe following two options are useful only when verifying checksums:\n"
597 "\t-s,\tdon't output anything, status code shows success\n"
598 "\t-w,\twarn about improperly formated MD5 checksum lines\n"
599#endif
600;
601
602static int split_3(char *s, 585static int split_3(char *s,
603 size_t s_len, 586 size_t s_len,
604 unsigned char **u, 587 unsigned char **u,
diff --git a/miscutils/dc.c b/miscutils/dc.c
index 7b13cb943..fac48e895 100644
--- a/miscutils/dc.c
+++ b/miscutils/dc.c
@@ -8,14 +8,6 @@
8 8
9/* Tiny RPN calculator, because "expr" didn't give me bitwise operations. */ 9/* Tiny RPN calculator, because "expr" didn't give me bitwise operations. */
10 10
11static const char dc_usage[] = "dc expression ...\n"
12#ifndef BB_FEATURE_TRIVIAL_HELP
13 "\nThis is a Tiny RPN calculator that understands the\n"
14 "following operations: +, -, /, *, and, or, not, eor.\n"
15 "i.e. 'dc 2 2 add' -> 4, and 'dc 8 8 \\* 2 2 + /' -> 16\n"
16#endif
17 ;
18
19static double stack[100]; 11static double stack[100];
20static unsigned int pointer; 12static unsigned int pointer;
21 13
diff --git a/miscutils/dutmp.c b/miscutils/dutmp.c
index c6bc0c794..047b8805f 100644
--- a/miscutils/dutmp.c
+++ b/miscutils/dutmp.c
@@ -23,14 +23,6 @@
23#include "messages.c" 23#include "messages.c"
24#include <utmp.h> 24#include <utmp.h>
25 25
26
27static const char dutmp_usage[] = "dutmp [FILE]\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nDump utmp file format (pipe delimited) from FILE\n"
30 "or stdin to stdout. (i.e. 'dutmp /var/run/utmp')\n"
31#endif
32 ;
33
34extern int dutmp_main(int argc, char **argv) 26extern int dutmp_main(int argc, char **argv)
35{ 27{
36 28
diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c
index 5072095b5..99dbc0bd5 100644
--- a/miscutils/makedevs.c
+++ b/miscutils/makedevs.c
@@ -16,23 +16,6 @@
16#include <sys/types.h> 16#include <sys/types.h>
17#include <sys/stat.h> 17#include <sys/stat.h>
18 18
19static const char makedevs_usage[] =
20 "makedevs NAME TYPE MAJOR MINOR FIRST LAST [s]\n"
21#ifndef BB_FEATURE_TRIVIAL_HELP
22 "\nCreates a range of block or character special files\n\n"
23 "TYPEs include:\n"
24 "\tb:\tMake a block (buffered) device.\n"
25 "\tc or u:\tMake a character (un-buffered) device.\n"
26 "\tp:\tMake a named pipe. MAJOR and MINOR are ignored for named pipes.\n\n"
27 "FIRST specifies the number appended to NAME to create the first device.\n"
28 "LAST specifies the number of the last item that should be created.\n"
29 "If 's' is the last argument, the base device is created as well.\n\n"
30 "For example:\n"
31 "\tmakedevs /dev/ttyS c 4 66 2 63 -> ttyS2-ttyS63\n"
32 "\tmakedevs /dev/hda b 3 0 0 8 s -> hda,hda1-hda8\n"
33#endif
34 ;
35
36int makedevs_main(int argc, char **argv) 19int makedevs_main(int argc, char **argv)
37{ 20{
38 21
diff --git a/miscutils/mktemp.c b/miscutils/mktemp.c
index 247d16d24..2ec078503 100644
--- a/miscutils/mktemp.c
+++ b/miscutils/mktemp.c
@@ -26,14 +26,6 @@
26#include <stdio.h> 26#include <stdio.h>
27#include <errno.h> 27#include <errno.h>
28 28
29const char mktemp_usage[] =
30 "mktemp [-q] TEMPLATE\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nCreates a temporary file with its name based on TEMPLATE.\n"
33 "TEMPLATE is any name with six `Xs' (i.e. /tmp/temp.XXXXXX).\n"
34#endif
35 ;
36
37extern int mktemp_main(int argc, char **argv) 29extern int mktemp_main(int argc, char **argv)
38{ 30{
39 if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q"))) 31 if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q")))
diff --git a/miscutils/mt.c b/miscutils/mt.c
index 4ab478270..087819e72 100644
--- a/miscutils/mt.c
+++ b/miscutils/mt.c
@@ -4,12 +4,6 @@
4#include <sys/mtio.h> 4#include <sys/mtio.h>
5#include <sys/fcntl.h> 5#include <sys/fcntl.h>
6 6
7static const char mt_usage[] = "mt [-f device] opcode value\n"
8#ifndef BB_FEATURE_TRIVIAL_HELP
9 "\nControl magnetic tape drive operation\n"
10#endif
11 ;
12
13struct mt_opcodes { 7struct mt_opcodes {
14 char *name; 8 char *name;
15 short value; 9 short value;
diff --git a/miscutils/update.c b/miscutils/update.c
index f94346172..0bdc90eaa 100644
--- a/miscutils/update.c
+++ b/miscutils/update.c
@@ -34,18 +34,6 @@
34static _syscall2(int, bdflush, int, func, int, data); 34static _syscall2(int, bdflush, int, func, int, data);
35#endif /* __GLIBC__ */ 35#endif /* __GLIBC__ */
36 36
37
38static char update_usage[] =
39 "update [options]\n"
40#ifndef BB_FEATURE_TRIVIAL_HELP
41 "\nPeriodically flushes filesystem buffers.\n\n"
42 "Options:\n"
43 "\t-S\tforce use of sync(2) instead of flushing\n"
44 "\t-s SECS\tcall sync this often (default 30)\n"
45 "\t-f SECS\tflush some buffers this often (default 5)\n"
46#endif
47 ;
48
49static unsigned int sync_duration = 30; 37static unsigned int sync_duration = 30;
50static unsigned int flush_duration = 5; 38static unsigned int flush_duration = 5;
51static int use_sync = 0; 39static int use_sync = 0;
diff --git a/mkdir.c b/mkdir.c
index f6e08cadc..f824cdcb6 100644
--- a/mkdir.c
+++ b/mkdir.c
@@ -29,18 +29,6 @@
29#include <stdio.h> 29#include <stdio.h>
30#include <errno.h> 30#include <errno.h>
31 31
32static const char mkdir_usage[] =
33 "mkdir [OPTION] DIRECTORY...\n"
34#ifndef BB_FEATURE_TRIVIAL_HELP
35 "\nCreate the DIRECTORY(ies), if they do not already exist\n\n"
36 "Options:\n"
37
38 "\t-m\tset permission mode (as in chmod), not rwxrwxrwx - umask\n"
39 "\t-p\tno error if existing, make parent directories as needed\n"
40#endif
41 ;
42
43
44static int parentFlag = FALSE; 32static int parentFlag = FALSE;
45static mode_t mode = 0777; 33static mode_t mode = 0777;
46 34
diff --git a/mkfifo.c b/mkfifo.c
index f701a97d5..3db17bbbc 100644
--- a/mkfifo.c
+++ b/mkfifo.c
@@ -26,14 +26,6 @@
26#include <sys/stat.h> 26#include <sys/stat.h>
27#include <errno.h> 27#include <errno.h>
28 28
29static const char mkfifo_usage[] = "mkfifo [OPTIONS] name\n"
30#ifndef BB_FEATURE_TRIVIAL_HELP
31 "\nCreates a named pipe (identical to 'mknod name p')\n\n"
32 "Options:\n"
33 "\t-m\tcreate the pipe using the specified mode (default a=rw)\n"
34#endif
35 ;
36
37extern int mkfifo_main(int argc, char **argv) 29extern int mkfifo_main(int argc, char **argv)
38{ 30{
39 char *thisarg; 31 char *thisarg;
diff --git a/mkfs_minix.c b/mkfs_minix.c
index 9ae4b569c..dec310d30 100644
--- a/mkfs_minix.c
+++ b/mkfs_minix.c
@@ -267,19 +267,6 @@ static volatile void die(char *str)
267 exit(8); 267 exit(8);
268} 268}
269 269
270const char mkfs_minix_usage[] =
271 "mkfs.minix [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n"
272#ifndef BB_FEATURE_TRIVIAL_HELP
273 "\nMake a MINIX filesystem.\n\n"
274 "Options:\n"
275 "\t-c\t\tCheck the device for bad blocks\n"
276 "\t-n [14|30]\tSpecify the maximum length of filenames\n"
277 "\t-i INODES\tSpecify the number of inodes for the filesystem\n"
278 "\t-l FILENAME\tRead the bad blocks list from FILENAME\n"
279 "\t-v\t\tMake a Minix version 2 filesystem\n\n"
280#endif
281 ;
282
283static volatile void show_usage() __attribute__ ((noreturn)); 270static volatile void show_usage() __attribute__ ((noreturn));
284static volatile void show_usage() 271static volatile void show_usage()
285{ 272{
diff --git a/mknod.c b/mknod.c
index ac96817ee..b51c8f3e3 100644
--- a/mknod.c
+++ b/mknod.c
@@ -28,18 +28,6 @@
28#include <fcntl.h> 28#include <fcntl.h>
29#include <unistd.h> 29#include <unistd.h>
30 30
31static const char mknod_usage[] = "mknod [OPTIONS] NAME TYPE MAJOR MINOR\n"
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\nCreate a special file (block, character, or pipe).\n\n"
34 "Options:\n"
35 "\t-m\tcreate the special file using the specified mode (default a=rw)\n\n"
36 "TYPEs include:\n"
37 "\tb:\tMake a block (buffered) device.\n"
38 "\tc or u:\tMake a character (un-buffered) device.\n"
39 "\tp:\tMake a named pipe. MAJOR and MINOR are ignored for named pipes.\n"
40#endif
41 ;
42
43int mknod_main(int argc, char **argv) 31int mknod_main(int argc, char **argv)
44{ 32{
45 char *thisarg; 33 char *thisarg;
diff --git a/mkswap.c b/mkswap.c
index 5a33945c8..eacd8816c 100644
--- a/mkswap.c
+++ b/mkswap.c
@@ -47,20 +47,6 @@
47#include <asm/page.h> /* for PAGE_SIZE and PAGE_SHIFT */ 47#include <asm/page.h> /* for PAGE_SIZE and PAGE_SHIFT */
48 /* we also get PAGE_SIZE via getpagesize() */ 48 /* we also get PAGE_SIZE via getpagesize() */
49 49
50
51static const char mkswap_usage[] =
52 "mkswap [-c] [-v0|-v1] device [block-count]\n"
53#ifndef BB_FEATURE_TRIVIAL_HELP
54 "\nPrepare a disk partition to be used as a swap partition.\n\n"
55 "Options:\n" "\t-c\t\tCheck for read-ability.\n"
56 "\t-v0\t\tMake version 0 swap [max 128 Megs].\n"
57 "\t-v1\t\tMake version 1 swap [big!] (default for kernels > 2.1.117).\n"
58
59 "\tblock-count\tNumber of block to use (default is entire partition).\n"
60#endif
61 ;
62
63
64#ifndef _IO 50#ifndef _IO
65/* pre-1.3.45 */ 51/* pre-1.3.45 */
66#define BLKGETSIZE 0x1260 52#define BLKGETSIZE 0x1260
diff --git a/mktemp.c b/mktemp.c
index 247d16d24..2ec078503 100644
--- a/mktemp.c
+++ b/mktemp.c
@@ -26,14 +26,6 @@
26#include <stdio.h> 26#include <stdio.h>
27#include <errno.h> 27#include <errno.h>
28 28
29const char mktemp_usage[] =
30 "mktemp [-q] TEMPLATE\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nCreates a temporary file with its name based on TEMPLATE.\n"
33 "TEMPLATE is any name with six `Xs' (i.e. /tmp/temp.XXXXXX).\n"
34#endif
35 ;
36
37extern int mktemp_main(int argc, char **argv) 29extern int mktemp_main(int argc, char **argv)
38{ 30{
39 if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q"))) 31 if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q")))
diff --git a/modutils/insmod.c b/modutils/insmod.c
index 97c360be7..9daedf938 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -70,7 +70,7 @@
70#ifndef MODUTILS_MODULE_H 70#ifndef MODUTILS_MODULE_H
71#define MODUTILS_MODULE_H 1 71#define MODUTILS_MODULE_H 1
72 72
73#ident "$Id: insmod.c,v 1.17 2000/07/14 16:23:32 proski Exp $" 73#ident "$Id: insmod.c,v 1.18 2000/07/16 20:57:15 kraai Exp $"
74 74
75/* This file contains the structures used by the 2.0 and 2.1 kernels. 75/* This file contains the structures used by the 2.0 and 2.1 kernels.
76 We do not use the kernel headers directly because we do not wish 76 We do not use the kernel headers directly because we do not wish
@@ -276,7 +276,7 @@ int delete_module(const char *);
276#ifndef MODUTILS_OBJ_H 276#ifndef MODUTILS_OBJ_H
277#define MODUTILS_OBJ_H 1 277#define MODUTILS_OBJ_H 1
278 278
279#ident "$Id: insmod.c,v 1.17 2000/07/14 16:23:32 proski Exp $" 279#ident "$Id: insmod.c,v 1.18 2000/07/16 20:57:15 kraai Exp $"
280 280
281/* The relocatable object is manipulated using elfin types. */ 281/* The relocatable object is manipulated using elfin types. */
282 282
@@ -560,16 +560,6 @@ _syscall2(unsigned long, create_module, const char *, name, size_t, size)
560#endif 560#endif
561static char m_filename[BUFSIZ + 1] = "\0"; 561static char m_filename[BUFSIZ + 1] = "\0";
562static char m_fullName[BUFSIZ + 1] = "\0"; 562static char m_fullName[BUFSIZ + 1] = "\0";
563static const char insmod_usage[] =
564 "insmod [OPTION]... MODULE [symbol=value]...\n"
565#ifndef BB_FEATURE_TRIVIAL_HELP
566 "\nLoads the specified kernel modules into the kernel.\n\n"
567 "Options:\n"
568 "\t-f\tForce module to load into the wrong kernel version.\n"
569 "\t-k\tMake module autoclean-able.\n"
570 "\t-v\tverbose output\n" "\t-x\tdo not export externs\n"
571#endif
572;
573 563
574/*======================================================================*/ 564/*======================================================================*/
575 565
diff --git a/modutils/rmmod.c b/modutils/rmmod.c
index 3158686f0..da10b7fcf 100644
--- a/modutils/rmmod.c
+++ b/modutils/rmmod.c
@@ -32,18 +32,6 @@
32/* And the system call of the day is... */ 32/* And the system call of the day is... */
33_syscall1(int, delete_module, const char *, name) 33_syscall1(int, delete_module, const char *, name)
34 34
35
36static const char rmmod_usage[] =
37 "rmmod [OPTION]... [MODULE]...\n"
38#ifndef BB_FEATURE_TRIVIAL_HELP
39 "\nUnloads the specified kernel modules from the kernel.\n\n"
40 "Options:\n"
41 "\t-a\tTry to remove all unused kernel modules.\n"
42#endif
43 ;
44
45
46
47extern int rmmod_main(int argc, char **argv) 35extern int rmmod_main(int argc, char **argv)
48{ 36{
49 if (argc <= 1) { 37 if (argc <= 1) {
diff --git a/more.c b/more.c
index 91c281563..2334576c0 100644
--- a/more.c
+++ b/more.c
@@ -34,12 +34,6 @@
34#define bb_need_help 34#define bb_need_help
35#include "messages.c" 35#include "messages.c"
36 36
37static const char more_usage[] = "more [FILE ...]\n"
38#ifndef BB_FEATURE_TRIVIAL_HELP
39 "\nMore is a filter for viewing FILE one screenful at a time.\n"
40#endif
41 ;
42
43/* ED: sparc termios is broken: revert back to old termio handling. */ 37/* ED: sparc termios is broken: revert back to old termio handling. */
44#ifdef BB_FEATURE_USE_TERMIOS 38#ifdef BB_FEATURE_USE_TERMIOS
45# if #cpu(sparc) 39# if #cpu(sparc)
diff --git a/mount.c b/mount.c
index addeb0925..610d12d34 100644
--- a/mount.c
+++ b/mount.c
@@ -80,38 +80,6 @@ extern int umount2 (__const char *__special_file, int __flags);
80 80
81extern const char mtab_file[]; /* Defined in utility.c */ 81extern const char mtab_file[]; /* Defined in utility.c */
82 82
83static const char mount_usage[] =
84 "mount [flags] device directory [-o options,more-options]\n"
85#ifndef BB_FEATURE_TRIVIAL_HELP
86 "\nMount a filesystem\n\n"
87 "Flags:\n"
88 "\t-a:\t\tMount all filesystems in fstab.\n"
89#ifdef BB_MTAB
90 "\t-f:\t\t\"Fake\" mount. Add entry to mount table but don't mount it.\n"
91 "\t-n:\t\tDon't write a mount table entry.\n"
92#endif
93 "\t-o option:\tOne of many filesystem options, listed below.\n"
94 "\t-r:\t\tMount the filesystem read-only.\n"
95 "\t-t fs-type:\tSpecify the filesystem type.\n"
96 "\t-w:\t\tMount for reading and writing (default).\n"
97 "\n"
98 "Options for use with the \"-o\" flag:\n"
99 "\tasync/sync:\tWrites are asynchronous / synchronous.\n"
100 "\tatime/noatime:\tEnable / disable updates to inode access times.\n"
101 "\tdev/nodev:\tAllow use of special device files / disallow them.\n"
102 "\texec/noexec:\tAllow use of executable files / disallow them.\n"
103#if defined BB_FEATURE_MOUNT_LOOP
104 "\tloop:\t\tMounts a file via loop device.\n"
105#endif
106 "\tsuid/nosuid:\tAllow set-user-id-root programs / disallow them.\n"
107 "\tremount:\tRe-mount a currently-mounted filesystem, changing its flags.\n"
108 "\tro/rw:\t\tMount for read-only / read-write.\n"
109 "\nThere are EVEN MORE flags that are specific to each filesystem.\n"
110 "You'll have to see the written documentation for those.\n"
111#endif
112 ;
113
114
115struct mount_options { 83struct mount_options {
116 const char *name; 84 const char *name;
117 unsigned long and; 85 unsigned long and;
diff --git a/mt.c b/mt.c
index 4ab478270..087819e72 100644
--- a/mt.c
+++ b/mt.c
@@ -4,12 +4,6 @@
4#include <sys/mtio.h> 4#include <sys/mtio.h>
5#include <sys/fcntl.h> 5#include <sys/fcntl.h>
6 6
7static const char mt_usage[] = "mt [-f device] opcode value\n"
8#ifndef BB_FEATURE_TRIVIAL_HELP
9 "\nControl magnetic tape drive operation\n"
10#endif
11 ;
12
13struct mt_opcodes { 7struct mt_opcodes {
14 char *name; 8 char *name;
15 short value; 9 short value;
diff --git a/nc.c b/nc.c
index b6afe6ffa..a544f32fc 100644
--- a/nc.c
+++ b/nc.c
@@ -40,12 +40,6 @@
40 40
41#define BUFSIZE 100 41#define BUFSIZE 100
42 42
43static const char nc_usage[] = "nc [IP] [port]\n"
44#ifndef BB_FEATURE_TRIVIAL_HELP
45 "\nNetcat opens a pipe to IP:port\n"
46#endif
47 ;
48
49int nc_main(int argc, char **argv) 43int nc_main(int argc, char **argv)
50{ 44{
51 int sfd; 45 int sfd;
diff --git a/networking/hostname.c b/networking/hostname.c
index 60f66c073..77b545ded 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.11 2000/07/14 01:51:25 kraai Exp $ 3 * $Id: hostname.c,v 1.12 2000/07/16 20:57:15 kraai 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>
@@ -30,21 +30,6 @@
30#include <unistd.h> 30#include <unistd.h>
31#include <stdio.h> 31#include <stdio.h>
32 32
33static const char *hostname_usage =
34 "hostname [OPTION] {hostname | -F file}\n"
35#ifndef BB_FEATURE_TRIVIAL_HELP
36 "\nGet or set the hostname or DNS domain name. If a hostname is given\n"
37 "(or a file with the -F parameter), the host name will be set.\n\n"
38 "Options:\n"
39 "\t-s\t\tShort\n"
40
41 "\t-i\t\tAddresses for the hostname\n"
42 "\t-d\t\tDNS domain name\n"
43 "\t-F FILE\t\tUse the contents of FILE to specify the hostname\n"
44#endif
45 ;
46
47
48void do_sethostname(char *s, int isfile) 33void do_sethostname(char *s, int isfile)
49{ 34{
50 FILE *f; 35 FILE *f;
diff --git a/networking/nc.c b/networking/nc.c
index b6afe6ffa..a544f32fc 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -40,12 +40,6 @@
40 40
41#define BUFSIZE 100 41#define BUFSIZE 100
42 42
43static const char nc_usage[] = "nc [IP] [port]\n"
44#ifndef BB_FEATURE_TRIVIAL_HELP
45 "\nNetcat opens a pipe to IP:port\n"
46#endif
47 ;
48
49int nc_main(int argc, char **argv) 43int nc_main(int argc, char **argv)
50{ 44{
51 int sfd; 45 int sfd;
diff --git a/networking/nslookup.c b/networking/nslookup.c
index 54f37c848..10d36b2d1 100644
--- a/networking/nslookup.c
+++ b/networking/nslookup.c
@@ -41,13 +41,6 @@
41 | + find out how the real nslookup gets the default name server 41 | + find out how the real nslookup gets the default name server
42 */ 42 */
43 43
44static const char nslookup_usage[] = "nslookup [HOST]\n"
45#ifndef BB_FEATURE_TRIVIAL_HELP
46 "\nQueries the nameserver for the IP address of the given HOST\n"
47#endif
48;
49
50
51/* I have to see how the real nslookup does this. 44/* I have to see how the real nslookup does this.
52 * I could dig through /etc/resolv.conf, but is there a 45 * I could dig through /etc/resolv.conf, but is there a
53 * better (programatic) way? 46 * better (programatic) way?
@@ -177,4 +170,4 @@ int nslookup_main(int argc, char **argv)
177 return( TRUE); 170 return( TRUE);
178} 171}
179 172
180/* $Id: nslookup.c,v 1.10 2000/06/19 17:25:40 andersen Exp $ */ 173/* $Id: nslookup.c,v 1.11 2000/07/16 20:57:15 kraai Exp $ */
diff --git a/networking/ping.c b/networking/ping.c
index b2b4880ed..5f44a6816 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.22 2000/07/14 06:49:52 andersen Exp $ 3 * $Id: ping.c,v 1.23 2000/07/16 20:57:15 kraai 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>
@@ -174,12 +174,6 @@ static int in_cksum(unsigned short *buf, int sz)
174 174
175/* simple version */ 175/* simple version */
176#ifdef BB_FEATURE_SIMPLE_PING 176#ifdef BB_FEATURE_SIMPLE_PING
177static const char *ping_usage = "ping host\n"
178#ifndef BB_FEATURE_TRIVIAL_HELP
179 "\nSend ICMP ECHO_REQUEST packets to network hosts\n"
180#endif
181 ;
182
183static char *hostname = NULL; 177static char *hostname = NULL;
184 178
185static void noresp(int ign) 179static void noresp(int ign)
@@ -267,17 +261,6 @@ extern int ping_main(int argc, char **argv)
267 261
268#else /* ! BB_FEATURE_SIMPLE_PING */ 262#else /* ! BB_FEATURE_SIMPLE_PING */
269/* full(er) version */ 263/* full(er) version */
270static const char *ping_usage = "ping [OPTION]... host\n"
271#ifndef BB_FEATURE_TRIVIAL_HELP
272 "\nSend ICMP ECHO_REQUEST packets to network hosts.\n\n"
273 "Options:\n"
274 "\t-c COUNT\tSend only COUNT pings.\n"
275 "\t-s SIZE\t\tSend SIZE data bytes in packets (default=56).\n"
276 "\t-q\t\tQuiet mode, only displays output at start\n"
277 "\t\t\tand when finished.\n"
278#endif
279 ;
280
281static char *hostname = NULL; 264static char *hostname = NULL;
282static struct sockaddr_in pingaddr; 265static struct sockaddr_in pingaddr;
283static int pingsock = -1; 266static int pingsock = -1;
diff --git a/networking/telnet.c b/networking/telnet.c
index f27603527..3e43c4a1b 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -134,14 +134,6 @@ static int local_bind(int port);
134 134
135/* Some globals */ 135/* Some globals */
136static int one = 1; 136static int one = 1;
137static const char telnet_usage[] =
138 "telnet host [port]\n"
139#ifndef BB_FEATURE_TRIVIAL_HELP
140 "\nTelnet is used to establish interactive communication with another\n"
141 "computer over a network using the TELNET protocol.\n"
142#endif
143 ;
144
145 137
146static void doexit(int ev) 138static void doexit(int ev)
147{ 139{
diff --git a/nslookup.c b/nslookup.c
index 54f37c848..10d36b2d1 100644
--- a/nslookup.c
+++ b/nslookup.c
@@ -41,13 +41,6 @@
41 | + find out how the real nslookup gets the default name server 41 | + find out how the real nslookup gets the default name server
42 */ 42 */
43 43
44static const char nslookup_usage[] = "nslookup [HOST]\n"
45#ifndef BB_FEATURE_TRIVIAL_HELP
46 "\nQueries the nameserver for the IP address of the given HOST\n"
47#endif
48;
49
50
51/* I have to see how the real nslookup does this. 44/* I have to see how the real nslookup does this.
52 * I could dig through /etc/resolv.conf, but is there a 45 * I could dig through /etc/resolv.conf, but is there a
53 * better (programatic) way? 46 * better (programatic) way?
@@ -177,4 +170,4 @@ int nslookup_main(int argc, char **argv)
177 return( TRUE); 170 return( TRUE);
178} 171}
179 172
180/* $Id: nslookup.c,v 1.10 2000/06/19 17:25:40 andersen Exp $ */ 173/* $Id: nslookup.c,v 1.11 2000/07/16 20:57:15 kraai Exp $ */
diff --git a/ping.c b/ping.c
index b2b4880ed..5f44a6816 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.22 2000/07/14 06:49:52 andersen Exp $ 3 * $Id: ping.c,v 1.23 2000/07/16 20:57:15 kraai 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>
@@ -174,12 +174,6 @@ static int in_cksum(unsigned short *buf, int sz)
174 174
175/* simple version */ 175/* simple version */
176#ifdef BB_FEATURE_SIMPLE_PING 176#ifdef BB_FEATURE_SIMPLE_PING
177static const char *ping_usage = "ping host\n"
178#ifndef BB_FEATURE_TRIVIAL_HELP
179 "\nSend ICMP ECHO_REQUEST packets to network hosts\n"
180#endif
181 ;
182
183static char *hostname = NULL; 177static char *hostname = NULL;
184 178
185static void noresp(int ign) 179static void noresp(int ign)
@@ -267,17 +261,6 @@ extern int ping_main(int argc, char **argv)
267 261
268#else /* ! BB_FEATURE_SIMPLE_PING */ 262#else /* ! BB_FEATURE_SIMPLE_PING */
269/* full(er) version */ 263/* full(er) version */
270static const char *ping_usage = "ping [OPTION]... host\n"
271#ifndef BB_FEATURE_TRIVIAL_HELP
272 "\nSend ICMP ECHO_REQUEST packets to network hosts.\n\n"
273 "Options:\n"
274 "\t-c COUNT\tSend only COUNT pings.\n"
275 "\t-s SIZE\t\tSend SIZE data bytes in packets (default=56).\n"
276 "\t-q\t\tQuiet mode, only displays output at start\n"
277 "\t\t\tand when finished.\n"
278#endif
279 ;
280
281static char *hostname = NULL; 264static char *hostname = NULL;
282static struct sockaddr_in pingaddr; 265static struct sockaddr_in pingaddr;
283static int pingsock = -1; 266static int pingsock = -1;
diff --git a/printf.c b/printf.c
index f57289759..6a87fc319 100644
--- a/printf.c
+++ b/printf.c
@@ -137,13 +137,6 @@ static void verify __P((char *s, char *end));
137/* The value to return to the calling program. */ 137/* The value to return to the calling program. */
138static int exit_status; 138static int exit_status;
139 139
140static const char printf_usage[] = "printf FORMAT [ARGUMENT...]\n"
141#ifndef BB_FEATURE_TRIVIAL_HELP
142 "\nFormats and prints ARGUMENT(s) according to FORMAT,\n"
143 "Where FORMAT controls the output exactly as in C printf.\n"
144#endif
145 ;
146
147int printf_main(int argc, char **argv) 140int printf_main(int argc, char **argv)
148{ 141{
149 char *format; 142 char *format;
diff --git a/procps/free.c b/procps/free.c
index 7c9d7f10a..78298cfb6 100644
--- a/procps/free.c
+++ b/procps/free.c
@@ -25,13 +25,6 @@
25#include <stdio.h> 25#include <stdio.h>
26#include <errno.h> 26#include <errno.h>
27 27
28const char free_usage[] =
29 "free\n"
30#ifndef BB_FEATURE_TRIVIAL_HELP
31 "\nDisplays the amount of free and used system memory\n"
32#endif
33 ;
34
35extern int free_main(int argc, char **argv) 28extern int free_main(int argc, char **argv)
36{ 29{
37 struct sysinfo info; 30 struct sysinfo info;
diff --git a/procps/kill.c b/procps/kill.c
index 44cb38395..da46620dd 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -31,24 +31,6 @@
31#include <sys/stat.h> 31#include <sys/stat.h>
32#include <unistd.h> 32#include <unistd.h>
33 33
34static const char *kill_usage =
35 "kill [-signal] process-id [process-id ...]\n"
36#ifndef BB_FEATURE_TRIVIAL_HELP
37 "\nSend a signal (default is SIGTERM) to the specified process(es).\n\n"
38 "Options:\n" "\t-l\tList all signal names and numbers.\n\n"
39#endif
40 ;
41
42#ifdef BB_KILLALL
43static const char *killall_usage =
44 "killall [-signal] process-name [process-name ...]\n"
45#ifndef BB_FEATURE_TRIVIAL_HELP
46 "\nSend a signal (default is SIGTERM) to the specified process(es).\n\n"
47 "Options:\n" "\t-l\tList all signal names and numbers.\n\n"
48#endif
49#endif
50 ;
51
52#define KILL 0 34#define KILL 0
53#define KILLALL 1 35#define KILLALL 1
54 36
diff --git a/procps/ps.c b/procps/ps.c
index 74e79f5f8..fc58a9bb7 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -114,14 +114,6 @@ static void parse_proc_status(char *S, proc_t * P)
114 114
115} 115}
116 116
117const char ps_usage[] =
118 "ps\n"
119#ifndef BB_FEATURE_TRIVIAL_HELP
120 "\nReport process status\n"
121 "\nThis version of ps accepts no options.\n"
122#endif
123 ;
124
125extern int ps_main(int argc, char **argv) 117extern int ps_main(int argc, char **argv)
126{ 118{
127 proc_t p; 119 proc_t p;
diff --git a/ps.c b/ps.c
index 74e79f5f8..fc58a9bb7 100644
--- a/ps.c
+++ b/ps.c
@@ -114,14 +114,6 @@ static void parse_proc_status(char *S, proc_t * P)
114 114
115} 115}
116 116
117const char ps_usage[] =
118 "ps\n"
119#ifndef BB_FEATURE_TRIVIAL_HELP
120 "\nReport process status\n"
121 "\nThis version of ps accepts no options.\n"
122#endif
123 ;
124
125extern int ps_main(int argc, char **argv) 117extern int ps_main(int argc, char **argv)
126{ 118{
127 proc_t p; 119 proc_t p;
diff --git a/rm.c b/rm.c
index 2067d878c..275c05946 100644
--- a/rm.c
+++ b/rm.c
@@ -29,17 +29,6 @@
29#include <dirent.h> 29#include <dirent.h>
30#include <errno.h> 30#include <errno.h>
31 31
32static const char *rm_usage = "rm [OPTION]... FILE...\n"
33#ifndef BB_FEATURE_TRIVIAL_HELP
34 "\nRemove (unlink) the FILE(s). You may use '--' to\n"
35 "indicate that all following arguments are non-options.\n\n"
36 "Options:\n"
37 "\t-f\t\tremove existing destinations, never prompt\n"
38 "\t-r or -R\tremove the contents of directories recursively\n"
39#endif
40 ;
41
42
43static int recursiveFlag = FALSE; 32static int recursiveFlag = FALSE;
44static int forceFlag = FALSE; 33static int forceFlag = FALSE;
45static const char *srcName; 34static const char *srcName;
diff --git a/rmdir.c b/rmdir.c
index 3c3533fae..500890e40 100644
--- a/rmdir.c
+++ b/rmdir.c
@@ -26,13 +26,6 @@
26#include <stdio.h> 26#include <stdio.h>
27#include <errno.h> 27#include <errno.h>
28 28
29const char rmdir_usage[] =
30 "rmdir [OPTION]... DIRECTORY...\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nRemove the DIRECTORY(ies), if they are empty.\n"
33#endif
34 ;
35
36extern int rmdir_main(int argc, char **argv) 29extern int rmdir_main(int argc, char **argv)
37{ 30{
38 if (argc == 1 || **(argv + 1) == '-') 31 if (argc == 1 || **(argv + 1) == '-')
diff --git a/rmmod.c b/rmmod.c
index 3158686f0..da10b7fcf 100644
--- a/rmmod.c
+++ b/rmmod.c
@@ -32,18 +32,6 @@
32/* And the system call of the day is... */ 32/* And the system call of the day is... */
33_syscall1(int, delete_module, const char *, name) 33_syscall1(int, delete_module, const char *, name)
34 34
35
36static const char rmmod_usage[] =
37 "rmmod [OPTION]... [MODULE]...\n"
38#ifndef BB_FEATURE_TRIVIAL_HELP
39 "\nUnloads the specified kernel modules from the kernel.\n\n"
40 "Options:\n"
41 "\t-a\tTry to remove all unused kernel modules.\n"
42#endif
43 ;
44
45
46
47extern int rmmod_main(int argc, char **argv) 35extern int rmmod_main(int argc, char **argv)
48{ 36{
49 if (argc <= 1) { 37 if (argc <= 1) {
diff --git a/sed.c b/sed.c
index 1f1e9069c..4d4886e19 100644
--- a/sed.c
+++ b/sed.c
@@ -85,22 +85,6 @@ static int ncmds = 0; /* number of sed commands */
85 85
86/*static char *cur_file = NULL;*/ /* file currently being processed XXX: do I need this? */ 86/*static char *cur_file = NULL;*/ /* file currently being processed XXX: do I need this? */
87 87
88static const char sed_usage[] =
89 "sed [-Vhnef] pattern [files...]\n"
90#ifndef BB_FEATURE_TRIVIAL_HELP
91 "\n"
92 "-n\tsuppress automatic printing of pattern space\n"
93 "-e script\tadd the script to the commands to be executed\n"
94 "-f scriptfile\tadd the contents of script-file to the commands to be executed\n"
95 "-h\tdisplay this help message\n"
96 "-V\toutput version information and exit\n"
97 "\n"
98 "If no -e or -f is given, the first non-option argument is taken as the\n"
99 "sed script to interpret. All remaining arguments are names of input\n"
100 "files; if no input files are specified, then the standard input is read.\n"
101#endif
102 ;
103
104#if 0 88#if 0
105static void destroy_cmd_strs() 89static void destroy_cmd_strs()
106{ 90{
diff --git a/setkeycodes.c b/setkeycodes.c
index 1bdb909ea..284ffa194 100644
--- a/setkeycodes.c
+++ b/setkeycodes.c
@@ -35,17 +35,6 @@ struct kbkeycode {
35}; 35};
36#define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */ 36#define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */
37 37
38
39static const char setkeycodes_usage[] =
40 "setkeycodes SCANCODE KEYCODE ...\n"
41#ifndef BB_FEATURE_TRIVIAL_HELP
42 "\nSet entries into the kernel's scancode-to-keycode map,\n"
43 "allowing unusual keyboards to generate usable keycodes.\n\n"
44 "SCANCODE may be either xx or e0xx (hexadecimal),\n"
45 "and KEYCODE is given in decimal\n"
46#endif
47 ;
48
49extern int 38extern int
50setkeycodes_main(int argc, char** argv) 39setkeycodes_main(int argc, char** argv)
51{ 40{
diff --git a/sh.c b/sh.c
index d829b6b29..9b3435304 100644
--- a/sh.c
+++ b/sh.c
@@ -137,14 +137,6 @@ static struct builtInCommand bltins_forking[] = {
137 {NULL, NULL, NULL, NULL} 137 {NULL, NULL, NULL, NULL}
138}; 138};
139 139
140static const char shell_usage[] =
141 "sh [FILE]...\n"
142 " or: sh -c command [args]...\n"
143#ifndef BB_FEATURE_TRIVIAL_HELP
144 "\nlash: The BusyBox command interpreter (shell).\n\n"
145#endif
146 ;
147
148static char *prompt = "# "; 140static char *prompt = "# ";
149static char *cwd = NULL; 141static char *cwd = NULL;
150static char *local_pending_command = NULL; 142static char *local_pending_command = NULL;
diff --git a/shell/lash.c b/shell/lash.c
index d829b6b29..9b3435304 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -137,14 +137,6 @@ static struct builtInCommand bltins_forking[] = {
137 {NULL, NULL, NULL, NULL} 137 {NULL, NULL, NULL, NULL}
138}; 138};
139 139
140static const char shell_usage[] =
141 "sh [FILE]...\n"
142 " or: sh -c command [args]...\n"
143#ifndef BB_FEATURE_TRIVIAL_HELP
144 "\nlash: The BusyBox command interpreter (shell).\n\n"
145#endif
146 ;
147
148static char *prompt = "# "; 140static char *prompt = "# ";
149static char *cwd = NULL; 141static char *cwd = NULL;
150static char *local_pending_command = NULL; 142static char *local_pending_command = NULL;
diff --git a/sleep.c b/sleep.c
index c7ab32d4b..d6705c4c3 100644
--- a/sleep.c
+++ b/sleep.c
@@ -24,12 +24,6 @@
24#include "internal.h" 24#include "internal.h"
25#include <stdio.h> 25#include <stdio.h>
26 26
27const char sleep_usage[] = "sleep N\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nPause for N seconds.\n"
30#endif
31 ;
32
33extern int sleep_main(int argc, char **argv) 27extern int sleep_main(int argc, char **argv)
34{ 28{
35 if ((argc < 2) || (**(argv + 1) == '-')) { 29 if ((argc < 2) || (**(argv + 1) == '-')) {
diff --git a/sort.c b/sort.c
index c754989ea..6af5c4df3 100644
--- a/sort.c
+++ b/sort.c
@@ -29,16 +29,6 @@
29#include <stdio.h> 29#include <stdio.h>
30#include <errno.h> 30#include <errno.h>
31 31
32static const char sort_usage[] = "sort [-n]"
33#ifdef BB_FEATURE_SORT_REVERSE
34" [-r]"
35#endif
36" [FILE]...\n"
37#ifndef BB_FEATURE_TRIVIAL_HELP
38"\nSorts lines of text in the specified files\n"
39#endif
40;
41
42#ifdef BB_FEATURE_SORT_REVERSE 32#ifdef BB_FEATURE_SORT_REVERSE
43#define APPLY_REVERSE(x) (reverse ? -(x) : (x)) 33#define APPLY_REVERSE(x) (reverse ? -(x) : (x))
44static int reverse = 0; 34static int reverse = 0;
@@ -304,4 +294,4 @@ int sort_main(int argc, char **argv)
304 return(0); 294 return(0);
305} 295}
306 296
307/* $Id: sort.c,v 1.19 2000/07/14 01:51:25 kraai Exp $ */ 297/* $Id: sort.c,v 1.20 2000/07/16 20:57:15 kraai Exp $ */
diff --git a/swaponoff.c b/swaponoff.c
index a79b93a23..6aafe51a2 100644
--- a/swaponoff.c
+++ b/swaponoff.c
@@ -35,25 +35,6 @@ _syscall1(int, swapoff, const char *, path);
35 35
36static int whichApp; 36static int whichApp;
37 37
38static const char swapoff_usage[] =
39 "swapoff [OPTION] [device]\n"
40#ifndef BB_FEATURE_TRIVIAL_HELP
41 "\nStop swapping virtual memory pages on the given device.\n\n"
42 "Options:\n"
43 "\t-a\tStop swapping on all swap devices\n"
44#endif
45 ;
46
47static const char swapon_usage[] =
48 "swapon [OPTION] [device]\n"
49#ifndef BB_FEATURE_TRIVIAL_HELP
50 "\nStart swapping virtual memory pages on the given device.\n\n"
51 "Options:\n"
52 "\t-a\tStart swapping on all swap devices\n"
53#endif
54 ;
55
56
57#define SWAPON_APP 1 38#define SWAPON_APP 1
58#define SWAPOFF_APP 2 39#define SWAPOFF_APP 2
59 40
diff --git a/sync.c b/sync.c
index f7c14b04c..3737cb1f1 100644
--- a/sync.c
+++ b/sync.c
@@ -24,13 +24,6 @@
24#include "internal.h" 24#include "internal.h"
25#include <stdio.h> 25#include <stdio.h>
26 26
27const char sync_usage[] =
28 "sync\n"
29#ifndef BB_FEATURE_TRIVIAL_HELP
30 "\nWrite all buffered filesystem blocks to disk.\n"
31#endif
32 ;
33
34extern int sync_main(int argc, char **argv) 27extern int sync_main(int argc, char **argv)
35{ 28{
36 if (argc > 1 && **(argv + 1) == '-') 29 if (argc > 1 && **(argv + 1) == '-')
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index 981748bb5..0e1ce8dce 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -47,20 +47,6 @@ extern CODE prioritynames[];
47extern CODE facilitynames[]; 47extern CODE facilitynames[];
48#endif 48#endif
49 49
50static const char logger_usage[] =
51 "logger [OPTION]... [MESSAGE]\n"
52#ifndef BB_FEATURE_TRIVIAL_HELP
53 "\nWrite MESSAGE to the system log. If MESSAGE is '-', log stdin.\n\n"
54 "Options:\n"
55 "\t-s\tLog to stderr as well as the system log.\n"
56 "\t-t\tLog using the specified tag (defaults to user name).\n"
57
58 "\t-p\tEnter the message with the specified priority.\n"
59 "\t\tThis may be numerical or a ``facility.level'' pair.\n"
60#endif
61 ;
62
63
64/* Decode a symbolic name to a numeric value 50/* Decode a symbolic name to a numeric value
65 * this function is based on code 51 * this function is based on code
66 * Copyright (c) 1983, 1993 52 * Copyright (c) 1983, 1993
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 55fd8dc74..264d899f3 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -76,21 +76,6 @@ static int MarkInterval = 20 * 60;
76/* localhost's name */ 76/* localhost's name */
77static char LocalHostName[32]; 77static char LocalHostName[32];
78 78
79static const char syslogd_usage[] =
80 "syslogd [OPTION]...\n"
81#ifndef BB_FEATURE_TRIVIAL_HELP
82 "\nLinux system and kernel (provides klogd) logging utility.\n"
83 "Note that this version of syslogd/klogd ignores /etc/syslog.conf.\n\n"
84 "Options:\n"
85 "\t-m NUM\t\tInterval between MARK lines (default=20min, 0=off)\n"
86 "\t-n\t\tRun as a foreground process\n"
87#ifdef BB_FEATURE_KLOGD
88 "\t-K\t\tDo not start up the klogd process\n"
89#endif
90 "\t-O FILE\t\tUse an alternate log file (default=/var/log/messages)\n"
91#endif
92 ;
93
94/* Note: There is also a function called "message()" in init.c */ 79/* Note: There is also a function called "message()" in init.c */
95/* Print a message to the log file. */ 80/* Print a message to the log file. */
96static void message (char *fmt, ...) __attribute__ ((format (printf, 1, 2))); 81static void message (char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
diff --git a/syslogd.c b/syslogd.c
index 55fd8dc74..264d899f3 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -76,21 +76,6 @@ static int MarkInterval = 20 * 60;
76/* localhost's name */ 76/* localhost's name */
77static char LocalHostName[32]; 77static char LocalHostName[32];
78 78
79static const char syslogd_usage[] =
80 "syslogd [OPTION]...\n"
81#ifndef BB_FEATURE_TRIVIAL_HELP
82 "\nLinux system and kernel (provides klogd) logging utility.\n"
83 "Note that this version of syslogd/klogd ignores /etc/syslog.conf.\n\n"
84 "Options:\n"
85 "\t-m NUM\t\tInterval between MARK lines (default=20min, 0=off)\n"
86 "\t-n\t\tRun as a foreground process\n"
87#ifdef BB_FEATURE_KLOGD
88 "\t-K\t\tDo not start up the klogd process\n"
89#endif
90 "\t-O FILE\t\tUse an alternate log file (default=/var/log/messages)\n"
91#endif
92 ;
93
94/* Note: There is also a function called "message()" in init.c */ 79/* Note: There is also a function called "message()" in init.c */
95/* Print a message to the log file. */ 80/* Print a message to the log file. */
96static void message (char *fmt, ...) __attribute__ ((format (printf, 1, 2))); 81static void message (char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
diff --git a/tail.c b/tail.c
index 9232356eb..cea63e840 100644
--- a/tail.c
+++ b/tail.c
@@ -72,21 +72,6 @@ static int forever;
72/* If nonzero, print filename headers. */ 72/* If nonzero, print filename headers. */
73static int print_headers; 73static int print_headers;
74 74
75const char tail_usage[] =
76 "tail [OPTION] [FILE]...\n"
77#ifndef BB_FEATURE_TRIVIAL_HELP
78 "\nPrint last 10 lines of each FILE to standard output.\n"
79 "With more than one FILE, precede each with a header giving the\n"
80 "file name. With no FILE, or when FILE is -, read standard input.\n\n"
81 "Options:\n"
82 "\t-n NUM\t\tPrint last NUM lines instead of first 10\n"
83
84 "\t-f\t\tOutput data as the file grows. This version\n"
85 "\t\t\tof 'tail -f' supports only one file at a time.\n"
86#endif
87 ;
88
89
90static void write_header(const char *filename) 75static void write_header(const char *filename)
91{ 76{
92 static int first_file = 1; 77 static int first_file = 1;
@@ -516,25 +501,6 @@ char *program_name;
516/* Nonzero if we have ever read standard input. */ 501/* Nonzero if we have ever read standard input. */
517static int have_read_stdin; 502static int have_read_stdin;
518 503
519
520static const char tail_usage[] = "tail [OPTION]... [FILE]...\n"
521#ifndef BB_FEATURE_TRIVIAL_HELP
522"\nPrint last 10 lines of each FILE to standard output.\n\
523With more than one FILE, precede each with a header giving the file name.\n\
524With no FILE, or when FILE is -, read standard input.\n\
525\n\
526 -c=N[kbm] output the last N bytes\n\
527 -f output appended data as the file grows\n\
528 -n=N output the last N lines, instead of last 10\n\
529 -q never output headers giving file names\n\
530 -v always output headers giving file names\n\
531\n\
532If the first character of N (bytes or lines) is a `+', output begins with \n\
533the Nth item from the start of each file, otherwise, print the last N items\n\
534in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2).\n"
535#endif
536;
537
538static void write_header(const char *filename, const char *comment) 504static void write_header(const char *filename, const char *comment)
539{ 505{
540 static int first_file = 1; 506 static int first_file = 1;
diff --git a/tar.c b/tar.c
index 353694f33..6f18dc43f 100644
--- a/tar.c
+++ b/tar.c
@@ -50,37 +50,6 @@
50#include <sys/types.h> 50#include <sys/types.h>
51#include <sys/sysmacros.h> 51#include <sys/sysmacros.h>
52 52
53
54static const char tar_usage[] =
55#ifdef BB_FEATURE_TAR_CREATE
56 "tar -[cxtvO] "
57#else
58 "tar -[xtvO] "
59#endif
60#if defined BB_FEATURE_TAR_EXCLUDE
61 "[--exclude File] "
62#endif
63 "[-f tarFile] [FILE] ...\n"
64#ifndef BB_FEATURE_TRIVIAL_HELP
65 "\nCreate, extract, or list files from a tar file. Note that\n"
66 "this version of tar treats hard links as separate files.\n\n"
67 "Main operation mode:\n"
68#ifdef BB_FEATURE_TAR_CREATE
69 "\tc\t\tcreate\n"
70#endif
71 "\tx\t\textract\n"
72 "\tt\t\tlist\n"
73 "\nFile selection:\n"
74 "\tf\t\tname of tarfile or \"-\" for stdin\n"
75 "\tO\t\textract to stdout\n"
76#if defined BB_FEATURE_TAR_EXCLUDE
77 "\t--exclude\tfile to exclude\n"
78#endif
79 "\nInformative output:\n"
80 "\tv\t\tverbosely list files processed\n"
81#endif
82 ;
83
84/* Tar file constants */ 53/* Tar file constants */
85#ifndef MAJOR 54#ifndef MAJOR
86#define MAJOR(dev) (((dev)>>8)&0xff) 55#define MAJOR(dev) (((dev)>>8)&0xff)
diff --git a/tee.c b/tee.c
index 67b42a24d..c15408b51 100644
--- a/tee.c
+++ b/tee.c
@@ -26,18 +26,6 @@
26#include <errno.h> 26#include <errno.h>
27#include <stdio.h> 27#include <stdio.h>
28 28
29static const char tee_usage[] =
30 "tee [OPTION]... [FILE]...\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nCopy standard input to each FILE, and also to standard output.\n\n"
33 "Options:\n" "\t-a\tappend to the given FILEs, do not overwrite\n"
34#if 0
35 "\t-i\tignore interrupt signals\n"
36#endif
37#endif
38;
39
40
41/* FileList _______________________________________________________________ */ 29/* FileList _______________________________________________________________ */
42 30
43#define FL_MAX 1024 31#define FL_MAX 1024
@@ -133,4 +121,4 @@ int tee_main(int argc, char **argv)
133 return(0); 121 return(0);
134} 122}
135 123
136/* $Id: tee.c,v 1.12 2000/07/14 01:51:25 kraai Exp $ */ 124/* $Id: tee.c,v 1.13 2000/07/16 20:57:15 kraai Exp $ */
diff --git a/telnet.c b/telnet.c
index f27603527..3e43c4a1b 100644
--- a/telnet.c
+++ b/telnet.c
@@ -134,14 +134,6 @@ static int local_bind(int port);
134 134
135/* Some globals */ 135/* Some globals */
136static int one = 1; 136static int one = 1;
137static const char telnet_usage[] =
138 "telnet host [port]\n"
139#ifndef BB_FEATURE_TRIVIAL_HELP
140 "\nTelnet is used to establish interactive communication with another\n"
141 "computer over a network using the TELNET protocol.\n"
142#endif
143 ;
144
145 137
146static void doexit(int ev) 138static void doexit(int ev)
147{ 139{
diff --git a/test.c b/test.c
index bf1622cde..9a1888b28 100644
--- a/test.c
+++ b/test.c
@@ -178,15 +178,6 @@ static int test_eaccess();
178static int is_a_group_member(); 178static int is_a_group_member();
179static void initialize_group_array(); 179static void initialize_group_array();
180 180
181const char test_usage[] =
182 "test EXPRESSION\n"
183 "or [ EXPRESSION ]\n"
184#ifndef BB_FEATURE_TRIVIAL_HELP
185 "\nChecks file types and compares values returning an exit\n"
186 "code determined by the value of EXPRESSION.\n"
187#endif
188 ;
189
190extern int 181extern int
191test_main(int argc, char** argv) 182test_main(int argc, char** argv)
192{ 183{
diff --git a/touch.c b/touch.c
index ac275423c..afdd265f7 100644
--- a/touch.c
+++ b/touch.c
@@ -30,16 +30,6 @@
30#include <utime.h> 30#include <utime.h>
31#include <errno.h> 31#include <errno.h>
32 32
33
34static const char touch_usage[] = "touch [-c] file [file ...]\n"
35#ifndef BB_FEATURE_TRIVIAL_HELP
36 "\nUpdate the last-modified date on the given file[s].\n\n"
37 "Options:\n"
38 "\t-c\tDo not create any files\n"
39#endif
40 ;
41
42
43extern int touch_main(int argc, char **argv) 33extern int touch_main(int argc, char **argv)
44{ 34{
45 int fd; 35 int fd;
diff --git a/tr.c b/tr.c
index 2971ef68e..004092477 100644
--- a/tr.c
+++ b/tr.c
@@ -34,19 +34,6 @@
34#define bb_need_write_error 34#define bb_need_write_error
35#include "messages.c" 35#include "messages.c"
36 36
37const char *tr_usage="tr [-cds] STRING1 [STRING2]\n"
38#ifndef BB_FEATURE_TRIVIAL_HELP
39 "\nTranslate, squeeze, and/or delete characters from\n"
40 "standard input, writing to standard output.\n\n"
41 "Options:\n"
42 "\t-c\ttake complement of STRING1\n"
43 "\t-d\tdelete input characters coded STRING1\n"
44 "\t-s\tsqueeze multiple output characters of STRING2 into one character\n"
45#endif
46;
47
48
49
50#ifdef TRUE 37#ifdef TRUE
51#undef TRUE 38#undef TRUE
52#undef FALSE 39#undef FALSE
diff --git a/tty.c b/tty.c
index f3c7fb74f..bbc051f6b 100644
--- a/tty.c
+++ b/tty.c
@@ -24,14 +24,6 @@
24#include <stdio.h> 24#include <stdio.h>
25#include <sys/types.h> 25#include <sys/types.h>
26 26
27static const char tty_usage[] = "tty\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nPrint the file name of the terminal connected to standard input.\n\n"
30 "Options:\n"
31 "\t-s\tprint nothing, only return an exit status\n"
32#endif
33 ;
34
35extern int tty_main(int argc, char **argv) 27extern int tty_main(int argc, char **argv)
36{ 28{
37 char *tty; 29 char *tty;
diff --git a/umount.c b/umount.c
index 1b250fd3a..df075f7d9 100644
--- a/umount.c
+++ b/umount.c
@@ -39,28 +39,6 @@ extern int mount (__const char *__special_file, __const char *__dir,
39extern int umount (__const char *__special_file); 39extern int umount (__const char *__special_file);
40extern int umount2 (__const char *__special_file, int __flags); 40extern int umount2 (__const char *__special_file, int __flags);
41 41
42
43
44static const char umount_usage[] =
45 "umount [flags] filesystem|directory\n"
46#ifndef BB_FEATURE_TRIVIAL_HELP
47 "Unmount file systems\n"
48 "\nFlags:\n" "\t-a:\tUnmount all file systems"
49#ifdef BB_MTAB
50 " in /etc/mtab\n\t-n:\tDon't erase /etc/mtab entries\n"
51#else
52 "\n"
53#endif
54 "\t-r:\tTry to remount devices as read-only if mount is busy\n"
55#if defined BB_FEATURE_MOUNT_FORCE
56 "\t-f:\tForce filesystem umount (i.e. unreachable NFS server)\n"
57#endif
58#if defined BB_FEATURE_MOUNT_LOOP
59 "\t-l:\tDo not free loop device (if a loop device has been used)\n"
60#endif
61#endif
62;
63
64struct _mtab_entry_t { 42struct _mtab_entry_t {
65 char *device; 43 char *device;
66 char *mountpt; 44 char *mountpt;
diff --git a/uname.c b/uname.c
index b7c88ece5..55616dd19 100644
--- a/uname.c
+++ b/uname.c
@@ -40,24 +40,6 @@
40# include <sys/systeminfo.h> 40# include <sys/systeminfo.h>
41#endif 41#endif
42 42
43
44static const char uname_usage[] =
45 "uname [OPTION]...\n"
46#ifndef BB_FEATURE_TRIVIAL_HELP
47 "\nPrint certain system information. With no OPTION, same as -s.\n\n"
48 "Options:\n"
49 "\t-a\tprint all information\n"
50 "\t-m\tthe machine (hardware) type\n"
51 "\t-n\tprint the machine's network node hostname\n"
52 "\t-r\tprint the operating system release\n"
53 "\t-s\tprint the operating system name\n"
54
55 "\t-p\tprint the host processor type\n"
56 "\t-v\tprint the operating system version\n"
57#endif
58 ;
59
60
61static void print_element(unsigned int mask, char *element); 43static void print_element(unsigned int mask, char *element);
62 44
63/* Values that are bitwise or'd into `toprint'. */ 45/* Values that are bitwise or'd into `toprint'. */
diff --git a/uniq.c b/uniq.c
index 16b257670..016fc7780 100644
--- a/uniq.c
+++ b/uniq.c
@@ -27,14 +27,6 @@
27#include <string.h> 27#include <string.h>
28#include <errno.h> 28#include <errno.h>
29 29
30static const char uniq_usage[] =
31 "uniq [OPTION]... [INPUT [OUTPUT]]\n"
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\nDiscard all but one of successive identical lines from INPUT\n"
34 "(or standard input), writing to OUTPUT (or standard output).\n"
35#endif
36 ;
37
38/* max chars in line */ 30/* max chars in line */
39#define UNIQ_MAX 4096 31#define UNIQ_MAX 4096
40 32
@@ -187,4 +179,4 @@ int uniq_main(int argc, char **argv)
187 return(0); 179 return(0);
188} 180}
189 181
190/* $Id: uniq.c,v 1.12 2000/07/14 01:51:25 kraai Exp $ */ 182/* $Id: uniq.c,v 1.13 2000/07/16 20:57:15 kraai Exp $ */
diff --git a/update.c b/update.c
index f94346172..0bdc90eaa 100644
--- a/update.c
+++ b/update.c
@@ -34,18 +34,6 @@
34static _syscall2(int, bdflush, int, func, int, data); 34static _syscall2(int, bdflush, int, func, int, data);
35#endif /* __GLIBC__ */ 35#endif /* __GLIBC__ */
36 36
37
38static char update_usage[] =
39 "update [options]\n"
40#ifndef BB_FEATURE_TRIVIAL_HELP
41 "\nPeriodically flushes filesystem buffers.\n\n"
42 "Options:\n"
43 "\t-S\tforce use of sync(2) instead of flushing\n"
44 "\t-s SECS\tcall sync this often (default 30)\n"
45 "\t-f SECS\tflush some buffers this often (default 5)\n"
46#endif
47 ;
48
49static unsigned int sync_duration = 30; 37static unsigned int sync_duration = 30;
50static unsigned int flush_duration = 5; 38static unsigned int flush_duration = 5;
51static int use_sync = 0; 39static int use_sync = 0;
diff --git a/usage.c b/usage.c
new file mode 100644
index 000000000..d5a34ec28
--- /dev/null
+++ b/usage.c
@@ -0,0 +1,1204 @@
1#include "internal.h"
2
3#if defined BB_AR
4const char ar_usage[] =
5 "ar [optxvV] archive [filenames] \n"
6#ifndef BB_FEATURE_TRIVIAL_HELP
7 "\nExtract or list files from an ar archive.\n\n"
8 "Options:\n"
9 "\to\t\tpreserve original dates\n"
10 "\tp\t\textract to stdout\n"
11 "\tt\t\tlist\n"
12 "\tx\t\textract\n"
13 "\tv\t\tverbosely list files processed\n"
14#endif
15 ;
16#endif
17
18#if defined BB_BASENAME
19const char basename_usage[] =
20 "basename FILE [SUFFIX]\n"
21#ifndef BB_FEATURE_TRIVIAL_HELP
22 "\nStrips directory path and suffixes from FILE.\n"
23 "If specified, also removes any trailing SUFFIX.\n"
24#endif
25 ;
26#endif
27
28#if defined BB_CAT
29const char cat_usage[] =
30 "cat [FILE]...\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nConcatenates FILE(s) and prints them to stdout.\n"
33#endif
34 ;
35#endif
36
37#if defined BB_CHMOD_CHOWN_CHGRP
38const char chgrp_usage[] =
39 "chgrp [OPTION]... GROUP FILE...\n"
40#ifndef BB_FEATURE_TRIVIAL_HELP
41 "\nChange the group membership of each FILE to GROUP.\n"
42 "\nOptions:\n\t-R\tChanges files and directories recursively.\n"
43#endif
44 ;
45#endif
46
47#if defined BB_CHMOD_CHOWN_CHGRP
48const char chmod_usage[] =
49 "chmod [-R] MODE[,MODE]... FILE...\n"
50#ifndef BB_FEATURE_TRIVIAL_HELP
51 "\nEach MODE is one or more of the letters ugoa, one of the symbols +-= and\n"
52 "one or more of the letters rwxst.\n\n"
53 "\nOptions:\n\t-R\tChanges files and directories recursively.\n"
54#endif
55 ;
56#endif
57
58#if defined BB_CHMOD_CHOWN_CHGRP
59const char chown_usage[] =
60 "chown [OPTION]... OWNER[<.|:>[GROUP] FILE...\n"
61#ifndef BB_FEATURE_TRIVIAL_HELP
62 "\nChange the owner and/or group of each FILE to OWNER and/or GROUP.\n"
63 "\nOptions:\n\t-R\tChanges files and directories recursively.\n"
64#endif
65 ;
66#endif
67
68#if defined BB_CHROOT
69const char chroot_usage[] =
70 "chroot NEWROOT [COMMAND...]\n"
71#ifndef BB_FEATURE_TRIVIAL_HELP
72 "\nRun COMMAND with root directory set to NEWROOT.\n"
73#endif
74 ;
75#endif
76
77#if defined BB_CHVT
78const char chvt_usage[] =
79 "chvt N\n"
80#ifndef BB_FEATURE_TRIVIAL_HELP
81 "\nChanges the foreground virtual terminal to /dev/ttyN\n"
82#endif
83 ;
84#endif
85
86#if defined BB_CP_MV
87const char cp_usage[] =
88 "cp [OPTION]... SOURCE DEST\n"
89 " or: cp [OPTION]... SOURCE... DIRECTORY\n"
90#ifndef BB_FEATURE_TRIVIAL_HELP
91 "\nCopies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n"
92 "\n"
93 "\t-a\tSame as -dpR\n"
94 "\t-d\tPreserves links\n"
95 "\t-p\tPreserves file attributes if possible\n"
96 "\t-f\tforce (implied; ignored) - always set\n"
97 "\t-R\tCopies directories recursively\n"
98#endif
99 ;
100#endif
101
102#if defined BB_CUT
103const char cut_usage[] =
104 "cut [OPTION]... [FILE]...\n"
105#ifndef BB_FEATURE_TRIVIAL_HELP
106 "\nPrints selected fields from each input FILE to standard output.\n\n"
107 "Options:\n"
108 "\t-b LIST\tOutput only bytes from LIST\n"
109 "\t-c LIST\tOutput only characters from LIST\n"
110 "\t-d CHAR\tUse CHAR instead of tab as the field delimiter\n"
111 "\t-s\tOnly output Lines if the include DELIM\n"
112 "\t-f N\tPrint only these fields\n"
113 "\t-n\tIgnored\n"
114#endif
115 ;
116#endif
117
118#if defined BB_DATE
119const char date_usage[] =
120 "date [OPTION]... [+FORMAT]\n"
121 " or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]\n"
122#ifndef BB_FEATURE_TRIVIAL_HELP
123 "\nDisplays the current time in the given FORMAT, or sets the system date.\n"
124 "\nOptions:\n\t-R\tOutputs RFC-822 compliant date string\n"
125 "\t-s\tSets time described by STRING\n"
126 "\t-u\tPrints or sets Coordinated Universal Time\n"
127#endif
128 ;
129#endif
130
131#if defined BB_DC
132const char dc_usage[] =
133 "dc expression ...\n"
134#ifndef BB_FEATURE_TRIVIAL_HELP
135 "\nThis is a Tiny RPN calculator that understands the\n"
136 "following operations: +, -, /, *, and, or, not, eor.\n"
137 "i.e. 'dc 2 2 add' -> 4, and 'dc 8 8 \\* 2 2 + /' -> 16\n"
138#endif
139 ;
140#endif
141
142#if defined BB_DD
143const char dd_usage[] =
144 "dd [if=FILE] [of=FILE] [bs=N] [count=N] [skip=N] [seek=N]\n"
145#ifndef BB_FEATURE_TRIVIAL_HELP
146 "\nCopy a file, converting and formatting according to options\n\n"
147 "\tif=FILE\tread from FILE instead of stdin\n"
148 "\tof=FILE\twrite to FILE instead of stdout\n"
149 "\tbs=N\tread and write N bytes at a time\n"
150 "\tcount=N\tcopy only N input blocks\n"
151 "\tskip=N\tskip N input blocks\n"
152 "\tseek=N\tskip N output blocks\n"
153 "\n"
154 "Numbers may be suffixed by w (x2), k (x1024), b (x512), or M (x1024^2)\n"
155#endif
156 ;
157#endif
158
159#if defined BB_DEALLOCVT
160const char deallocvt_usage[] =
161 "deallocvt N\n"
162#ifndef BB_FEATURE_TRIVIAL_HELP
163 "\nDeallocate unused virtual terminal /dev/ttyN\n"
164#endif
165 ;
166#endif
167
168#if defined BB_DF
169const char df_usage[] =
170 "df [filesystem ...]\n"
171#ifndef BB_FEATURE_TRIVIAL_HELP
172 "\nPrint the filesystem space used and space available.\n"
173#endif
174 ;
175#endif
176
177#if defined BB_DIRNAME
178const char dirname_usage[] =
179 "dirname [FILENAME ...]\n"
180#ifndef BB_FEATURE_TRIVIAL_HELP
181 "\nStrips non-directory suffix from FILENAME\n"
182#endif
183 ;
184#endif
185
186#if defined BB_DMESG
187const char dmesg_usage[] =
188 "dmesg [-c] [-n LEVEL] [-s SIZE]\n"
189#ifndef BB_FEATURE_TRIVIAL_HELP
190 "\nPrints or controls the kernel ring buffer\n\n"
191 "Options:\n"
192 "\t-c\t\tClears the ring buffer's contents after printing\n"
193 "\t-n LEVEL\tSets console logging level\n"
194 "\t-s SIZE\t\tUse a buffer of size SIZE\n"
195#endif
196 ;
197#endif
198
199#if defined BB_DU
200const char du_usage[] =
201 "du [OPTION]... [FILE]...\n"
202#ifndef BB_FEATURE_TRIVIAL_HELP
203 "\nSummarizes disk space used for each FILE and/or directory.\n"
204 "Disk space is printed in units of 1024 bytes.\n\n"
205 "Options:\n"
206 "\t-l\tcount sizes many times if hard linked\n"
207 "\t-s\tdisplay only a total for each argument\n"
208#endif
209 ;
210#endif
211
212#if defined BB_DUMPKMAP
213const char dumpkmap_usage[] =
214 "dumpkmap\n"
215#ifndef BB_FEATURE_TRIVIAL_HELP
216 "\nPrints out a binary keyboard translation table to standard input.\n"
217#endif
218 ;
219#endif
220
221#if defined BB_DUTMP
222const char dutmp_usage[] =
223 "dutmp [FILE]\n"
224#ifndef BB_FEATURE_TRIVIAL_HELP
225 "\nDump utmp file format (pipe delimited) from FILE\n"
226 "or stdin to stdout. (i.e. 'dutmp /var/run/utmp')\n"
227#endif
228 ;
229#endif
230
231#if defined BB_ECHO
232const char echo_usage[] =
233 "echo [-neE] [ARG ...]\n"
234#ifndef BB_FEATURE_TRIVIAL_HELP
235 "\nPrints the specified ARGs to stdout\n\n"
236 "Options:\n"
237 "\t-n\tsuppress trailing newline\n"
238 "\t-e\tinterpret backslash-escaped characters (i.e. \\t=tab etc)\n"
239 "\t-E\tdisable interpretation of backslash-escaped characters\n"
240#endif
241 ;
242#endif
243
244#if defined BB_FDFLUSH
245const char fdflush_usage[] =
246 "fdflush DEVICE\n"
247#ifndef BB_FEATURE_TRIVIAL_HELP
248 "\nForces floppy disk drive to detect disk change\n"
249#endif
250 ;
251#endif
252
253#if defined BB_FIND
254const char find_usage[] =
255 "find [PATH...] [EXPRESSION]\n"
256#ifndef BB_FEATURE_TRIVIAL_HELP
257 "\nSearch for files in a directory hierarchy. The default PATH is\n"
258 "the current directory; default EXPRESSION is '-print'\n\n"
259 "\nEXPRESSION may consist of:\n"
260 "\t-follow\t\tDereference symbolic links.\n"
261 "\t-name PATTERN\tFile name (leading directories removed) matches PATTERN.\n"
262 "\t-print\t\tprint the full file name followed by a newline to stdout.\n"
263#endif
264 ;
265#endif
266
267#if defined BB_FREE
268const char free_usage[] =
269 "free\n"
270#ifndef BB_FEATURE_TRIVIAL_HELP
271 "\nDisplays the amount of free and used system memory\n"
272#endif
273 ;
274#endif
275
276#if defined BB_FREERAMDISK
277const char freeramdisk_usage[] =
278 "freeramdisk DEVICE\n"
279#ifndef BB_FEATURE_TRIVIAL_HELP
280 "\nFrees all memory used by the specified ramdisk.\n"
281#endif
282 ;
283#endif
284
285#if defined BB_FSCK_MINIX
286const char fsck_minix_usage[] =
287 "Usage: fsck.minix [-larvsmf] /dev/name\n"
288#ifndef BB_FEATURE_TRIVIAL_HELP
289 "\nPerforms a consistency check for MINIX filesystems.\n\n"
290 "Options:\n"
291 "\t-l\tLists all filenames\n"
292 "\t-r\tPerform interactive repairs\n"
293 "\t-a\tPerform automatic repairs\n"
294 "\t-v\tverbose\n"
295 "\t-s\tOutputs super-block information\n"
296 "\t-m\tActivates MINIX-like \"mode not cleared\" warnings\n"
297 "\t-f\tForce file system check.\n\n"
298#endif
299 ;
300#endif
301
302#if defined BB_GREP
303const char grep_usage[] =
304 "grep [-ihHnqvs] pattern [files...]\n"
305#ifndef BB_FEATURE_TRIVIAL_HELP
306 "\nSearch for PATTERN in each FILE or standard input.\n\n"
307 "Options:\n"
308 "\t-H\tprefix output lines with filename where match was found\n"
309 "\t-h\tsuppress the prefixing filename on output\n"
310 "\t-i\tignore case distinctions\n"
311 "\t-n\tprint line number with output lines\n"
312 "\t-q\tbe quiet. Returns 0 if result was found, 1 otherwise\n"
313 "\t-v\tselect non-matching lines\n"
314 "\t-s\tsuppress file open/read error messages\n\n"
315#endif
316 ;
317#endif
318
319#if defined BB_GUNZIP
320const char gunzip_usage[] =
321 "gunzip [OPTION]... FILE\n"
322#ifndef BB_FEATURE_TRIVIAL_HELP
323 "\nUncompress FILE (or standard input if FILE is '-').\n\n"
324 "Options:\n"
325 "\t-c\tWrite output to standard output\n"
326 "\t-t\tTest compressed file integrity\n"
327#endif
328 ;
329#endif
330
331#if defined BB_GZIP
332const char gzip_usage[] =
333 "gzip [OPTION]... FILE\n"
334#ifndef BB_FEATURE_TRIVIAL_HELP
335 "\nCompress FILE with maximum compression.\n"
336 "When FILE is '-', reads standard input. Implies -c.\n\n"
337 "Options:\n"
338 "\t-c\tWrite output to standard output instead of FILE.gz\n"
339#endif
340 ;
341#endif
342
343#if defined BB_HEAD
344const char head_usage[] =
345 "head [OPTION] [FILE]...\n"
346#ifndef BB_FEATURE_TRIVIAL_HELP
347 "\nPrint first 10 lines of each FILE to standard output.\n"
348 "With more than one FILE, precede each with a header giving the\n"
349 "file name. With no FILE, or when FILE is -, read standard input.\n\n"
350
351 "Options:\n" "\t-n NUM\t\tPrint first NUM lines instead of first 10\n"
352#endif
353 ;
354#endif
355
356#if defined BB_HOSTNAME
357const char hostname_usage[] =
358 "hostname [OPTION] {hostname | -F file}\n"
359#ifndef BB_FEATURE_TRIVIAL_HELP
360 "\nGet or set the hostname or DNS domain name. If a hostname is given\n"
361 "(or a file with the -F parameter), the host name will be set.\n\n"
362 "Options:\n"
363 "\t-s\t\tShort\n"
364
365 "\t-i\t\tAddresses for the hostname\n"
366 "\t-d\t\tDNS domain name\n"
367 "\t-F FILE\t\tUse the contents of FILE to specify the hostname\n"
368#endif
369 ;
370#endif
371
372#if defined BB_ID
373const char id_usage[] =
374 "id [OPTIONS]... [USERNAME]\n"
375#ifndef BB_FEATURE_TRIVIAL_HELP
376 "\nPrint information for USERNAME or the current user\n\n"
377 "Options:\n"
378 "\t-g\tprints only the group ID\n"
379 "\t-u\tprints only the user ID\n"
380 "\t-r\tprints the real user ID instead of the effective ID (with -ug)\n\n"
381#endif
382 ;
383#endif
384
385#if defined BB_INSMOD
386const char insmod_usage[] =
387 "insmod [OPTION]... MODULE [symbol=value]...\n"
388#ifndef BB_FEATURE_TRIVIAL_HELP
389 "\nLoads the specified kernel modules into the kernel.\n\n"
390 "Options:\n"
391 "\t-f\tForce module to load into the wrong kernel version.\n"
392 "\t-k\tMake module autoclean-able.\n"
393 "\t-v\tverbose output\n" "\t-x\tdo not export externs\n"
394#endif
395 ;
396#endif
397
398#if defined BB_KILL
399const char kill_usage[] =
400 "kill [-signal] process-id [process-id ...]\n"
401#ifndef BB_FEATURE_TRIVIAL_HELP
402 "\nSend a signal (default is SIGTERM) to the specified process(es).\n\n"
403 "Options:\n" "\t-l\tList all signal names and numbers.\n\n"
404#endif
405 ;
406#endif
407
408#if defined BB_KILLALL
409const char killall_usage[] =
410 "killall [-signal] process-name [process-name ...]\n"
411#ifndef BB_FEATURE_TRIVIAL_HELP
412 "\nSend a signal (default is SIGTERM) to the specified process(es).\n\n"
413 "Options:\n" "\t-l\tList all signal names and numbers.\n\n"
414#endif
415 ;
416#endif
417
418#if defined BB_LENGTH
419const char length_usage[] =
420 "length STRING\n"
421#ifndef BB_FEATURE_TRIVIAL_HELP
422 "\nPrints out the length of the specified STRING.\n"
423#endif
424 ;
425#endif
426
427#if defined BB_LN
428const char ln_usage[] =
429 "ln [OPTION] TARGET... LINK_NAME|DIRECTORY\n"
430#ifndef BB_FEATURE_TRIVIAL_HELP
431 "\nCreate a link named LINK_NAME or DIRECTORY to the specified TARGET\n"
432 "\nYou may use '--' to indicate that all following arguments are non-options.\n\n"
433 "Options:\n"
434 "\t-s\tmake symbolic links instead of hard links\n"
435
436 "\t-f\tremove existing destination files\n"
437 "\t-n\tno dereference symlinks - treat like normal file\n"
438#endif
439 ;
440#endif
441
442#if defined BB_LOADACM
443const char loadacm_usage[] =
444 "loadacm\n"
445#ifndef BB_FEATURE_TRIVIAL_HELP
446 "\nLoads an acm from standard input.\n"
447#endif
448 ;
449#endif
450
451#if defined BB_LOADFONT
452const char loadfont_usage[] =
453 "loadfont\n"
454#ifndef BB_FEATURE_TRIVIAL_HELP
455 "Loads a console font from standard input.\n"
456#endif
457 ;
458#endif
459
460#if defined BB_LOADKMAP
461const char loadkmap_usage[] =
462 "loadkmap\n"
463#ifndef BB_FEATURE_TRIVIAL_HELP
464 "\nLoads a binary keyboard translation table from standard input.\n"
465#endif
466 ;
467#endif
468
469#if defined BB_LOGGER
470const char logger_usage[] =
471 "logger [OPTION]... [MESSAGE]\n"
472#ifndef BB_FEATURE_TRIVIAL_HELP
473 "\nWrite MESSAGE to the system log. If MESSAGE is '-', log stdin.\n\n"
474 "Options:\n"
475 "\t-s\tLog to stderr as well as the system log.\n"
476 "\t-t\tLog using the specified tag (defaults to user name).\n"
477
478 "\t-p\tEnter the message with the specified priority.\n"
479 "\t\tThis may be numerical or a ``facility.level'' pair.\n"
480#endif
481 ;
482#endif
483
484#if defined BB_LOGNAME
485const char logname_usage[] =
486 "logname\n"
487#ifndef BB_FEATURE_TRIVIAL_HELP
488 "\nPrint the name of the current user.\n"
489#endif
490 ;
491#endif
492
493#if defined BB_LS
494const char ls_usage[] =
495 "ls [-1a"
496#ifdef BB_FEATURE_LS_TIMESTAMPS
497 "c"
498#endif
499 "d"
500#ifdef BB_FEATURE_LS_TIMESTAMPS
501 "e"
502#endif
503 "ln"
504#ifdef BB_FEATURE_LS_FILETYPES
505 "p"
506#endif
507#ifdef BB_FEATURE_LS_TIMESTAMPS
508 "u"
509#endif
510 "xAC"
511#ifdef BB_FEATURE_LS_FILETYPES
512 "F"
513#endif
514#ifdef BB_FEATURE_LS_RECURSIVE
515 "R"
516#endif
517 "] [filenames...]\n"
518#ifndef BB_FEATURE_TRIVIAL_HELP
519 "\nList directory contents\n\n"
520 "Options:\n"
521 "\t-a\tdo not hide entries starting with .\n"
522#ifdef BB_FEATURE_LS_TIMESTAMPS
523 "\t-c\twith -l: show ctime (the time of last\n"
524 "\t\tmodification of file status information)\n"
525#endif
526 "\t-d\tlist directory entries instead of contents\n"
527#ifdef BB_FEATURE_LS_TIMESTAMPS
528 "\t-e\tlist both full date and full time\n"
529#endif
530 "\t-l\tuse a long listing format\n"
531 "\t-n\tlist numeric UIDs and GIDs instead of names\n"
532#ifdef BB_FEATURE_LS_FILETYPES
533 "\t-p\tappend indicator (one of /=@|) to entries\n"
534#endif
535#ifdef BB_FEATURE_LS_TIMESTAMPS
536 "\t-u\twith -l: show access time (the time of last\n"
537 "\t\taccess of the file)\n"
538#endif
539 "\t-x\tlist entries by lines instead of by columns\n"
540 "\t-A\tdo not list implied . and ..\n"
541 "\t-C\tlist entries by columns\n"
542#ifdef BB_FEATURE_LS_FILETYPES
543 "\t-F\tappend indicator (one of */=@|) to entries\n"
544#endif
545#ifdef BB_FEATURE_LS_RECURSIVE
546 "\t-R\tlist subdirectories recursively\n"
547#endif
548#endif
549 ;
550#endif
551
552#if defined BB_MAKEDEVS
553const char makedevs_usage[] =
554 "makedevs NAME TYPE MAJOR MINOR FIRST LAST [s]\n"
555#ifndef BB_FEATURE_TRIVIAL_HELP
556 "\nCreates a range of block or character special files\n\n"
557 "TYPEs include:\n"
558 "\tb:\tMake a block (buffered) device.\n"
559 "\tc or u:\tMake a character (un-buffered) device.\n"
560 "\tp:\tMake a named pipe. MAJOR and MINOR are ignored for named pipes.\n\n"
561 "FIRST specifies the number appended to NAME to create the first device.\n"
562 "LAST specifies the number of the last item that should be created.\n"
563 "If 's' is the last argument, the base device is created as well.\n\n"
564 "For example:\n"
565 "\tmakedevs /dev/ttyS c 4 66 2 63 -> ttyS2-ttyS63\n"
566 "\tmakedevs /dev/hda b 3 0 0 8 s -> hda,hda1-hda8\n"
567#endif
568 ;
569#endif
570
571#if defined BB_MD5SUM
572const char md5sum_usage[] =
573 "md5sum [OPTION] [FILE]...\n"
574 "or: md5sum [OPTION] -c [FILE]\n"
575#ifndef BB_FEATURE_TRIVIAL_HELP
576 "\nPrint or check MD5 checksums.\n\n"
577 "Options:\n"
578 "With no FILE, or when FILE is -, read standard input.\n\n"
579 "\t-b\tread files in binary mode\n"
580 "\t-c\tcheck MD5 sums against given list\n"
581 "\t-t\tread files in text mode (default)\n"
582 "\t-g\tread a string\n"
583 "\nThe following two options are useful only when verifying checksums:\n"
584 "\t-s,\tdon't output anything, status code shows success\n"
585 "\t-w,\twarn about improperly formated MD5 checksum lines\n"
586#endif
587 ;
588#endif
589
590#if defined BB_MKDIR
591const char mkdir_usage[] =
592 "mkdir [OPTION] DIRECTORY...\n"
593#ifndef BB_FEATURE_TRIVIAL_HELP
594 "\nCreate the DIRECTORY(ies), if they do not already exist\n\n"
595 "Options:\n"
596
597 "\t-m\tset permission mode (as in chmod), not rwxrwxrwx - umask\n"
598 "\t-p\tno error if existing, make parent directories as needed\n"
599#endif
600 ;
601#endif
602
603#if defined BB_MKFIFO
604const char mkfifo_usage[] =
605 "mkfifo [OPTIONS] name\n"
606#ifndef BB_FEATURE_TRIVIAL_HELP
607 "\nCreates a named pipe (identical to 'mknod name p')\n\n"
608 "Options:\n"
609 "\t-m\tcreate the pipe using the specified mode (default a=rw)\n"
610#endif
611 ;
612#endif
613
614#if defined BB_MKFS_MINIX
615const char mkfs_minix_usage[] =
616 "mkfs.minix [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n"
617#ifndef BB_FEATURE_TRIVIAL_HELP
618 "\nMake a MINIX filesystem.\n\n"
619 "Options:\n"
620 "\t-c\t\tCheck the device for bad blocks\n"
621 "\t-n [14|30]\tSpecify the maximum length of filenames\n"
622 "\t-i INODES\tSpecify the number of inodes for the filesystem\n"
623 "\t-l FILENAME\tRead the bad blocks list from FILENAME\n"
624 "\t-v\t\tMake a Minix version 2 filesystem\n\n"
625#endif
626 ;
627#endif
628
629#if defined BB_MKNOD
630const char mknod_usage[] =
631 "mknod [OPTIONS] NAME TYPE MAJOR MINOR\n"
632#ifndef BB_FEATURE_TRIVIAL_HELP
633 "\nCreate a special file (block, character, or pipe).\n\n"
634 "Options:\n"
635 "\t-m\tcreate the special file using the specified mode (default a=rw)\n\n"
636 "TYPEs include:\n"
637 "\tb:\tMake a block (buffered) device.\n"
638 "\tc or u:\tMake a character (un-buffered) device.\n"
639 "\tp:\tMake a named pipe. MAJOR and MINOR are ignored for named pipes.\n"
640#endif
641 ;
642#endif
643
644#if defined BB_MKSWAP
645const char mkswap_usage[] =
646 "mkswap [-c] [-v0|-v1] device [block-count]\n"
647#ifndef BB_FEATURE_TRIVIAL_HELP
648 "\nPrepare a disk partition to be used as a swap partition.\n\n"
649 "Options:\n" "\t-c\t\tCheck for read-ability.\n"
650 "\t-v0\t\tMake version 0 swap [max 128 Megs].\n"
651 "\t-v1\t\tMake version 1 swap [big!] (default for kernels > 2.1.117).\n"
652
653 "\tblock-count\tNumber of block to use (default is entire partition).\n"
654#endif
655 ;
656#endif
657
658#if defined BB_MKTEMP
659const char mktemp_usage[] =
660 "mktemp [-q] TEMPLATE\n"
661#ifndef BB_FEATURE_TRIVIAL_HELP
662 "\nCreates a temporary file with its name based on TEMPLATE.\n"
663 "TEMPLATE is any name with six `Xs' (i.e. /tmp/temp.XXXXXX).\n"
664#endif
665 ;
666#endif
667
668#if defined BB_MORE
669const char more_usage[] =
670 "more [FILE ...]\n"
671#ifndef BB_FEATURE_TRIVIAL_HELP
672 "\nMore is a filter for viewing FILE one screenful at a time.\n"
673#endif
674 ;
675#endif
676
677#if defined BB_MOUNT
678const char mount_usage[] =
679 "mount [flags] device directory [-o options,more-options]\n"
680#ifndef BB_FEATURE_TRIVIAL_HELP
681 "\nMount a filesystem\n\n"
682 "Flags:\n"
683 "\t-a:\t\tMount all filesystems in fstab.\n"
684#ifdef BB_MTAB
685 "\t-f:\t\t\"Fake\" mount. Add entry to mount table but don't mount it.\n"
686 "\t-n:\t\tDon't write a mount table entry.\n"
687#endif
688 "\t-o option:\tOne of many filesystem options, listed below.\n"
689 "\t-r:\t\tMount the filesystem read-only.\n"
690 "\t-t fs-type:\tSpecify the filesystem type.\n"
691 "\t-w:\t\tMount for reading and writing (default).\n"
692 "\n"
693 "Options for use with the \"-o\" flag:\n"
694 "\tasync/sync:\tWrites are asynchronous / synchronous.\n"
695 "\tatime/noatime:\tEnable / disable updates to inode access times.\n"
696 "\tdev/nodev:\tAllow use of special device files / disallow them.\n"
697 "\texec/noexec:\tAllow use of executable files / disallow them.\n"
698#if defined BB_FEATURE_MOUNT_LOOP
699 "\tloop:\t\tMounts a file via loop device.\n"
700#endif
701 "\tsuid/nosuid:\tAllow set-user-id-root programs / disallow them.\n"
702 "\tremount:\tRe-mount a currently-mounted filesystem, changing its flags.\n"
703 "\tro/rw:\t\tMount for read-only / read-write.\n"
704 "\nThere are EVEN MORE flags that are specific to each filesystem.\n"
705 "You'll have to see the written documentation for those.\n"
706#endif
707 ;
708#endif
709
710#if defined BB_MT
711const char mt_usage[] =
712 "mt [-f device] opcode value\n"
713#ifndef BB_FEATURE_TRIVIAL_HELP
714 "\nControl magnetic tape drive operation\n"
715#endif
716 ;
717#endif
718
719#if defined BB_CP_MV
720const char mv_usage[] =
721 "mv SOURCE DEST\n"
722 " or: mv SOURCE... DIRECTORY\n"
723#ifndef BB_FEATURE_TRIVIAL_HELP
724 "\nRename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n"
725#endif
726 ;
727#endif
728
729#if defined BB_NC
730const char nc_usage[] =
731 "nc [IP] [port]\n"
732#ifndef BB_FEATURE_TRIVIAL_HELP
733 "\nNetcat opens a pipe to IP:port\n"
734#endif
735 ;
736#endif
737
738#if defined BB_NSLOOKUP
739const char nslookup_usage[] =
740 "nslookup [HOST]\n"
741#ifndef BB_FEATURE_TRIVIAL_HELP
742 "\nQueries the nameserver for the IP address of the given HOST\n"
743#endif
744;
745#endif
746
747#if defined BB_PING
748#if defined BB_FEATURE_SIMPLE_PING
749const char ping_usage[] =
750 "ping host\n"
751#ifndef BB_FEATURE_TRIVIAL_HELP
752 "\nSend ICMP ECHO_REQUEST packets to network hosts\n"
753#endif
754 ;
755#else /* ! defined BB_FEATURE_SIMPLE_PING */
756const char ping_usage[] =
757 "ping [OPTION]... host\n"
758#ifndef BB_FEATURE_TRIVIAL_HELP
759 "\nSend ICMP ECHO_REQUEST packets to network hosts.\n\n"
760 "Options:\n"
761 "\t-c COUNT\tSend only COUNT pings.\n"
762 "\t-s SIZE\t\tSend SIZE data bytes in packets (default=56).\n"
763 "\t-q\t\tQuiet mode, only displays output at start\n"
764 "\t\t\tand when finished.\n"
765#endif
766 ;
767#endif
768#endif
769
770#if defined BB_PRINTF
771const char printf_usage[] =
772 "printf FORMAT [ARGUMENT...]\n"
773#ifndef BB_FEATURE_TRIVIAL_HELP
774 "\nFormats and prints ARGUMENT(s) according to FORMAT,\n"
775 "Where FORMAT controls the output exactly as in C printf.\n"
776#endif
777 ;
778#endif
779
780#if defined BB_PS
781const char ps_usage[] =
782 "ps\n"
783#ifndef BB_FEATURE_TRIVIAL_HELP
784 "\nReport process status\n"
785 "\nThis version of ps accepts no options.\n"
786#endif
787 ;
788#endif
789
790#if defined BB_RM
791const char rm_usage[] =
792 "rm [OPTION]... FILE...\n"
793#ifndef BB_FEATURE_TRIVIAL_HELP
794 "\nRemove (unlink) the FILE(s). You may use '--' to\n"
795 "indicate that all following arguments are non-options.\n\n"
796 "Options:\n"
797 "\t-f\t\tremove existing destinations, never prompt\n"
798 "\t-r or -R\tremove the contents of directories recursively\n"
799#endif
800 ;
801#endif
802
803#if defined BB_RMDIR
804const char rmdir_usage[] =
805 "rmdir [OPTION]... DIRECTORY...\n"
806#ifndef BB_FEATURE_TRIVIAL_HELP
807 "\nRemove the DIRECTORY(ies), if they are empty.\n"
808#endif
809 ;
810#endif
811
812#if defined BB_RMMOD
813const char rmmod_usage[] =
814 "rmmod [OPTION]... [MODULE]...\n"
815#ifndef BB_FEATURE_TRIVIAL_HELP
816 "\nUnloads the specified kernel modules from the kernel.\n\n"
817 "Options:\n"
818 "\t-a\tTry to remove all unused kernel modules.\n"
819#endif
820 ;
821#endif
822
823#if defined BB_SED
824const char sed_usage[] =
825 "sed [-Vhnef] pattern [files...]\n"
826#ifndef BB_FEATURE_TRIVIAL_HELP
827 "\n"
828 "-n\tsuppress automatic printing of pattern space\n"
829 "-e script\tadd the script to the commands to be executed\n"
830 "-f scriptfile\tadd the contents of script-file to the commands to be executed\n"
831 "-h\tdisplay this help message\n"
832 "-V\toutput version information and exit\n"
833 "\n"
834 "If no -e or -f is given, the first non-option argument is taken as the\n"
835 "sed script to interpret. All remaining arguments are names of input\n"
836 "files; if no input files are specified, then the standard input is read.\n"
837#endif
838 ;
839#endif
840
841#if defined BB_SETKEYCODES
842const char setkeycodes_usage[] =
843 "setkeycodes SCANCODE KEYCODE ...\n"
844#ifndef BB_FEATURE_TRIVIAL_HELP
845 "\nSet entries into the kernel's scancode-to-keycode map,\n"
846 "allowing unusual keyboards to generate usable keycodes.\n\n"
847 "SCANCODE may be either xx or e0xx (hexadecimal),\n"
848 "and KEYCODE is given in decimal\n"
849#endif
850 ;
851#endif
852
853#if defined BB_SH
854const char shell_usage[] =
855 "sh [FILE]...\n"
856 " or: sh -c command [args]...\n"
857#ifndef BB_FEATURE_TRIVIAL_HELP
858 "\nlash: The BusyBox command interpreter (shell).\n\n"
859#endif
860 ;
861#endif
862
863#if defined BB_SLEEP
864const char sleep_usage[] =
865 "sleep N\n"
866#ifndef BB_FEATURE_TRIVIAL_HELP
867 "\nPause for N seconds.\n"
868#endif
869 ;
870#endif
871
872#if defined BB_SORT
873const char sort_usage[] =
874 "sort [-n]"
875#ifdef BB_FEATURE_SORT_REVERSE
876 " [-r]"
877#endif
878 " [FILE]...\n"
879#ifndef BB_FEATURE_TRIVIAL_HELP
880 "\nSorts lines of text in the specified files\n"
881#endif
882 ;
883#endif
884
885#if defined BB_SWAPONOFF
886const char swapoff_usage[] =
887 "swapoff [OPTION] [device]\n"
888#ifndef BB_FEATURE_TRIVIAL_HELP
889 "\nStop swapping virtual memory pages on the given device.\n\n"
890 "Options:\n"
891 "\t-a\tStop swapping on all swap devices\n"
892#endif
893 ;
894#endif
895
896#if defined BB_SWAPONOFF
897const char swapon_usage[] =
898 "swapon [OPTION] [device]\n"
899#ifndef BB_FEATURE_TRIVIAL_HELP
900 "\nStart swapping virtual memory pages on the given device.\n\n"
901 "Options:\n"
902 "\t-a\tStart swapping on all swap devices\n"
903#endif
904 ;
905#endif
906
907#if defined BB_SYNC
908const char sync_usage[] =
909 "sync\n"
910#ifndef BB_FEATURE_TRIVIAL_HELP
911 "\nWrite all buffered filesystem blocks to disk.\n"
912#endif
913 ;
914#endif
915
916#if defined BB_SYSLOGD
917const char syslogd_usage[] =
918 "syslogd [OPTION]...\n"
919#ifndef BB_FEATURE_TRIVIAL_HELP
920 "\nLinux system and kernel (provides klogd) logging utility.\n"
921 "Note that this version of syslogd/klogd ignores /etc/syslog.conf.\n\n"
922 "Options:\n"
923 "\t-m NUM\t\tInterval between MARK lines (default=20min, 0=off)\n"
924 "\t-n\t\tRun as a foreground process\n"
925#ifdef BB_FEATURE_KLOGD
926 "\t-K\t\tDo not start up the klogd process\n"
927#endif
928 "\t-O FILE\t\tUse an alternate log file (default=/var/log/messages)\n"
929#endif
930 ;
931#endif
932
933#if defined BB_TAIL
934#if defined BB_FEATURE_SIMPLE_TAIL
935const char tail_usage[] =
936 "tail [OPTION] [FILE]...\n"
937#ifndef BB_FEATURE_TRIVIAL_HELP
938 "\nPrint last 10 lines of each FILE to standard output.\n"
939 "With more than one FILE, precede each with a header giving the\n"
940 "file name. With no FILE, or when FILE is -, read standard input.\n\n"
941 "Options:\n"
942 "\t-n NUM\t\tPrint last NUM lines instead of first 10\n"
943
944 "\t-f\t\tOutput data as the file grows. This version\n"
945 "\t\t\tof 'tail -f' supports only one file at a time.\n"
946#endif
947 ;
948#else /* ! defined BB_FEATURE_SIMPLE_TAIL */
949const char tail_usage[] =
950 "tail [OPTION]... [FILE]...\n"
951#ifndef BB_FEATURE_TRIVIAL_HELP
952 "\nPrint last 10 lines of each FILE to standard output.\n"
953 "With more than one FILE, precede each with a header giving the file name.\n"
954 "With no FILE, or when FILE is -, read standard input.\n"
955 "\n"
956 " -c=N[kbm] output the last N bytes\n"
957 " -f output appended data as the file grows\n"
958 " -n=N output the last N lines, instead of last 10\n"
959 " -q never output headers giving file names\n"
960 " -v always output headers giving file names\n"
961 "\n"
962 "If the first character of N (bytes or lines) is a `+', output begins with \n"
963 "the Nth item from the start of each file, otherwise, print the last N items\n"
964 "in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2).\n"
965#endif
966 ;
967#endif
968#endif
969
970#if defined BB_TAR
971const char tar_usage[] =
972#ifdef BB_FEATURE_TAR_CREATE
973 "tar -[cxtvO] "
974#else
975 "tar -[xtvO] "
976#endif
977#if defined BB_FEATURE_TAR_EXCLUDE
978 "[--exclude File] "
979#endif
980 "[-f tarFile] [FILE] ...\n"
981#ifndef BB_FEATURE_TRIVIAL_HELP
982 "\nCreate, extract, or list files from a tar file. Note that\n"
983 "this version of tar treats hard links as separate files.\n\n"
984 "Main operation mode:\n"
985#ifdef BB_FEATURE_TAR_CREATE
986 "\tc\t\tcreate\n"
987#endif
988 "\tx\t\textract\n"
989 "\tt\t\tlist\n"
990 "\nFile selection:\n"
991 "\tf\t\tname of tarfile or \"-\" for stdin\n"
992 "\tO\t\textract to stdout\n"
993#if defined BB_FEATURE_TAR_EXCLUDE
994 "\t--exclude\tfile to exclude\n"
995#endif
996 "\nInformative output:\n"
997 "\tv\t\tverbosely list files processed\n"
998#endif
999 ;
1000#endif
1001
1002#if defined BB_TEE
1003const char tee_usage[] =
1004 "tee [OPTION]... [FILE]...\n"
1005#ifndef BB_FEATURE_TRIVIAL_HELP
1006 "\nCopy standard input to each FILE, and also to standard output.\n\n"
1007 "Options:\n" "\t-a\tappend to the given FILEs, do not overwrite\n"
1008#endif
1009 ;
1010#endif
1011
1012#if defined BB_TELNET
1013const char telnet_usage[] =
1014 "telnet host [port]\n"
1015#ifndef BB_FEATURE_TRIVIAL_HELP
1016 "\nTelnet is used to establish interactive communication with another\n"
1017 "computer over a network using the TELNET protocol.\n"
1018#endif
1019 ;
1020#endif
1021
1022#if defined BB_TEST
1023const char test_usage[] =
1024 "test EXPRESSION\n"
1025 "or [ EXPRESSION ]\n"
1026#ifndef BB_FEATURE_TRIVIAL_HELP
1027 "\nChecks file types and compares values returning an exit\n"
1028 "code determined by the value of EXPRESSION.\n"
1029#endif
1030 ;
1031#endif
1032
1033#if defined BB_TOUCH
1034const char touch_usage[] =
1035 "touch [-c] file [file ...]\n"
1036#ifndef BB_FEATURE_TRIVIAL_HELP
1037 "\nUpdate the last-modified date on the given file[s].\n\n"
1038 "Options:\n"
1039 "\t-c\tDo not create any files\n"
1040#endif
1041 ;
1042#endif
1043
1044#if defined BB_TR
1045const char tr_usage[] =
1046 "tr [-cds] STRING1 [STRING2]\n"
1047#ifndef BB_FEATURE_TRIVIAL_HELP
1048 "\nTranslate, squeeze, and/or delete characters from\n"
1049 "standard input, writing to standard output.\n\n"
1050 "Options:\n"
1051 "\t-c\ttake complement of STRING1\n"
1052 "\t-d\tdelete input characters coded STRING1\n"
1053 "\t-s\tsqueeze multiple output characters of STRING2 into one character\n"
1054#endif
1055 ;
1056#endif
1057
1058#if defined BB_TTY
1059const char tty_usage[] =
1060 "tty\n"
1061#ifndef BB_FEATURE_TRIVIAL_HELP
1062 "\nPrint the file name of the terminal connected to standard input.\n\n"
1063 "Options:\n"
1064 "\t-s\tprint nothing, only return an exit status\n"
1065#endif
1066 ;
1067#endif
1068
1069#if defined BB_UMOUNT
1070const char umount_usage[] =
1071 "umount [flags] filesystem|directory\n"
1072#ifndef BB_FEATURE_TRIVIAL_HELP
1073 "Unmount file systems\n"
1074 "\nFlags:\n" "\t-a:\tUnmount all file systems"
1075#ifdef BB_MTAB
1076 " in /etc/mtab\n\t-n:\tDon't erase /etc/mtab entries\n"
1077#else
1078 "\n"
1079#endif
1080 "\t-r:\tTry to remount devices as read-only if mount is busy\n"
1081#if defined BB_FEATURE_MOUNT_FORCE
1082 "\t-f:\tForce filesystem umount (i.e. unreachable NFS server)\n"
1083#endif
1084#if defined BB_FEATURE_MOUNT_LOOP
1085 "\t-l:\tDo not free loop device (if a loop device has been used)\n"
1086#endif
1087#endif
1088 ;
1089#endif
1090
1091#if defined BB_UNAME
1092const char uname_usage[] =
1093 "uname [OPTION]...\n"
1094#ifndef BB_FEATURE_TRIVIAL_HELP
1095 "\nPrint certain system information. With no OPTION, same as -s.\n\n"
1096 "Options:\n"
1097 "\t-a\tprint all information\n"
1098 "\t-m\tthe machine (hardware) type\n"
1099 "\t-n\tprint the machine's network node hostname\n"
1100 "\t-r\tprint the operating system release\n"
1101 "\t-s\tprint the operating system name\n"
1102
1103 "\t-p\tprint the host processor type\n"
1104 "\t-v\tprint the operating system version\n"
1105#endif
1106 ;
1107#endif
1108
1109#if defined BB_UNIQ
1110const char uniq_usage[] =
1111 "uniq [OPTION]... [INPUT [OUTPUT]]\n"
1112#ifndef BB_FEATURE_TRIVIAL_HELP
1113 "\nDiscard all but one of successive identical lines from INPUT\n"
1114 "(or standard input), writing to OUTPUT (or standard output).\n"
1115#endif
1116 ;
1117#endif
1118
1119#if defined BB_UPDATE
1120const char update_usage[] =
1121 "update [options]\n"
1122#ifndef BB_FEATURE_TRIVIAL_HELP
1123 "\nPeriodically flushes filesystem buffers.\n\n"
1124 "Options:\n"
1125 "\t-S\tforce use of sync(2) instead of flushing\n"
1126 "\t-s SECS\tcall sync this often (default 30)\n"
1127 "\t-f SECS\tflush some buffers this often (default 5)\n"
1128#endif
1129 ;
1130#endif
1131
1132#if defined BB_USLEEP
1133const char usleep_usage[] =
1134 "usleep N\n"
1135#ifndef BB_FEATURE_TRIVIAL_HELP
1136 "\nPause for N microseconds.\n"
1137#endif
1138 ;
1139#endif
1140
1141#if defined BB_UUDECODE
1142const char uudecode_usage[] =
1143 "uudecode [FILE]...\n"
1144#ifndef BB_FEATURE_TRIVIAL_HELP
1145 "\nUudecode a file that is uuencoded.\n\n"
1146 "Options:\n"
1147 "\t-o FILE\tdirect output to FILE\n"
1148#endif
1149 ;
1150#endif
1151
1152#if defined BB_UUENCODE
1153const char uuencode_usage[] =
1154 "uuencode [OPTION] [INFILE] REMOTEFILE\n"
1155#ifndef BB_FEATURE_TRIVIAL_HELP
1156 "\nUuencode a file.\n\n"
1157 "Options:\n"
1158 "\t-m\tuse base64 encoding as of RFC1521\n"
1159#endif
1160 ;
1161#endif
1162
1163#if defined BB_WC
1164const char wc_usage[] =
1165 "wc [OPTION]... [FILE]...\n"
1166#ifndef BB_FEATURE_TRIVIAL_HELP
1167 "\nPrint line, word, and byte counts for each FILE, and a total line if\n"
1168 "more than one FILE is specified. With no FILE, read standard input.\n\n"
1169 "Options:\n"
1170 "\t-c\tprint the byte counts\n"
1171 "\t-l\tprint the newline counts\n"
1172
1173 "\t-L\tprint the length of the longest line\n"
1174 "\t-w\tprint the word counts\n"
1175#endif
1176 ;
1177#endif
1178
1179#if defined BB_WHICH
1180const char which_usage[] =
1181 "which [COMMAND ...]\n"
1182#ifndef BB_FEATURE_TRIVIAL_HELP
1183 "\nLocates a COMMAND.\n"
1184#endif
1185 ;
1186#endif
1187
1188#if defined BB_WHOAMI
1189const char whoami_usage[] =
1190 "whoami\n"
1191#ifndef BB_FEATURE_TRIVIAL_HELP
1192 "\nPrints the user name associated with the current effective user id.\n"
1193#endif
1194 ;
1195#endif
1196
1197#if defined BB_YES
1198const char yes_usage[] =
1199 "yes [OPTION]... [STRING]...\n"
1200#ifndef BB_FEATURE_TRIVIAL_HELP
1201 "\nRepeatedly outputs a line with all specified STRING(s), or `y'.\n"
1202#endif
1203 ;
1204#endif
diff --git a/usleep.c b/usleep.c
index da6cca9ab..fcdf3bbf6 100644
--- a/usleep.c
+++ b/usleep.c
@@ -25,12 +25,6 @@
25#include <stdlib.h> 25#include <stdlib.h>
26#include <unistd.h> 26#include <unistd.h>
27 27
28const char usleep_usage[] = "usleep N\n"
29#ifndef BB_FEATURE_TRIVIAL_HELP
30 "\nPause for N microseconds.\n"
31#endif
32 ;
33
34extern int usleep_main(int argc, char **argv) 28extern int usleep_main(int argc, char **argv)
35{ 29{
36 if ((argc < 2) || (**(argv + 1) == '-')) { 30 if ((argc < 2) || (**(argv + 1) == '-')) {
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index 961e532b0..a8c61c7b4 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -32,16 +32,6 @@ static inline _syscall3(int, klogctl, int, type, char *, b, int, len);
32# include <sys/klog.h> 32# include <sys/klog.h>
33#endif 33#endif
34 34
35static const char dmesg_usage[] = "dmesg [-c] [-n LEVEL] [-s SIZE]\n"
36#ifndef BB_FEATURE_TRIVIAL_HELP
37 "\nPrints or controls the kernel ring buffer\n\n"
38 "Options:\n"
39 "\t-c\t\tClears the ring buffer's contents after printing\n"
40 "\t-n LEVEL\tSets console logging level\n"
41 "\t-s SIZE\t\tUse a buffer of size SIZE\n"
42#endif
43 ;
44
45int dmesg_main(int argc, char **argv) 35int dmesg_main(int argc, char **argv)
46{ 36{
47 char *buf, c; 37 char *buf, c;
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c
index d9937355f..6bc3e7d66 100644
--- a/util-linux/fdflush.c
+++ b/util-linux/fdflush.c
@@ -34,13 +34,8 @@ extern int fdflush_main(int argc, char **argv)
34 int value; 34 int value;
35 int fd; 35 int fd;
36 36
37 if (argc <= 1 || **(++argv) == '-') { 37 if (argc <= 1 || **(++argv) == '-')
38 usage("fdflush DEVICE\n" 38 usage(fdflush_usage);
39#ifndef BB_FEATURE_TRIVIAL_HELP
40 "\nForces floppy disk drive to detect disk change\n"
41#endif
42 );
43 }
44 39
45 fd = open(*argv, 0); 40 fd = open(*argv, 0);
46 if (fd < 0) { 41 if (fd < 0) {
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c
index 927c16946..2da2427c1 100644
--- a/util-linux/freeramdisk.c
+++ b/util-linux/freeramdisk.c
@@ -34,14 +34,6 @@
34/* From linux/fs.h */ 34/* From linux/fs.h */
35#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */ 35#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
36 36
37
38static const char freeramdisk_usage[] =
39 "freeramdisk DEVICE\n"
40#ifndef BB_FEATURE_TRIVIAL_HELP
41 "\nFrees all memory used by the specified ramdisk.\n"
42#endif
43 ;
44
45extern int 37extern int
46freeramdisk_main(int argc, char **argv) 38freeramdisk_main(int argc, char **argv)
47{ 39{
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index ea27c236c..5807b9af5 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -288,21 +288,6 @@ static void leave(int status)
288 exit(status); 288 exit(status);
289} 289}
290 290
291const char fsck_minix_usage[] =
292 "Usage: fsck.minix [-larvsmf] /dev/name\n"
293#ifndef BB_FEATURE_TRIVIAL_HELP
294 "\nPerforms a consistency check for MINIX filesystems.\n\n"
295 "Options:\n"
296 "\t-l\tLists all filenames\n"
297 "\t-r\tPerform interactive repairs\n"
298 "\t-a\tPerform automatic repairs\n"
299 "\t-v\tverbose\n"
300 "\t-s\tOutputs super-block information\n"
301 "\t-m\tActivates MINIX-like \"mode not cleared\" warnings\n"
302 "\t-f\tForce file system check.\n\n"
303#endif
304 ;
305
306static void show_usage(void) 291static void show_usage(void)
307{ 292{
308 usage(fsck_minix_usage); 293 usage(fsck_minix_usage);
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index 9ae4b569c..dec310d30 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -267,19 +267,6 @@ static volatile void die(char *str)
267 exit(8); 267 exit(8);
268} 268}
269 269
270const char mkfs_minix_usage[] =
271 "mkfs.minix [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n"
272#ifndef BB_FEATURE_TRIVIAL_HELP
273 "\nMake a MINIX filesystem.\n\n"
274 "Options:\n"
275 "\t-c\t\tCheck the device for bad blocks\n"
276 "\t-n [14|30]\tSpecify the maximum length of filenames\n"
277 "\t-i INODES\tSpecify the number of inodes for the filesystem\n"
278 "\t-l FILENAME\tRead the bad blocks list from FILENAME\n"
279 "\t-v\t\tMake a Minix version 2 filesystem\n\n"
280#endif
281 ;
282
283static volatile void show_usage() __attribute__ ((noreturn)); 270static volatile void show_usage() __attribute__ ((noreturn));
284static volatile void show_usage() 271static volatile void show_usage()
285{ 272{
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c
index 5a33945c8..eacd8816c 100644
--- a/util-linux/mkswap.c
+++ b/util-linux/mkswap.c
@@ -47,20 +47,6 @@
47#include <asm/page.h> /* for PAGE_SIZE and PAGE_SHIFT */ 47#include <asm/page.h> /* for PAGE_SIZE and PAGE_SHIFT */
48 /* we also get PAGE_SIZE via getpagesize() */ 48 /* we also get PAGE_SIZE via getpagesize() */
49 49
50
51static const char mkswap_usage[] =
52 "mkswap [-c] [-v0|-v1] device [block-count]\n"
53#ifndef BB_FEATURE_TRIVIAL_HELP
54 "\nPrepare a disk partition to be used as a swap partition.\n\n"
55 "Options:\n" "\t-c\t\tCheck for read-ability.\n"
56 "\t-v0\t\tMake version 0 swap [max 128 Megs].\n"
57 "\t-v1\t\tMake version 1 swap [big!] (default for kernels > 2.1.117).\n"
58
59 "\tblock-count\tNumber of block to use (default is entire partition).\n"
60#endif
61 ;
62
63
64#ifndef _IO 50#ifndef _IO
65/* pre-1.3.45 */ 51/* pre-1.3.45 */
66#define BLKGETSIZE 0x1260 52#define BLKGETSIZE 0x1260
diff --git a/util-linux/more.c b/util-linux/more.c
index 91c281563..2334576c0 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -34,12 +34,6 @@
34#define bb_need_help 34#define bb_need_help
35#include "messages.c" 35#include "messages.c"
36 36
37static const char more_usage[] = "more [FILE ...]\n"
38#ifndef BB_FEATURE_TRIVIAL_HELP
39 "\nMore is a filter for viewing FILE one screenful at a time.\n"
40#endif
41 ;
42
43/* ED: sparc termios is broken: revert back to old termio handling. */ 37/* ED: sparc termios is broken: revert back to old termio handling. */
44#ifdef BB_FEATURE_USE_TERMIOS 38#ifdef BB_FEATURE_USE_TERMIOS
45# if #cpu(sparc) 39# if #cpu(sparc)
diff --git a/util-linux/mount.c b/util-linux/mount.c
index addeb0925..610d12d34 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -80,38 +80,6 @@ extern int umount2 (__const char *__special_file, int __flags);
80 80
81extern const char mtab_file[]; /* Defined in utility.c */ 81extern const char mtab_file[]; /* Defined in utility.c */
82 82
83static const char mount_usage[] =
84 "mount [flags] device directory [-o options,more-options]\n"
85#ifndef BB_FEATURE_TRIVIAL_HELP
86 "\nMount a filesystem\n\n"
87 "Flags:\n"
88 "\t-a:\t\tMount all filesystems in fstab.\n"
89#ifdef BB_MTAB
90 "\t-f:\t\t\"Fake\" mount. Add entry to mount table but don't mount it.\n"
91 "\t-n:\t\tDon't write a mount table entry.\n"
92#endif
93 "\t-o option:\tOne of many filesystem options, listed below.\n"
94 "\t-r:\t\tMount the filesystem read-only.\n"
95 "\t-t fs-type:\tSpecify the filesystem type.\n"
96 "\t-w:\t\tMount for reading and writing (default).\n"
97 "\n"
98 "Options for use with the \"-o\" flag:\n"
99 "\tasync/sync:\tWrites are asynchronous / synchronous.\n"
100 "\tatime/noatime:\tEnable / disable updates to inode access times.\n"
101 "\tdev/nodev:\tAllow use of special device files / disallow them.\n"
102 "\texec/noexec:\tAllow use of executable files / disallow them.\n"
103#if defined BB_FEATURE_MOUNT_LOOP
104 "\tloop:\t\tMounts a file via loop device.\n"
105#endif
106 "\tsuid/nosuid:\tAllow set-user-id-root programs / disallow them.\n"
107 "\tremount:\tRe-mount a currently-mounted filesystem, changing its flags.\n"
108 "\tro/rw:\t\tMount for read-only / read-write.\n"
109 "\nThere are EVEN MORE flags that are specific to each filesystem.\n"
110 "You'll have to see the written documentation for those.\n"
111#endif
112 ;
113
114
115struct mount_options { 83struct mount_options {
116 const char *name; 84 const char *name;
117 unsigned long and; 85 unsigned long and;
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index a79b93a23..6aafe51a2 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -35,25 +35,6 @@ _syscall1(int, swapoff, const char *, path);
35 35
36static int whichApp; 36static int whichApp;
37 37
38static const char swapoff_usage[] =
39 "swapoff [OPTION] [device]\n"
40#ifndef BB_FEATURE_TRIVIAL_HELP
41 "\nStop swapping virtual memory pages on the given device.\n\n"
42 "Options:\n"
43 "\t-a\tStop swapping on all swap devices\n"
44#endif
45 ;
46
47static const char swapon_usage[] =
48 "swapon [OPTION] [device]\n"
49#ifndef BB_FEATURE_TRIVIAL_HELP
50 "\nStart swapping virtual memory pages on the given device.\n\n"
51 "Options:\n"
52 "\t-a\tStart swapping on all swap devices\n"
53#endif
54 ;
55
56
57#define SWAPON_APP 1 38#define SWAPON_APP 1
58#define SWAPOFF_APP 2 39#define SWAPOFF_APP 2
59 40
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 1b250fd3a..df075f7d9 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -39,28 +39,6 @@ extern int mount (__const char *__special_file, __const char *__dir,
39extern int umount (__const char *__special_file); 39extern int umount (__const char *__special_file);
40extern int umount2 (__const char *__special_file, int __flags); 40extern int umount2 (__const char *__special_file, int __flags);
41 41
42
43
44static const char umount_usage[] =
45 "umount [flags] filesystem|directory\n"
46#ifndef BB_FEATURE_TRIVIAL_HELP
47 "Unmount file systems\n"
48 "\nFlags:\n" "\t-a:\tUnmount all file systems"
49#ifdef BB_MTAB
50 " in /etc/mtab\n\t-n:\tDon't erase /etc/mtab entries\n"
51#else
52 "\n"
53#endif
54 "\t-r:\tTry to remount devices as read-only if mount is busy\n"
55#if defined BB_FEATURE_MOUNT_FORCE
56 "\t-f:\tForce filesystem umount (i.e. unreachable NFS server)\n"
57#endif
58#if defined BB_FEATURE_MOUNT_LOOP
59 "\t-l:\tDo not free loop device (if a loop device has been used)\n"
60#endif
61#endif
62;
63
64struct _mtab_entry_t { 42struct _mtab_entry_t {
65 char *device; 43 char *device;
66 char *mountpt; 44 char *mountpt;
diff --git a/uudecode.c b/uudecode.c
index 12a71a573..90bef9238 100644
--- a/uudecode.c
+++ b/uudecode.c
@@ -300,15 +300,6 @@ static int decode (const char *inname,
300 return read_stduu (inname); 300 return read_stduu (inname);
301} 301}
302 302
303static const char uudecode_usage[] =
304 "uudecode [FILE]...\n"
305#ifndef BB_FEATURE_TRIVIAL_HELP
306 "\nUudecode a file that is uuencoded.\n\n"
307 "Options:\n"
308 "\t-o FILE\tdirect output to FILE\n"
309#endif
310;
311
312int uudecode_main (int argc, 303int uudecode_main (int argc,
313 char **argv) 304 char **argv)
314{ 305{
diff --git a/uuencode.c b/uuencode.c
index e107a01e7..1433c7f3b 100644
--- a/uuencode.c
+++ b/uuencode.c
@@ -180,15 +180,6 @@ static void encode()
180 } 180 }
181} 181}
182 182
183static const char uuencode_usage[] =
184 "uuencode [OPTION] [INFILE] REMOTEFILE\n"
185#ifndef BB_FEATURE_TRIVIAL_HELP
186 "\nUuencode a file.\n\n"
187 "Options:\n"
188 "\t-m\tuse base64 encoding as of RFC1521\n"
189#endif
190;
191
192int uuencode_main (int argc, 183int uuencode_main (int argc,
193 char **argv) 184 char **argv)
194{ 185{
diff --git a/wc.c b/wc.c
index 3b0e589b6..058444d89 100644
--- a/wc.c
+++ b/wc.c
@@ -23,19 +23,6 @@
23#include "internal.h" 23#include "internal.h"
24#include <stdio.h> 24#include <stdio.h>
25 25
26static const char wc_usage[] = "wc [OPTION]... [FILE]...\n"
27#ifndef BB_FEATURE_TRIVIAL_HELP
28 "\nPrint line, word, and byte counts for each FILE, and a total line if\n"
29 "more than one FILE is specified. With no FILE, read standard input.\n\n"
30 "Options:\n"
31 "\t-c\tprint the byte counts\n"
32 "\t-l\tprint the newline counts\n"
33
34 "\t-L\tprint the length of the longest line\n"
35 "\t-w\tprint the word counts\n"
36#endif
37 ;
38
39static int total_lines, total_words, total_chars, max_length; 26static int total_lines, total_words, total_chars, max_length;
40static int print_lines, print_words, print_chars, print_length; 27static int print_lines, print_words, print_chars, print_length;
41 28
diff --git a/which.c b/which.c
index 186bfdad7..943e10a57 100644
--- a/which.c
+++ b/which.c
@@ -26,13 +26,6 @@
26#include <sys/stat.h> 26#include <sys/stat.h>
27#include <sys/param.h> 27#include <sys/param.h>
28 28
29const char which_usage[] =
30 "which [COMMAND ...]\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nLocates a COMMAND.\n"
33#endif
34 ;
35
36extern int which_main(int argc, char **argv) 29extern int which_main(int argc, char **argv)
37{ 30{
38 char *path_list, *test, *tmp, *path_parsed; 31 char *path_list, *test, *tmp, *path_parsed;
diff --git a/whoami.c b/whoami.c
index 01dff81f9..84b27fe58 100644
--- a/whoami.c
+++ b/whoami.c
@@ -24,12 +24,6 @@
24#include <stdio.h> 24#include <stdio.h>
25#include <pwd.h> 25#include <pwd.h>
26 26
27static const char whoami_usage[] = "whoami\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nPrints the user name associated with the current effective user id.\n"
30#endif
31 ;
32
33extern int whoami_main(int argc, char **argv) 27extern int whoami_main(int argc, char **argv)
34{ 28{
35 char *user = xmalloc(9); 29 char *user = xmalloc(9);
diff --git a/yes.c b/yes.c
index 0191bb003..f41bbb6ef 100644
--- a/yes.c
+++ b/yes.c
@@ -23,13 +23,6 @@
23#include "internal.h" 23#include "internal.h"
24#include <stdio.h> 24#include <stdio.h>
25 25
26const char yes_usage[] =
27 "yes [OPTION]... [STRING]...\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nRepeatedly outputs a line with all specified STRING(s), or `y'.\n"
30#endif
31 ;
32
33extern int yes_main(int argc, char **argv) 26extern int yes_main(int argc, char **argv)
34{ 27{
35 int i; 28 int i;