aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPere Orga <gotrunks@gmail.com>2011-04-11 03:29:49 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-04-11 03:29:49 +0200
commit5bc8c005a8e15c43285bc595a8d404de67a482ac (patch)
tree98f2d35d1db26f4d8cba5f095ff63bf8e2e8d980
parent73ef15cf3894716c1393ed21dee6e6bb2cdbc90f (diff)
downloadbusybox-w32-5bc8c005a8e15c43285bc595a8d404de67a482ac.tar.gz
busybox-w32-5bc8c005a8e15c43285bc595a8d404de67a482ac.tar.bz2
busybox-w32-5bc8c005a8e15c43285bc595a8d404de67a482ac.zip
move remaining help text from include/usage.src.h
Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--console-tools/loadfont.c11
-rw-r--r--e2fsprogs/old_e2fsprogs/e2fsck.c22
-rw-r--r--include/usage.src.h2311
-rw-r--r--libbb/parse_config.c6
-rw-r--r--miscutils/adjtimex.c12
-rw-r--r--miscutils/bbconfig.c6
-rw-r--r--miscutils/beep.c11
-rw-r--r--miscutils/chat.c9
-rw-r--r--miscutils/chrt.c17
-rw-r--r--miscutils/crond.c13
-rw-r--r--miscutils/crontab.c10
-rw-r--r--miscutils/devfsd.c16
-rw-r--r--miscutils/devmem.c8
-rw-r--r--miscutils/eject.c11
-rw-r--r--miscutils/fbsplash.c13
-rw-r--r--miscutils/flash_eraseall.c8
-rw-r--r--miscutils/flash_lock_unlock.c12
-rw-r--r--miscutils/flashcp.c7
-rw-r--r--miscutils/hdparm.c52
-rw-r--r--miscutils/inotifyd.c27
-rw-r--r--miscutils/ionice.c8
-rw-r--r--miscutils/last.c11
-rw-r--r--miscutils/less.c12
-rw-r--r--miscutils/makedevs.c60
-rw-r--r--miscutils/man.c8
-rw-r--r--miscutils/microcom.c12
-rw-r--r--miscutils/mountpoint.c16
-rw-r--r--miscutils/mt.c12
-rw-r--r--miscutils/raidautorun.c8
-rw-r--r--miscutils/readahead.c5
-rw-r--r--miscutils/rfkill.c13
-rw-r--r--miscutils/runlevel.c13
-rw-r--r--miscutils/rx.c8
-rw-r--r--miscutils/setsid.c7
-rw-r--r--miscutils/strings.c10
-rw-r--r--miscutils/taskset.c18
-rw-r--r--miscutils/time.c7
-rw-r--r--miscutils/timeout.c6
-rw-r--r--miscutils/ttysize.c6
-rw-r--r--miscutils/volname.c6
-rw-r--r--miscutils/wall.c9
-rw-r--r--miscutils/watchdog.c11
-rw-r--r--networking/arp.c19
-rw-r--r--networking/arping.c17
-rw-r--r--networking/brctl.c24
-rw-r--r--networking/dnsd.c16
-rw-r--r--networking/ether-wake.c10
-rw-r--r--networking/ftpgetput.c38
-rw-r--r--networking/hostname.c19
-rw-r--r--networking/httpd.c26
-rw-r--r--networking/ifconfig.c21
-rw-r--r--networking/ifenslave.c27
-rw-r--r--networking/ifplugd.c26
-rw-r--r--networking/ifupdown.c28
-rw-r--r--networking/inetd.c11
-rw-r--r--networking/ip.c73
-rw-r--r--networking/ipcalc.c27
-rw-r--r--networking/isrv_identd.c11
-rw-r--r--networking/nslookup.c14
-rw-r--r--networking/ntpd.c17
-rw-r--r--networking/pscan.c12
-rw-r--r--networking/route.c9
-rw-r--r--networking/slattach.c14
-rw-r--r--networking/tc.c21
-rw-r--r--networking/tcpudp.c37
-rw-r--r--networking/telnet.c16
-rw-r--r--networking/telnetd.c22
-rw-r--r--networking/tftp.c33
-rw-r--r--networking/traceroute.c45
-rw-r--r--networking/tunctl.c19
-rw-r--r--networking/udhcp/dhcpd.c11
-rw-r--r--networking/udhcp/dhcprelay.c6
-rw-r--r--networking/udhcp/dumpleases.c17
-rw-r--r--networking/vconfig.c12
-rw-r--r--networking/zcip.c13
-rw-r--r--printutils/lpd.c11
-rw-r--r--printutils/lpr.c21
-rw-r--r--procps/free.c12
-rw-r--r--procps/fuser.c11
-rw-r--r--procps/kill.c39
-rw-r--r--procps/pgrep.c29
-rw-r--r--procps/pidof.c28
-rw-r--r--procps/ps.c47
-rw-r--r--procps/renice.c10
-rw-r--r--procps/sysctl.c19
-rw-r--r--procps/uptime.c9
-rw-r--r--procps/watch.c14
-rw-r--r--runit/chpst.c64
-rw-r--r--runit/runsv.c5
-rw-r--r--runit/runsvdir.c7
-rw-r--r--runit/sv.c16
-rw-r--r--selinux/chcon.c33
-rw-r--r--selinux/getenforce.c3
-rw-r--r--selinux/getsebool.c5
-rw-r--r--selinux/load_policy.c4
-rw-r--r--selinux/matchpathcon.c10
-rw-r--r--selinux/runcon.c22
-rw-r--r--selinux/selinuxenabled.c4
-rw-r--r--selinux/sestatus.c6
-rw-r--r--selinux/setenforce.c4
-rw-r--r--selinux/setfiles.c40
-rw-r--r--selinux/setsebool.c5
-rw-r--r--sysklogd/klogd.c8
-rw-r--r--sysklogd/logger.c12
-rw-r--r--sysklogd/logread.c7
-rw-r--r--sysklogd/syslogd.c27
-rw-r--r--util-linux/acpid.c24
-rw-r--r--util-linux/blkid.c5
-rw-r--r--util-linux/dmesg.c10
-rw-r--r--util-linux/fbset.c15
-rw-r--r--util-linux/fdformat.c7
-rw-r--r--util-linux/fdisk.c22
-rw-r--r--util-linux/findfs.c8
-rw-r--r--util-linux/flock.c11
-rw-r--r--util-linux/freeramdisk.c14
-rw-r--r--util-linux/fsck_minix.c13
-rw-r--r--util-linux/getopt.c48
-rw-r--r--util-linux/hexdump.c24
-rw-r--r--util-linux/ipcrm.c10
-rw-r--r--util-linux/ipcs.c16
-rw-r--r--util-linux/losetup.c18
-rw-r--r--util-linux/lspci.c9
-rw-r--r--util-linux/lsusb.c4
-rw-r--r--util-linux/mdev.c35
-rw-r--r--util-linux/mkfs_ext2.c39
-rw-r--r--util-linux/mkfs_minix.c11
-rw-r--r--util-linux/mkfs_reiser.c9
-rw-r--r--util-linux/mkfs_vfat.c17
-rw-r--r--util-linux/mkswap.c8
-rw-r--r--util-linux/more.c8
-rw-r--r--util-linux/mount.c60
-rw-r--r--util-linux/pivot_root.c7
-rw-r--r--util-linux/rdate.c8
-rw-r--r--util-linux/rdev.c9
-rw-r--r--util-linux/readprofile.c15
-rw-r--r--util-linux/rtcwake.c23
-rw-r--r--util-linux/script.c13
-rw-r--r--util-linux/scriptreplay.c6
-rw-r--r--util-linux/setarch.c15
-rw-r--r--util-linux/swaponoff.c17
-rw-r--r--util-linux/switch_root.c10
-rw-r--r--util-linux/umount.c22
142 files changed, 2369 insertions, 2312 deletions
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index 588322b05..597519f91 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -18,6 +18,17 @@
18//usage: 18//usage:
19//usage:#define loadfont_example_usage 19//usage:#define loadfont_example_usage
20//usage: "$ loadfont < /etc/i18n/fontname\n" 20//usage: "$ loadfont < /etc/i18n/fontname\n"
21//usage:
22//usage:#define setfont_trivial_usage
23//usage: "FONT [-m MAPFILE] [-C TTY]"
24//usage:#define setfont_full_usage "\n\n"
25//usage: "Load a console font\n"
26//usage: "\nOptions:"
27//usage: "\n -m MAPFILE Load console screen map"
28//usage: "\n -C TTY Affect TTY instead of /dev/tty"
29//usage:
30//usage:#define setfont_example_usage
31//usage: "$ setfont -m koi8-r /etc/i18n/fontname\n"
21 32
22#include "libbb.h" 33#include "libbb.h"
23#include <sys/kd.h> 34#include <sys/kd.h>
diff --git a/e2fsprogs/old_e2fsprogs/e2fsck.c b/e2fsprogs/old_e2fsprogs/e2fsck.c
index d73665988..1f990b303 100644
--- a/e2fsprogs/old_e2fsprogs/e2fsck.c
+++ b/e2fsprogs/old_e2fsprogs/e2fsck.c
@@ -29,6 +29,28 @@
29 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 29 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
30 */ 30 */
31 31
32/*
33//usage:#define e2fsck_trivial_usage
34//usage: "[-panyrcdfvstDFSV] [-b superblock] [-B blocksize] "
35//usage: "[-I inode_buffer_blocks] [-P process_inode_size] "
36//usage: "[-l|-L bad_blocks_file] [-C fd] [-j external_journal] "
37//usage: "[-E extended-options] device"
38//usage:#define e2fsck_full_usage "\n\n"
39//usage: "Check ext2/ext3 file system\n"
40//usage: "\nOptions:"
41//usage: "\n -p Automatic repair (no questions)"
42//usage: "\n -n Make no changes to the filesystem"
43//usage: "\n -y Assume 'yes' to all questions"
44//usage: "\n -c Check for bad blocks and add them to the badblock list"
45//usage: "\n -f Force checking even if filesystem is marked clean"
46//usage: "\n -v Verbose"
47//usage: "\n -b superblock Use alternative superblock"
48//usage: "\n -B blocksize Force blocksize when looking for superblock"
49//usage: "\n -j journal Set location of the external journal"
50//usage: "\n -l file Add to badblocks list"
51//usage: "\n -L file Set badblocks list"
52*/
53
32#include "e2fsck.h" /*Put all of our defines here to clean things up*/ 54#include "e2fsck.h" /*Put all of our defines here to clean things up*/
33 55
34#define _(x) x 56#define _(x) x
diff --git a/include/usage.src.h b/include/usage.src.h
index 2c88c46a1..78beccf4d 100644
--- a/include/usage.src.h
+++ b/include/usage.src.h
@@ -12,2322 +12,11 @@
12#ifndef BB_USAGE_H 12#ifndef BB_USAGE_H
13#define BB_USAGE_H 1 13#define BB_USAGE_H 1
14 14
15
16#define NOUSAGE_STR "\b" 15#define NOUSAGE_STR "\b"
17 16
18INSERT 17INSERT
19 18
20#define acpid_trivial_usage \
21 "[-d] [-c CONFDIR] [-l LOGFILE] [-a ACTIONFILE] [-M MAPFILE] [-e PROC_EVENT_FILE] [-p PIDFILE]"
22#define acpid_full_usage "\n\n" \
23 "Listen to ACPI events and spawn specific helpers on event arrival\n" \
24 "\nOptions:" \
25 "\n -c DIR Config directory [/etc/acpi]" \
26 "\n -d Don't daemonize, (implies -f)" \
27 "\n -e FILE /proc event file [/proc/acpi/event]" \
28 "\n -f Run in foreground" \
29 "\n -l FILE Log file [/var/log/acpid.log]" \
30 "\n -p FILE Pid file [/var/run/acpid.pid]" \
31 "\n -a FILE Action file [/etc/acpid.conf]" \
32 "\n -M FILE Map file [/etc/acpi.map]" \
33 IF_FEATURE_ACPID_COMPAT( \
34 "\n\nAccept and ignore compatibility options -g -m -s -S -v" \
35 )
36
37#define acpid_example_usage \
38 "Without -e option, acpid uses all /dev/input/event* files\n" \
39 "# acpid\n" \
40 "# acpid -l /var/log/my-acpi-log\n" \
41 "# acpid -e /proc/acpi/event\n"
42
43#define adjtimex_trivial_usage \
44 "[-q] [-o OFF] [-f FREQ] [-p TCONST] [-t TICK]"
45#define adjtimex_full_usage "\n\n" \
46 "Read and optionally set system timebase parameters. See adjtimex(2)\n" \
47 "\nOptions:" \
48 "\n -q Quiet" \
49 "\n -o OFF Time offset, microseconds" \
50 "\n -f FREQ Frequency adjust, integer kernel units (65536 is 1ppm)" \
51 "\n (positive values make clock run faster)" \
52 "\n -t TICK Microseconds per tick, usually 10000" \
53 "\n -p TCONST" \
54
55#define arp_trivial_usage \
56 "\n[-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME]" \
57 "\n[-v] [-i IF] -d HOSTNAME [pub]" \
58 "\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [temp]" \
59 "\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [netmask MASK] pub" \
60 "\n[-v] [-H HWTYPE] [-i IF] -Ds HOSTNAME IFACE [netmask MASK] pub"
61#define arp_full_usage "\n\n" \
62 "Manipulate ARP cache\n" \
63 "\nOptions:" \
64 "\n -a Display (all) hosts" \
65 "\n -s Set new ARP entry" \
66 "\n -d Delete a specified entry" \
67 "\n -v Verbose" \
68 "\n -n Don't resolve names" \
69 "\n -i IF Network interface" \
70 "\n -D Read <hwaddr> from given device" \
71 "\n -A,-p AF Protocol family" \
72 "\n -H HWTYPE Hardware address type" \
73
74#define arping_trivial_usage \
75 "[-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP"
76#define arping_full_usage "\n\n" \
77 "Send ARP requests/replies\n" \
78 "\nOptions:" \
79 "\n -f Quit on first ARP reply" \
80 "\n -q Quiet" \
81 "\n -b Keep broadcasting, don't go unicast" \
82 "\n -D Duplicated address detection mode" \
83 "\n -U Unsolicited ARP mode, update your neighbors" \
84 "\n -A ARP answer mode, update your neighbors" \
85 "\n -c N Stop after sending N ARP requests" \
86 "\n -w TIMEOUT Time to wait for ARP reply, seconds" \
87 "\n -I IFACE Interface to use (default eth0)" \
88 "\n -s SRC_IP Sender IP address" \
89 "\n DST_IP Target IP address" \
90
91#define beep_trivial_usage \
92 "-f FREQ -l LEN -d DELAY -r COUNT -n"
93#define beep_full_usage "\n\n" \
94 "Options:" \
95 "\n -f Frequency in Hz" \
96 "\n -l Length in ms" \
97 "\n -d Delay in ms" \
98 "\n -r Repetitions" \
99 "\n -n Start new tone" \
100
101#define blkid_trivial_usage \
102 ""
103#define blkid_full_usage "\n\n" \
104 "Print UUIDs of all filesystems"
105
106#define brctl_trivial_usage \
107 "COMMAND [BRIDGE [INTERFACE]]"
108#define brctl_full_usage "\n\n" \
109 "Manage ethernet bridges\n" \
110 "\nCommands:" \
111 IF_FEATURE_BRCTL_SHOW( \
112 "\n show Show a list of bridges" \
113 ) \
114 "\n addbr BRIDGE Create BRIDGE" \
115 "\n delbr BRIDGE Delete BRIDGE" \
116 "\n addif BRIDGE IFACE Add IFACE to BRIDGE" \
117 "\n delif BRIDGE IFACE Delete IFACE from BRIDGE" \
118 IF_FEATURE_BRCTL_FANCY( \
119 "\n setageing BRIDGE TIME Set ageing time" \
120 "\n setfd BRIDGE TIME Set bridge forward delay" \
121 "\n sethello BRIDGE TIME Set hello time" \
122 "\n setmaxage BRIDGE TIME Set max message age" \
123 "\n setpathcost BRIDGE COST Set path cost" \
124 "\n setportprio BRIDGE PRIO Set port priority" \
125 "\n setbridgeprio BRIDGE PRIO Set bridge priority" \
126 "\n stp BRIDGE [1/yes/on|0/no/off] STP on/off" \
127 ) \
128
129#define busybox_notes_usage \ 19#define busybox_notes_usage \
130 "Hello world!\n" 20 "Hello world!\n"
131 21
132#define chat_trivial_usage \
133 "EXPECT [SEND [EXPECT [SEND...]]]"
134#define chat_full_usage "\n\n" \
135 "Useful for interacting with a modem connected to stdin/stdout.\n" \
136 "A script consists of one or more \"expect-send\" pairs of strings,\n" \
137 "each pair is a pair of arguments. Example:\n" \
138 "chat '' ATZ OK ATD123456 CONNECT '' ogin: pppuser word: ppppass '~'" \
139
140#define chcon_trivial_usage \
141 "[OPTIONS] CONTEXT FILE..." \
142 "\n chcon [OPTIONS] [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE..." \
143 IF_FEATURE_CHCON_LONG_OPTIONS( \
144 "\n chcon [OPTIONS] --reference=RFILE FILE..." \
145 )
146#define chcon_full_usage "\n\n" \
147 "Change the security context of each FILE to CONTEXT\n" \
148 IF_FEATURE_CHCON_LONG_OPTIONS( \
149 "\n -v,--verbose Verbose" \
150 "\n -c,--changes Report changes made" \
151 "\n -h,--no-dereference Affect symlinks instead of their targets" \
152 "\n -f,--silent,--quiet Suppress most error messages" \
153 "\n --reference=RFILE Use RFILE's group instead of using a CONTEXT value" \
154 "\n -u,--user=USER Set user/role/type/range in the target" \
155 "\n -r,--role=ROLE security context" \
156 "\n -t,--type=TYPE" \
157 "\n -l,--range=RANGE" \
158 "\n -R,--recursive Recurse" \
159 ) \
160 IF_NOT_FEATURE_CHCON_LONG_OPTIONS( \
161 "\n -v Verbose" \
162 "\n -c Report changes made" \
163 "\n -h Affect symlinks instead of their targets" \
164 "\n -f Suppress most error messages" \
165 "\n -u USER Set user/role/type/range in the target security context" \
166 "\n -r ROLE" \
167 "\n -t TYPE" \
168 "\n -l RNG" \
169 "\n -R Recurse" \
170 )
171
172#define chpst_trivial_usage \
173 "[-vP012] [-u USER[:GRP]] [-U USER[:GRP]] [-e DIR]\n" \
174 " [-/ DIR] [-n NICE] [-m BYTES] [-d BYTES] [-o N]\n" \
175 " [-p N] [-f BYTES] [-c BYTES] PROG ARGS"
176#define chpst_full_usage "\n\n" \
177 "Change the process state, run PROG\n" \
178 "\nOptions:" \
179 "\n -u USER[:GRP] Set uid and gid" \
180 "\n -U USER[:GRP] Set $UID and $GID in environment" \
181 "\n -e DIR Set environment variables as specified by files" \
182 "\n in DIR: file=1st_line_of_file" \
183 "\n -/ DIR Chroot to DIR" \
184 "\n -n NICE Add NICE to nice value" \
185 "\n -m BYTES Same as -d BYTES -s BYTES -l BYTES" \
186 "\n -d BYTES Limit data segment" \
187 "\n -o N Limit number of open files per process" \
188 "\n -p N Limit number of processes per uid" \
189 "\n -f BYTES Limit output file sizes" \
190 "\n -c BYTES Limit core file size" \
191 "\n -v Verbose" \
192 "\n -P Create new process group" \
193 "\n -0 Close stdin" \
194 "\n -1 Close stdout" \
195 "\n -2 Close stderr" \
196
197#define setuidgid_trivial_usage \
198 "USER PROG ARGS"
199#define setuidgid_full_usage "\n\n" \
200 "Set uid and gid to USER's uid and gid, drop supplementary group ids,\n" \
201 "run PROG"
202#define envuidgid_trivial_usage \
203 "USER PROG ARGS"
204#define envuidgid_full_usage "\n\n" \
205 "Set $UID to USER's uid and $GID to USER's gid, run PROG"
206#define envdir_trivial_usage \
207 "DIR PROG ARGS"
208#define envdir_full_usage "\n\n" \
209 "Set various environment variables as specified by files\n" \
210 "in the directory DIR, run PROG"
211#define softlimit_trivial_usage \
212 "[-a BYTES] [-m BYTES] [-d BYTES] [-s BYTES] [-l BYTES]\n" \
213 " [-f BYTES] [-c BYTES] [-r BYTES] [-o N] [-p N] [-t N]\n" \
214 " PROG ARGS"
215#define softlimit_full_usage "\n\n" \
216 "Set soft resource limits, then run PROG\n" \
217 "\nOptions:" \
218 "\n -a BYTES Limit total size of all segments" \
219 "\n -m BYTES Same as -d BYTES -s BYTES -l BYTES -a BYTES" \
220 "\n -d BYTES Limit data segment" \
221 "\n -s BYTES Limit stack segment" \
222 "\n -l BYTES Limit locked memory size" \
223 "\n -o N Limit number of open files per process" \
224 "\n -p N Limit number of processes per uid" \
225 "\nOptions controlling file sizes:" \
226 "\n -f BYTES Limit output file sizes" \
227 "\n -c BYTES Limit core file size" \
228 "\nEfficiency opts:" \
229 "\n -r BYTES Limit resident set size" \
230 "\n -t N Limit CPU time, process receives" \
231 "\n a SIGXCPU after N seconds" \
232
233#define bbconfig_trivial_usage \
234 ""
235#define bbconfig_full_usage "\n\n" \
236 "Print the config file used by busybox build"
237
238#define chrt_trivial_usage \
239 "[-prfom] [PRIO] [PID | PROG ARGS]"
240#define chrt_full_usage "\n\n" \
241 "Change scheduling priority and class for a process\n" \
242 "\nOptions:" \
243 "\n -p Operate on PID" \
244 "\n -r Set SCHED_RR class" \
245 "\n -f Set SCHED_FIFO class" \
246 "\n -o Set SCHED_OTHER class" \
247 "\n -m Show min/max priorities" \
248
249#define chrt_example_usage \
250 "$ chrt -r 4 sleep 900; x=$!\n" \
251 "$ chrt -f -p 3 $x\n" \
252 "You need CAP_SYS_NICE privileges to set scheduling attributes of a process"
253
254#define renice_trivial_usage \
255 "{{-n INCREMENT} | PRIORITY} [[-p | -g | -u] ID...]"
256#define renice_full_usage "\n\n" \
257 "Change scheduling priority for a running process\n" \
258 "\nOptions:" \
259 "\n -n Adjust current nice value (smaller is faster)" \
260 "\n -p Process id(s) (default)" \
261 "\n -g Process group id(s)" \
262 "\n -u Process user name(s) and/or id(s)" \
263
264#define ionice_trivial_usage \
265 "[-c 1-3] [-n 0-7] [-p PID] [PROG]"
266#define ionice_full_usage "\n\n" \
267 "Change I/O priority and class\n" \
268 "\nOptions:" \
269 "\n -c Class. 1:realtime 2:best-effort 3:idle" \
270 "\n -n Priority" \
271
272#define crond_trivial_usage \
273 "-fbS -l N " IF_FEATURE_CROND_D("-d N ") "-L LOGFILE -c DIR"
274#define crond_full_usage "\n\n" \
275 " -f Foreground" \
276 "\n -b Background (default)" \
277 "\n -S Log to syslog (default)" \
278 "\n -l Set log level. 0 is the most verbose, default 8" \
279 IF_FEATURE_CROND_D( \
280 "\n -d Set log level, log to stderr" \
281 ) \
282 "\n -L Log to file" \
283 "\n -c Working dir" \
284
285#define crontab_trivial_usage \
286 "[-c DIR] [-u USER] [-ler]|[FILE]"
287#define crontab_full_usage "\n\n" \
288 " -c Crontab directory" \
289 "\n -u User" \
290 "\n -l List crontab" \
291 "\n -e Edit crontab" \
292 "\n -r Delete crontab" \
293 "\n FILE Replace crontab by FILE ('-': stdin)" \
294
295#define devmem_trivial_usage \
296 "ADDRESS [WIDTH [VALUE]]"
297
298#define devmem_full_usage "\n\n" \
299 "Read/write from physical address\n" \
300 "\n ADDRESS Address to act upon" \
301 "\n WIDTH Width (8/16/...)" \
302 "\n VALUE Data to be written" \
303
304#define devfsd_trivial_usage \
305 "mntpnt [-v]" IF_DEVFSD_FG_NP("[-fg][-np]")
306#define devfsd_full_usage "\n\n" \
307 "Manage devfs permissions and old device name symlinks\n" \
308 "\nOptions:" \
309 "\n mntpnt The mount point where devfs is mounted" \
310 "\n -v Print the protocol version numbers for devfsd" \
311 "\n and the kernel-side protocol version and exit" \
312 IF_DEVFSD_FG_NP( \
313 "\n -fg Run in foreground" \
314 "\n -np Exit after parsing the configuration file" \
315 "\n and processing synthetic REGISTER events," \
316 "\n don't poll for events" \
317 )
318
319#define dhcprelay_trivial_usage \
320 "CLIENT_IFACE[,CLIENT_IFACE2]... SERVER_IFACE [SERVER_IP]"
321#define dhcprelay_full_usage "\n\n" \
322 "Relay DHCP requests between clients and server" \
323
324#define dmesg_trivial_usage \
325 "[-c] [-n LEVEL] [-s SIZE]"
326#define dmesg_full_usage "\n\n" \
327 "Print or control the kernel ring buffer\n" \
328 "\nOptions:" \
329 "\n -c Clear ring buffer after printing" \
330 "\n -n LEVEL Set console logging level" \
331 "\n -s SIZE Buffer size" \
332
333#define dnsd_trivial_usage \
334 "[-dvs] [-c CONFFILE] [-t TTL_SEC] [-p PORT] [-i ADDR]"
335#define dnsd_full_usage "\n\n" \
336 "Small static DNS server daemon\n" \
337 "\nOptions:" \
338 "\n -c FILE Config file" \
339 "\n -t SEC TTL" \
340 "\n -p PORT Listen on PORT" \
341 "\n -i ADDR Listen on ADDR" \
342 "\n -d Daemonize" \
343 "\n -v Verbose" \
344 "\n -s Send successful replies only. Use this if you want" \
345 "\n to use /etc/resolv.conf with two nameserver lines:" \
346 "\n nameserver DNSD_SERVER" \
347 "\n nameserver NORNAL_DNS_SERVER" \
348
349#define dumpleases_trivial_usage \
350 "[-r|-a] [-f LEASEFILE]"
351#define dumpleases_full_usage "\n\n" \
352 "Display DHCP leases granted by udhcpd\n" \
353 "\nOptions:" \
354 IF_LONG_OPTS( \
355 "\n -f,--file=FILE Lease file" \
356 "\n -r,--remaining Show remaining time" \
357 "\n -a,--absolute Show expiration time" \
358 ) \
359 IF_NOT_LONG_OPTS( \
360 "\n -f FILE Lease file" \
361 "\n -r Show remaining time" \
362 "\n -a Show expiration time" \
363 )
364
365/*
366#define e2fsck_trivial_usage \
367 "[-panyrcdfvstDFSV] [-b superblock] [-B blocksize] " \
368 "[-I inode_buffer_blocks] [-P process_inode_size] " \
369 "[-l|-L bad_blocks_file] [-C fd] [-j external_journal] " \
370 "[-E extended-options] device"
371#define e2fsck_full_usage "\n\n" \
372 "Check ext2/ext3 file system\n" \
373 "\nOptions:" \
374 "\n -p Automatic repair (no questions)" \
375 "\n -n Make no changes to the filesystem" \
376 "\n -y Assume 'yes' to all questions" \
377 "\n -c Check for bad blocks and add them to the badblock list" \
378 "\n -f Force checking even if filesystem is marked clean" \
379 "\n -v Verbose" \
380 "\n -b superblock Use alternative superblock" \
381 "\n -B blocksize Force blocksize when looking for superblock" \
382 "\n -j journal Set location of the external journal" \
383 "\n -l file Add to badblocks list" \
384 "\n -L file Set badblocks list" \
385*/
386
387#define eject_trivial_usage \
388 "[-t] [-T] [DEVICE]"
389#define eject_full_usage "\n\n" \
390 "Eject DEVICE or default /dev/cdrom\n" \
391 "\nOptions:" \
392 IF_FEATURE_EJECT_SCSI( \
393 "\n -s SCSI device" \
394 ) \
395 "\n -t Close tray" \
396 "\n -T Open/close tray (toggle)" \
397
398#define ether_wake_trivial_usage \
399 "[-b] [-i iface] [-p aa:bb:cc:dd[:ee:ff]] MAC"
400#define ether_wake_full_usage "\n\n" \
401 "Send a magic packet to wake up sleeping machines.\n" \
402 "MAC must be a station address (00:11:22:33:44:55) or\n" \
403 "a hostname with a known 'ethers' entry.\n" \
404 "\nOptions:" \
405 "\n -b Send wake-up packet to the broadcast address" \
406 "\n -i iface Interface to use (default eth0)" \
407 "\n -p pass Append four or six byte password PW to the packet" \
408
409#define fakeidentd_trivial_usage \
410 "[-fiw] [-b ADDR] [STRING]"
411#define fakeidentd_full_usage "\n\n" \
412 "Provide fake ident (auth) service\n" \
413 "\nOptions:" \
414 "\n -f Run in foreground" \
415 "\n -i Inetd mode" \
416 "\n -w Inetd 'wait' mode" \
417 "\n -b ADDR Bind to specified address" \
418 "\n STRING Ident answer string (default: nobody)" \
419
420#define fbsplash_trivial_usage \
421 "-s IMGFILE [-c] [-d DEV] [-i INIFILE] [-f CMD]"
422#define fbsplash_full_usage "\n\n" \
423 "Options:" \
424 "\n -s Image" \
425 "\n -c Hide cursor" \
426 "\n -d Framebuffer device (default /dev/fb0)" \
427 "\n -i Config file (var=value):" \
428 "\n BAR_LEFT,BAR_TOP,BAR_WIDTH,BAR_HEIGHT" \
429 "\n BAR_R,BAR_G,BAR_B" \
430 "\n -f Control pipe (else exit after drawing image)" \
431 "\n commands: 'NN' (% for progress bar) or 'exit'" \
432
433#define fbset_trivial_usage \
434 "[OPTIONS] [MODE]"
435#define fbset_full_usage "\n\n" \
436 "Show and modify frame buffer settings"
437
438#define fbset_example_usage \
439 "$ fbset\n" \
440 "mode \"1024x768-76\"\n" \
441 " # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz\n" \
442 " geometry 1024 768 1024 768 16\n" \
443 " timings 12714 128 32 16 4 128 4\n" \
444 " accel false\n" \
445 " rgba 5/11,6/5,5/0,0/0\n" \
446 "endmode\n"
447
448#define fdflush_trivial_usage \
449 "DEVICE"
450#define fdflush_full_usage "\n\n" \
451 "Force floppy disk drive to detect disk change"
452
453#define fdformat_trivial_usage \
454 "[-n] DEVICE"
455#define fdformat_full_usage "\n\n" \
456 "Format floppy disk\n" \
457 "\nOptions:" \
458 "\n -n Don't verify after format" \
459
460/* Looks like someone forgot to add this to config system */
461#ifndef ENABLE_FEATURE_FDISK_BLKSIZE
462# define ENABLE_FEATURE_FDISK_BLKSIZE 0
463# define IF_FEATURE_FDISK_BLKSIZE(a)
464#endif
465
466#define fdisk_trivial_usage \
467 "[-ul" IF_FEATURE_FDISK_BLKSIZE("s") "] " \
468 "[-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK"
469#define fdisk_full_usage "\n\n" \
470 "Change partition table\n" \
471 "\nOptions:" \
472 "\n -u Start and End are in sectors (instead of cylinders)" \
473 "\n -l Show partition table for each DISK, then exit" \
474 IF_FEATURE_FDISK_BLKSIZE( \
475 "\n -s Show partition sizes in kb for each DISK, then exit" \
476 ) \
477 "\n -b 2048 (for certain MO disks) use 2048-byte sectors" \
478 "\n -C CYLINDERS Set number of cylinders/heads/sectors" \
479 "\n -H HEADS" \
480 "\n -S SECTORS" \
481
482#define findfs_trivial_usage \
483 "LABEL=label or UUID=uuid"
484#define findfs_full_usage "\n\n" \
485 "Find a filesystem device based on a label or UUID"
486#define findfs_example_usage \
487 "$ findfs LABEL=MyDevice"
488
489#define flash_lock_trivial_usage \
490 "MTD_DEVICE OFFSET SECTORS"
491#define flash_lock_full_usage "\n\n" \
492 "Lock part or all of an MTD device. If SECTORS is -1, then all sectors\n" \
493 "will be locked, regardless of the value of OFFSET"
494
495#define flash_unlock_trivial_usage \
496 "MTD_DEVICE"
497#define flash_unlock_full_usage "\n\n" \
498 "Unlock an MTD device"
499
500#define flash_eraseall_trivial_usage \
501 "[-jq] MTD_DEVICE"
502#define flash_eraseall_full_usage "\n\n" \
503 "Erase an MTD device\n" \
504 "\nOptions:" \
505 "\n -j Format the device for jffs2" \
506 "\n -q Don't display progress messages" \
507
508#define flashcp_trivial_usage \
509 "-v FILE MTD_DEVICE"
510#define flashcp_full_usage "\n\n" \
511 "Copy an image to MTD device\n" \
512 "\nOptions:" \
513 "\n -v Verbose" \
514
515#define flock_trivial_usage \
516 "[-sxun] FD|{FILE [-c] PROG ARGS}"
517#define flock_full_usage "\n\n" \
518 "[Un]lock file descriptor, or lock FILE, run PROG\n" \
519 "\nOptions:" \
520 "\n -s Shared lock" \
521 "\n -x Exclusive lock (default)" \
522 "\n -u Unlock FD" \
523 "\n -n Fail rather than wait" \
524
525#define free_trivial_usage \
526 "" IF_DESKTOP("[-b/k/m/g]")
527#define free_full_usage "\n\n" \
528 "Display the amount of free and used system memory"
529#define free_example_usage \
530 "$ free\n" \
531 " total used free shared buffers\n" \
532 " Mem: 257628 248724 8904 59644 93124\n" \
533 " Swap: 128516 8404 120112\n" \
534 "Total: 386144 257128 129016\n" \
535
536#define freeramdisk_trivial_usage \
537 "DEVICE"
538#define freeramdisk_full_usage "\n\n" \
539 "Free all memory used by the specified ramdisk"
540#define freeramdisk_example_usage \
541 "$ freeramdisk /dev/ram2\n"
542
543#define fsck_minix_trivial_usage \
544 "[-larvsmf] BLOCKDEV"
545#define fsck_minix_full_usage "\n\n" \
546 "Check MINIX filesystem\n" \
547 "\nOptions:" \
548 "\n -l List all filenames" \
549 "\n -r Perform interactive repairs" \
550 "\n -a Perform automatic repairs" \
551 "\n -v Verbose" \
552 "\n -s Output superblock information" \
553 "\n -m Show \"mode not cleared\" warnings" \
554 "\n -f Force file system check" \
555
556#define ftpget_trivial_usage \
557 "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE"
558#define ftpget_full_usage "\n\n" \
559 "Retrieve a remote file via FTP\n" \
560 "\nOptions:" \
561 IF_FEATURE_FTPGETPUT_LONG_OPTIONS( \
562 "\n -c,--continue Continue previous transfer" \
563 "\n -v,--verbose Verbose" \
564 "\n -u,--username Username" \
565 "\n -p,--password Password" \
566 "\n -P,--port Port number" \
567 ) \
568 IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS( \
569 "\n -c Continue previous transfer" \
570 "\n -v Verbose" \
571 "\n -u Username" \
572 "\n -p Password" \
573 "\n -P Port number" \
574 )
575
576#define ftpput_trivial_usage \
577 "[OPTIONS] HOST [REMOTE_FILE] LOCAL_FILE"
578#define ftpput_full_usage "\n\n" \
579 "Store a local file on a remote machine via FTP\n" \
580 "\nOptions:" \
581 IF_FEATURE_FTPGETPUT_LONG_OPTIONS( \
582 "\n -v,--verbose Verbose" \
583 "\n -u,--username Username" \
584 "\n -p,--password Password" \
585 "\n -P,--port Port number" \
586 ) \
587 IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS( \
588 "\n -v Verbose" \
589 "\n -u Username" \
590 "\n -p Password" \
591 "\n -P Port number" \
592 )
593
594#define fuser_trivial_usage \
595 "[OPTIONS] FILE or PORT/PROTO"
596#define fuser_full_usage "\n\n" \
597 "Find processes which use FILEs or PORTs\n" \
598 "\nOptions:" \
599 "\n -m Find processes which use same fs as FILEs" \
600 "\n -4,-6 Search only IPv4/IPv6 space" \
601 "\n -s Don't display PIDs" \
602 "\n -k Kill found processes" \
603 "\n -SIGNAL Signal to send (default: KILL)" \
604
605#define getenforce_trivial_usage NOUSAGE_STR
606#define getenforce_full_usage ""
607
608#define getopt_trivial_usage \
609 "[OPTIONS]"
610#define getopt_full_usage "\n\n" \
611 "Options:" \
612 IF_LONG_OPTS( \
613 "\n -a,--alternative Allow long options starting with single -" \
614 "\n -l,--longoptions=longopts Long options to be recognized" \
615 "\n -n,--name=progname The name under which errors are reported" \
616 "\n -o,--options=optstring Short options to be recognized" \
617 "\n -q,--quiet Disable error reporting by getopt(3)" \
618 "\n -Q,--quiet-output No normal output" \
619 "\n -s,--shell=shell Set shell quoting conventions" \
620 "\n -T,--test Test for getopt(1) version" \
621 "\n -u,--unquoted Don't quote the output" \
622 ) \
623 IF_NOT_LONG_OPTS( \
624 "\n -a Allow long options starting with single -" \
625 "\n -l longopts Long options to be recognized" \
626 "\n -n progname The name under which errors are reported" \
627 "\n -o optstring Short options to be recognized" \
628 "\n -q Disable error reporting by getopt(3)" \
629 "\n -Q No normal output" \
630 "\n -s shell Set shell quoting conventions" \
631 "\n -T Test for getopt(1) version" \
632 "\n -u Don't quote the output" \
633 )
634#define getopt_example_usage \
635 "$ cat getopt.test\n" \
636 "#!/bin/sh\n" \
637 "GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \\\n" \
638 " -n 'example.busybox' -- \"$@\"`\n" \
639 "if [ $? != 0 ]; then exit 1; fi\n" \
640 "eval set -- \"$GETOPT\"\n" \
641 "while true; do\n" \
642 " case $1 in\n" \
643 " -a|--a-long) echo \"Option a\"; shift;;\n" \
644 " -b|--b-long) echo \"Option b, argument '$2'\"; shift 2;;\n" \
645 " -c|--c-long)\n" \
646 " case \"$2\" in\n" \
647 " \"\") echo \"Option c, no argument\"; shift 2;;\n" \
648 " *) echo \"Option c, argument '$2'\"; shift 2;;\n" \
649 " esac;;\n" \
650 " --) shift; break;;\n" \
651 " *) echo \"Internal error!\"; exit 1;;\n" \
652 " esac\n" \
653 "done\n"
654
655#define getsebool_trivial_usage \
656 "-a or getsebool boolean..."
657#define getsebool_full_usage "\n\n" \
658 " -a Show all selinux booleans"
659
660#define hdparm_trivial_usage \
661 "[OPTIONS] [DEVICE]"
662#define hdparm_full_usage "\n\n" \
663 "Options:" \
664 "\n -a Get/set fs readahead" \
665 "\n -A Set drive read-lookahead flag (0/1)" \
666 "\n -b Get/set bus state (0 == off, 1 == on, 2 == tristate)" \
667 "\n -B Set Advanced Power Management setting (1-255)" \
668 "\n -c Get/set IDE 32-bit IO setting" \
669 "\n -C Check IDE power mode status" \
670 IF_FEATURE_HDPARM_HDIO_GETSET_DMA( \
671 "\n -d Get/set using_dma flag") \
672 "\n -D Enable/disable drive defect-mgmt" \
673 "\n -f Flush buffer cache for device on exit" \
674 "\n -g Display drive geometry" \
675 "\n -h Display terse usage information" \
676 IF_FEATURE_HDPARM_GET_IDENTITY( \
677 "\n -i Display drive identification") \
678 IF_FEATURE_HDPARM_GET_IDENTITY( \
679 "\n -I Detailed/current information directly from drive") \
680 "\n -k Get/set keep_settings_over_reset flag (0/1)" \
681 "\n -K Set drive keep_features_over_reset flag (0/1)" \
682 "\n -L Set drive doorlock (0/1) (removable harddisks only)" \
683 "\n -m Get/set multiple sector count" \
684 "\n -n Get/set ignore-write-errors flag (0/1)" \
685 "\n -p Set PIO mode on IDE interface chipset (0,1,2,3,4,...)" \
686 "\n -P Set drive prefetch count" \
687/* "\n -q Change next setting quietly" - not supported ib bbox */ \
688 "\n -Q Get/set DMA tagged-queuing depth (if supported)" \
689 "\n -r Get/set readonly flag (DANGEROUS to set)" \
690 IF_FEATURE_HDPARM_HDIO_SCAN_HWIF( \
691 "\n -R Register an IDE interface (DANGEROUS)") \
692 "\n -S Set standby (spindown) timeout" \
693 "\n -t Perform device read timings" \
694 "\n -T Perform cache read timings" \
695 "\n -u Get/set unmaskirq flag (0/1)" \
696 IF_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF( \
697 "\n -U Unregister an IDE interface (DANGEROUS)") \
698 "\n -v Defaults; same as -mcudkrag for IDE drives" \
699 "\n -V Display program version and exit immediately" \
700 IF_FEATURE_HDPARM_HDIO_DRIVE_RESET( \
701 "\n -w Perform device reset (DANGEROUS)") \
702 "\n -W Set drive write-caching flag (0/1) (DANGEROUS)" \
703 IF_FEATURE_HDPARM_HDIO_TRISTATE_HWIF( \
704 "\n -x Tristate device for hotswap (0/1) (DANGEROUS)") \
705 "\n -X Set IDE xfer mode (DANGEROUS)" \
706 "\n -y Put IDE drive in standby mode" \
707 "\n -Y Put IDE drive to sleep" \
708 "\n -Z Disable Seagate auto-powersaving mode" \
709 "\n -z Reread partition table" \
710
711#define hexdump_trivial_usage \
712 "[-bcCdefnosvx" IF_FEATURE_HEXDUMP_REVERSE("R") "] [FILE]..."
713#define hexdump_full_usage "\n\n" \
714 "Display FILEs (or stdin) in a user specified format\n" \
715 "\nOptions:" \
716 "\n -b One-byte octal display" \
717 "\n -c One-byte character display" \
718 "\n -C Canonical hex+ASCII, 16 bytes per line" \
719 "\n -d Two-byte decimal display" \
720 "\n -e FORMAT_STRING" \
721 "\n -f FORMAT_FILE" \
722 "\n -n LENGTH Interpret only LENGTH bytes of input" \
723 "\n -o Two-byte octal display" \
724 "\n -s OFFSET Skip OFFSET bytes" \
725 "\n -v Display all input data" \
726 "\n -x Two-byte hexadecimal display" \
727 IF_FEATURE_HEXDUMP_REVERSE( \
728 "\n -R Reverse of 'hexdump -Cv'") \
729
730#define hd_trivial_usage \
731 "FILE..."
732#define hd_full_usage "\n\n" \
733 "hd is an alias for hexdump -C"
734
735#define hostname_trivial_usage \
736 "[OPTIONS] [HOSTNAME | -F FILE]"
737#define hostname_full_usage "\n\n" \
738 "Get or set hostname or DNS domain name\n" \
739 "\nOptions:" \
740 "\n -s Short" \
741 "\n -i Addresses for the hostname" \
742 "\n -d DNS domain name" \
743 "\n -f Fully qualified domain name" \
744 "\n -F FILE Use FILE's content as hostname" \
745
746#define hostname_example_usage \
747 "$ hostname\n" \
748 "sage\n"
749
750#define dnsdomainname_trivial_usage NOUSAGE_STR
751#define dnsdomainname_full_usage ""
752
753#define httpd_trivial_usage \
754 "[-ifv[v]]" \
755 " [-c CONFFILE]" \
756 " [-p [IP:]PORT]" \
757 IF_FEATURE_HTTPD_SETUID(" [-u USER[:GRP]]") \
758 IF_FEATURE_HTTPD_BASIC_AUTH(" [-r REALM]") \
759 " [-h HOME]\n" \
760 "or httpd -d/-e" IF_FEATURE_HTTPD_AUTH_MD5("/-m") " STRING"
761#define httpd_full_usage "\n\n" \
762 "Listen for incoming HTTP requests\n" \
763 "\nOptions:" \
764 "\n -i Inetd mode" \
765 "\n -f Don't daemonize" \
766 "\n -v[v] Verbose" \
767 "\n -p [IP:]PORT Bind to IP:PORT (default *:80)" \
768 IF_FEATURE_HTTPD_SETUID( \
769 "\n -u USER[:GRP] Set uid/gid after binding to port") \
770 IF_FEATURE_HTTPD_BASIC_AUTH( \
771 "\n -r REALM Authentication Realm for Basic Authentication") \
772 "\n -h HOME Home directory (default .)" \
773 "\n -c FILE Configuration file (default {/etc,HOME}/httpd.conf)" \
774 IF_FEATURE_HTTPD_AUTH_MD5( \
775 "\n -m STRING MD5 crypt STRING") \
776 "\n -e STRING HTML encode STRING" \
777 "\n -d STRING URL decode STRING" \
778
779#define ifconfig_trivial_usage \
780 IF_FEATURE_IFCONFIG_STATUS("[-a]") " interface [address]"
781#define ifconfig_full_usage "\n\n" \
782 "Configure a network interface\n" \
783 "\nOptions:" \
784 "\n" \
785 IF_FEATURE_IPV6( \
786 " [add ADDRESS[/PREFIXLEN]]\n") \
787 IF_FEATURE_IPV6( \
788 " [del ADDRESS[/PREFIXLEN]]\n") \
789 " [[-]broadcast [ADDRESS]] [[-]pointopoint [ADDRESS]]\n" \
790 " [netmask ADDRESS] [dstaddr ADDRESS]\n" \
791 IF_FEATURE_IFCONFIG_SLIP( \
792 " [outfill NN] [keepalive NN]\n") \
793 " " IF_FEATURE_IFCONFIG_HW("[hw ether" IF_FEATURE_HWIB("|infiniband")" ADDRESS] ") "[metric NN] [mtu NN]\n" \
794 " [[-]trailers] [[-]arp] [[-]allmulti]\n" \
795 " [multicast] [[-]promisc] [txqueuelen NN] [[-]dynamic]\n" \
796 IF_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ( \
797 " [mem_start NN] [io_addr NN] [irq NN]\n") \
798 " [up|down] ..."
799
800#define ifenslave_trivial_usage \
801 "[-cdf] MASTER_IFACE SLAVE_IFACE..."
802#define ifenslave_full_usage "\n\n" \
803 "Configure network interfaces for parallel routing\n" \
804 "\nOptions:" \
805 "\n -c,--change-active Change active slave" \
806 "\n -d,--detach Remove slave interface from bonding device" \
807 "\n -f,--force Force, even if interface is not Ethernet" \
808/* "\n -r,--receive-slave Create a receive-only slave" */
809
810#define ifenslave_example_usage \
811 "To create a bond device, simply follow these three steps:\n" \
812 "- ensure that the required drivers are properly loaded:\n" \
813 " # modprobe bonding ; modprobe <3c59x|eepro100|pcnet32|tulip|...>\n" \
814 "- assign an IP address to the bond device:\n" \
815 " # ifconfig bond0 <addr> netmask <mask> broadcast <bcast>\n" \
816 "- attach all the interfaces you need to the bond device:\n" \
817 " # ifenslave bond0 eth0 eth1 eth2\n" \
818 " If bond0 didn't have a MAC address, it will take eth0's. Then, all\n" \
819 " interfaces attached AFTER this assignment will get the same MAC addr.\n\n" \
820 " To detach a dead interface without setting the bond device down:\n" \
821 " # ifenslave -d bond0 eth1\n\n" \
822 " To set the bond device down and automatically release all the slaves:\n" \
823 " # ifconfig bond0 down\n\n" \
824 " To change active slave:\n" \
825 " # ifenslave -c bond0 eth0\n" \
826
827#define ifplugd_trivial_usage \
828 "[OPTIONS]"
829#define ifplugd_full_usage "\n\n" \
830 "Network interface plug detection daemon\n" \
831 "\nOptions:" \
832 "\n -n Don't daemonize" \
833 "\n -s Don't log to syslog" \
834 "\n -i IFACE Interface" \
835 "\n -f/-F Treat link detection error as link down/link up" \
836 "\n (otherwise exit on error)" \
837 "\n -a Don't up interface at each link probe" \
838 "\n -M Monitor creation/destruction of interface" \
839 "\n (otherwise it must exist)" \
840 "\n -r PROG Script to run" \
841 "\n -x ARG Extra argument for script" \
842 "\n -I Don't exit on nonzero exit code from script" \
843 "\n -p Don't run script on daemon startup" \
844 "\n -q Don't run script on daemon quit" \
845 "\n -l Run script on startup even if no cable is detected" \
846 "\n -t SECS Poll time in seconds" \
847 "\n -u SECS Delay before running script after link up" \
848 "\n -d SECS Delay after link down" \
849 "\n -m MODE API mode (mii, priv, ethtool, wlan, iff, auto)" \
850 "\n -k Kill running daemon" \
851
852#define ifup_trivial_usage \
853 "[-an"IF_FEATURE_IFUPDOWN_MAPPING("m")"vf] [-i FILE] IFACE..."
854#define ifup_full_usage "\n\n" \
855 "Options:" \
856 "\n -a De/configure all interfaces automatically" \
857 "\n -i FILE Use FILE for interface definitions" \
858 "\n -n Print out what would happen, but don't do it" \
859 IF_FEATURE_IFUPDOWN_MAPPING( \
860 "\n (note: doesn't disable mappings)" \
861 "\n -m Don't run any mappings" \
862 ) \
863 "\n -v Print out what would happen before doing it" \
864 "\n -f Force de/configuration" \
865
866#define ifdown_trivial_usage \
867 "[-an"IF_FEATURE_IFUPDOWN_MAPPING("m")"vf] [-i FILE] IFACE..."
868#define ifdown_full_usage "\n\n" \
869 "Options:" \
870 "\n -a De/configure all interfaces automatically" \
871 "\n -i FILE Use FILE for interface definitions" \
872 "\n -n Print out what would happen, but don't do it" \
873 IF_FEATURE_IFUPDOWN_MAPPING( \
874 "\n (note: doesn't disable mappings)" \
875 "\n -m Don't run any mappings" \
876 ) \
877 "\n -v Print out what would happen before doing it" \
878 "\n -f Force de/configuration" \
879
880#define inetd_trivial_usage \
881 "[-fe] [-q N] [-R N] [CONFFILE]"
882#define inetd_full_usage "\n\n" \
883 "Listen for network connections and launch programs\n" \
884 "\nOptions:" \
885 "\n -f Run in foreground" \
886 "\n -e Log to stderr" \
887 "\n -q N Socket listen queue (default: 128)" \
888 "\n -R N Pause services after N connects/min" \
889 "\n (default: 0 - disabled)" \
890
891#define inotifyd_trivial_usage \
892 "PROG FILE1[:MASK]..."
893#define inotifyd_full_usage "\n\n" \
894 "Run PROG on filesystem changes." \
895 "\nWhen a filesystem event matching MASK occurs on FILEn," \
896 "\nPROG ACTUAL_EVENTS FILEn [SUBFILE] is run." \
897 "\nEvents:" \
898 "\n a File is accessed" \
899 "\n c File is modified" \
900 "\n e Metadata changed" \
901 "\n w Writable file is closed" \
902 "\n 0 Unwritable file is closed" \
903 "\n r File is opened" \
904 "\n D File is deleted" \
905 "\n M File is moved" \
906 "\n u Backing fs is unmounted" \
907 "\n o Event queue overflowed" \
908 "\n x File can't be watched anymore" \
909 "\nIf watching a directory:" \
910 "\n m Subfile is moved into dir" \
911 "\n y Subfile is moved out of dir" \
912 "\n n Subfile is created" \
913 "\n d Subfile is deleted" \
914 "\n" \
915 "\ninotifyd waits for PROG to exit." \
916 "\nWhen x event happens for all FILEs, inotifyd exits." \
917
918/* would need to make the " | " optional depending on more than one selected: */
919#define ip_trivial_usage \
920 "[OPTIONS] {" \
921 IF_FEATURE_IP_ADDRESS("address | ") \
922 IF_FEATURE_IP_ROUTE("route | ") \
923 IF_FEATURE_IP_LINK("link | ") \
924 IF_FEATURE_IP_TUNNEL("tunnel | ") \
925 IF_FEATURE_IP_RULE("rule") \
926 "} {COMMAND}"
927#define ip_full_usage "\n\n" \
928 "ip [OPTIONS] OBJECT {COMMAND}\n" \
929 "where OBJECT := {" \
930 IF_FEATURE_IP_ADDRESS("address | ") \
931 IF_FEATURE_IP_ROUTE("route | ") \
932 IF_FEATURE_IP_LINK("link | ") \
933 IF_FEATURE_IP_TUNNEL("tunnel | ") \
934 IF_FEATURE_IP_RULE("rule") \
935 "}\n" \
936 "OPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }" \
937
938#define ipaddr_trivial_usage \
939 "{ {add|del} IFADDR dev STRING | {show|flush}\n" \
940 " [dev STRING] [to PREFIX] }"
941#define ipaddr_full_usage "\n\n" \
942 "ipaddr {add|delete} IFADDR dev STRING\n" \
943 "ipaddr {show|flush} [dev STRING] [scope SCOPE-ID]\n" \
944 " [to PREFIX] [label PATTERN]\n" \
945 " IFADDR := PREFIX | ADDR peer PREFIX\n" \
946 " [broadcast ADDR] [anycast ADDR]\n" \
947 " [label STRING] [scope SCOPE-ID]\n" \
948 " SCOPE-ID := [host | link | global | NUMBER]" \
949
950#define ipcalc_trivial_usage \
951 "[OPTIONS] ADDRESS[[/]NETMASK] [NETMASK]"
952#define ipcalc_full_usage "\n\n" \
953 "Calculate IP network settings from a IP address\n" \
954 "\nOptions:" \
955 IF_FEATURE_IPCALC_LONG_OPTIONS( \
956 "\n -b,--broadcast Display calculated broadcast address" \
957 "\n -n,--network Display calculated network address" \
958 "\n -m,--netmask Display default netmask for IP" \
959 IF_FEATURE_IPCALC_FANCY( \
960 "\n -p,--prefix Display the prefix for IP/NETMASK" \
961 "\n -h,--hostname Display first resolved host name" \
962 "\n -s,--silent Don't ever display error messages" \
963 ) \
964 ) \
965 IF_NOT_FEATURE_IPCALC_LONG_OPTIONS( \
966 "\n -b Display calculated broadcast address" \
967 "\n -n Display calculated network address" \
968 "\n -m Display default netmask for IP" \
969 IF_FEATURE_IPCALC_FANCY( \
970 "\n -p Display the prefix for IP/NETMASK" \
971 "\n -h Display first resolved host name" \
972 "\n -s Don't ever display error messages" \
973 ) \
974 )
975
976#define ipcrm_trivial_usage \
977 "[-MQS key] [-mqs id]"
978#define ipcrm_full_usage "\n\n" \
979 "Upper-case options MQS remove an object by shmkey value.\n" \
980 "Lower-case options remove an object by shmid value.\n" \
981 "\nOptions:" \
982 "\n -mM Remove memory segment after last detach" \
983 "\n -qQ Remove message queue" \
984 "\n -sS Remove semaphore" \
985
986#define ipcs_trivial_usage \
987 "[[-smq] -i shmid] | [[-asmq] [-tcplu]]"
988#define ipcs_full_usage "\n\n" \
989 " -i Show specific resource" \
990 "\nResource specification:" \
991 "\n -m Shared memory segments" \
992 "\n -q Message queues" \
993 "\n -s Semaphore arrays" \
994 "\n -a All (default)" \
995 "\nOutput format:" \
996 "\n -t Time" \
997 "\n -c Creator" \
998 "\n -p Pid" \
999 "\n -l Limits" \
1000 "\n -u Summary" \
1001
1002#define iplink_trivial_usage \
1003 "{ set DEVICE { up | down | arp { on | off } | show [DEVICE] }"
1004#define iplink_full_usage "\n\n" \
1005 "iplink set DEVICE { up | down | arp | multicast { on | off } |\n" \
1006 " dynamic { on | off } |\n" \
1007 " mtu MTU }\n" \
1008 "iplink show [DEVICE]" \
1009
1010#define iproute_trivial_usage \
1011 "{ list | flush | { add | del | change | append |\n" \
1012 " replace | monitor } ROUTE }"
1013#define iproute_full_usage "\n\n" \
1014 "iproute { list | flush } SELECTOR\n" \
1015 "iproute get ADDRESS [from ADDRESS iif STRING]\n" \
1016 " [oif STRING] [tos TOS]\n" \
1017 "iproute { add | del | change | append | replace | monitor } ROUTE\n" \
1018 " SELECTOR := [root PREFIX] [match PREFIX] [proto RTPROTO]\n" \
1019 " ROUTE := [TYPE] PREFIX [tos TOS] [proto RTPROTO]\n" \
1020 " [metric METRIC]" \
1021
1022#define iprule_trivial_usage \
1023 "{[list | add | del] RULE}"
1024#define iprule_full_usage "\n\n" \
1025 "iprule [list | add | del] SELECTOR ACTION\n" \
1026 " SELECTOR := [from PREFIX] [to PREFIX] [tos TOS] [fwmark FWMARK]\n" \
1027 " [dev STRING] [pref NUMBER]\n" \
1028 " ACTION := [table TABLE_ID] [nat ADDRESS]\n" \
1029 " [prohibit | reject | unreachable]\n" \
1030 " [realms [SRCREALM/]DSTREALM]\n" \
1031 " TABLE_ID := [local | main | default | NUMBER]" \
1032
1033#define iptunnel_trivial_usage \
1034 "{ add | change | del | show } [NAME]\n" \
1035 " [mode { ipip | gre | sit }]\n" \
1036 " [remote ADDR] [local ADDR] [ttl TTL]"
1037#define iptunnel_full_usage "\n\n" \
1038 "iptunnel { add | change | del | show } [NAME]\n" \
1039 " [mode { ipip | gre | sit }] [remote ADDR] [local ADDR]\n" \
1040 " [[i|o]seq] [[i|o]key KEY] [[i|o]csum]\n" \
1041 " [ttl TTL] [tos TOS] [[no]pmtudisc] [dev PHYS_DEV]" \
1042
1043#define kill_trivial_usage \
1044 "[-l] [-SIG] PID..."
1045#define kill_full_usage "\n\n" \
1046 "Send a signal (default: TERM) to given PIDs\n" \
1047 "\nOptions:" \
1048 "\n -l List all signal names and numbers" \
1049/* "\n -s SIG Yet another way of specifying SIG" */ \
1050
1051#define kill_example_usage \
1052 "$ ps | grep apache\n" \
1053 "252 root root S [apache]\n" \
1054 "263 www-data www-data S [apache]\n" \
1055 "264 www-data www-data S [apache]\n" \
1056 "265 www-data www-data S [apache]\n" \
1057 "266 www-data www-data S [apache]\n" \
1058 "267 www-data www-data S [apache]\n" \
1059 "$ kill 252\n"
1060
1061#define killall_trivial_usage \
1062 "[-l] [-q] [-SIG] PROCESS_NAME..."
1063#define killall_full_usage "\n\n" \
1064 "Send a signal (default: TERM) to given processes\n" \
1065 "\nOptions:" \
1066 "\n -l List all signal names and numbers" \
1067/* "\n -s SIG Yet another way of specifying SIG" */ \
1068 "\n -q Don't complain if no processes were killed" \
1069
1070#define killall_example_usage \
1071 "$ killall apache\n"
1072
1073#define killall5_trivial_usage \
1074 "[-l] [-SIG] [-o PID]..."
1075#define killall5_full_usage "\n\n" \
1076 "Send a signal (default: TERM) to all processes outside current session\n" \
1077 "\nOptions:" \
1078 "\n -l List all signal names and numbers" \
1079 "\n -o PID Don't signal this PID" \
1080/* "\n -s SIG Yet another way of specifying SIG" */ \
1081
1082#define klogd_trivial_usage \
1083 "[-c N] [-n]"
1084#define klogd_full_usage "\n\n" \
1085 "Kernel logger\n" \
1086 "\nOptions:" \
1087 "\n -c N Only messages with level < N are printed to console" \
1088 "\n -n Run in foreground" \
1089
1090#define less_trivial_usage \
1091 "[-EMNmh~I?] [FILE]..."
1092#define less_full_usage "\n\n" \
1093 "View FILE (or stdin) one screenful at a time\n" \
1094 "\nOptions:" \
1095 "\n -E Quit once the end of a file is reached" \
1096 "\n -M,-m Display status line with line numbers" \
1097 "\n and percentage through the file" \
1098 "\n -N Prefix line number to each line" \
1099 "\n -I Ignore case in all searches" \
1100 "\n -~ Suppress ~s displayed past the end of the file" \
1101
1102#define linux32_trivial_usage NOUSAGE_STR
1103#define linux32_full_usage ""
1104#define linux64_trivial_usage NOUSAGE_STR
1105#define linux64_full_usage ""
1106
1107#define setarch_trivial_usage \
1108 "personality PROG ARGS"
1109#define setarch_full_usage "\n\n" \
1110 "Personality may be:\n" \
1111 " linux32 Set 32bit uname emulation\n" \
1112 " linux64 Set 64bit uname emulation" \
1113
1114#define load_policy_trivial_usage NOUSAGE_STR
1115#define load_policy_full_usage ""
1116
1117#define logger_trivial_usage \
1118 "[OPTIONS] [MESSAGE]"
1119#define logger_full_usage "\n\n" \
1120 "Write MESSAGE (or stdin) to syslog\n" \
1121 "\nOptions:" \
1122 "\n -s Log to stderr as well as the system log" \
1123 "\n -t TAG Log using the specified tag (defaults to user name)" \
1124 "\n -p PRIO Priority (numeric or facility.level pair)" \
1125
1126#define logger_example_usage \
1127 "$ logger \"hello\"\n"
1128
1129#define logread_trivial_usage \
1130 "[-f]"
1131#define logread_full_usage "\n\n" \
1132 "Show messages in syslogd's circular buffer\n" \
1133 "\nOptions:" \
1134 "\n -f Output data as log grows" \
1135
1136#define losetup_trivial_usage \
1137 "[-o OFS] LOOPDEV FILE - associate loop devices\n" \
1138 " losetup -d LOOPDEV - disassociate\n" \
1139 " losetup [-f] - show"
1140#define losetup_full_usage "\n\n" \
1141 "Options:" \
1142 "\n -o OFS Start OFS bytes into FILE" \
1143 "\n -f Show first free loop device" \
1144
1145#define losetup_notes_usage \
1146 "No arguments will display all current associations.\n" \
1147 "One argument (losetup /dev/loop1) will display the current association\n" \
1148 "(if any), or disassociate it (with -d). The display shows the offset\n" \
1149 "and filename of the file the loop device is currently bound to.\n\n" \
1150 "Two arguments (losetup /dev/loop1 file.img) create a new association,\n" \
1151 "with an optional offset (-o 12345). Encryption is not yet supported.\n" \
1152 "losetup -f will show the first loop free loop device\n\n"
1153
1154#define lpd_trivial_usage \
1155 "SPOOLDIR [HELPER [ARGS]]"
1156#define lpd_full_usage "\n\n" \
1157 "SPOOLDIR must contain (symlinks to) device nodes or directories" \
1158 "\nwith names matching print queue names. In the first case, jobs are" \
1159 "\nsent directly to the device. Otherwise each job is stored in queue" \
1160 "\ndirectory and HELPER program is called. Name of file to print" \
1161 "\nis passed in $DATAFILE variable." \
1162 "\nExample:" \
1163 "\n tcpsvd -E 0 515 softlimit -m 999999 lpd /var/spool ./print" \
1164
1165#define lpq_trivial_usage \
1166 "[-P queue[@host[:port]]] [-U USERNAME] [-d JOBID]... [-fs]"
1167#define lpq_full_usage "\n\n" \
1168 "Options:" \
1169 "\n -P lp service to connect to (else uses $PRINTER)" \
1170 "\n -d Delete jobs" \
1171 "\n -f Force any waiting job to be printed" \
1172 "\n -s Short display" \
1173
1174#define lpr_trivial_usage \
1175 "-P queue[@host[:port]] -U USERNAME -J TITLE -Vmh [FILE]..."
1176/* -C CLASS exists too, not shown.
1177 * CLASS is supposed to be printed on banner page, if one is requested */
1178#define lpr_full_usage "\n\n" \
1179 "Options:" \
1180 "\n -P lp service to connect to (else uses $PRINTER)"\
1181 "\n -m Send mail on completion" \
1182 "\n -h Print banner page too" \
1183 "\n -V Verbose" \
1184
1185#define lspci_trivial_usage \
1186 "[-mk]"
1187#define lspci_full_usage "\n\n" \
1188 "List all PCI devices" \
1189 "\n" \
1190 "\n -m Parseable output" \
1191 "\n -k Show driver" \
1192
1193#define lsusb_trivial_usage NOUSAGE_STR
1194#define lsusb_full_usage ""
1195
1196#if ENABLE_FEATURE_MAKEDEVS_LEAF
1197#define makedevs_trivial_usage \
1198 "NAME TYPE MAJOR MINOR FIRST LAST [s]"
1199#define makedevs_full_usage "\n\n" \
1200 "Create a range of block or character special files" \
1201 "\n" \
1202 "\nTYPE is:" \
1203 "\n b Block device" \
1204 "\n c Character device" \
1205 "\n f FIFO, MAJOR and MINOR are ignored" \
1206 "\n" \
1207 "\nFIRST..LAST specify numbers appended to NAME." \
1208 "\nIf 's' is the last argument, the base device is created as well." \
1209 "\n" \
1210 "\nExamples:" \
1211 "\n makedevs /dev/ttyS c 4 66 2 63 -> ttyS2-ttyS63" \
1212 "\n makedevs /dev/hda b 3 0 0 8 s -> hda,hda1-hda8"
1213#define makedevs_example_usage \
1214 "# makedevs /dev/ttyS c 4 66 2 63\n" \
1215 "[creates ttyS2-ttyS63]\n" \
1216 "# makedevs /dev/hda b 3 0 0 8 s\n" \
1217 "[creates hda,hda1-hda8]\n"
1218#endif
1219
1220#if ENABLE_FEATURE_MAKEDEVS_TABLE
1221#define makedevs_trivial_usage \
1222 "[-d device_table] rootdir"
1223#define makedevs_full_usage "\n\n" \
1224 "Create a range of special files as specified in a device table.\n" \
1225 "Device table entries take the form of:\n" \
1226 "<type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>\n" \
1227 "Where name is the file name, type can be one of:\n" \
1228 " f Regular file\n" \
1229 " d Directory\n" \
1230 " c Character device\n" \
1231 " b Block device\n" \
1232 " p Fifo (named pipe)\n" \
1233 "uid is the user id for the target file, gid is the group id for the\n" \
1234 "target file. The rest of the entries (major, minor, etc) apply to\n" \
1235 "to device special files. A '-' may be used for blank entries."
1236#define makedevs_example_usage \
1237 "For example:\n" \
1238 "<name> <type> <mode><uid><gid><major><minor><start><inc><count>\n" \
1239 "/dev d 755 0 0 - - - - -\n" \
1240 "/dev/console c 666 0 0 5 1 - - -\n" \
1241 "/dev/null c 666 0 0 1 3 0 0 -\n" \
1242 "/dev/zero c 666 0 0 1 5 0 0 -\n" \
1243 "/dev/hda b 640 0 0 3 0 0 0 -\n" \
1244 "/dev/hda b 640 0 0 3 1 1 1 15\n\n" \
1245 "Will Produce:\n" \
1246 "/dev\n" \
1247 "/dev/console\n" \
1248 "/dev/null\n" \
1249 "/dev/zero\n" \
1250 "/dev/hda\n" \
1251 "/dev/hda[0-15]\n"
1252#endif
1253
1254#define man_trivial_usage \
1255 "[-aw] [MANPAGE]..."
1256#define man_full_usage "\n\n" \
1257 "Format and display manual page\n" \
1258 "\nOptions:" \
1259 "\n -a Display all pages" \
1260 "\n -w Show page locations" \
1261
1262#define matchpathcon_trivial_usage \
1263 "[-n] [-N] [-f file_contexts_file] [-p prefix] [-V]"
1264#define matchpathcon_full_usage "\n\n" \
1265 " -n Don't display path" \
1266 "\n -N Don't use translations" \
1267 "\n -f Use alternate file_context file" \
1268 "\n -p Use prefix to speed translations" \
1269 "\n -V Verify file context on disk matches defaults" \
1270
1271#define mdev_trivial_usage \
1272 "[-s]"
1273#define mdev_full_usage "\n\n" \
1274 " -s Scan /sys and populate /dev during system boot\n" \
1275 "\n" \
1276 "It can be run by kernel as a hotplug helper. To activate it:\n" \
1277 " echo /sbin/mdev > /proc/sys/kernel/hotplug\n" \
1278 IF_FEATURE_MDEV_CONF( \
1279 "It uses /etc/mdev.conf with lines\n" \
1280 "[-]DEVNAME UID:GID PERM" \
1281 IF_FEATURE_MDEV_RENAME(" [>|=PATH]") \
1282 IF_FEATURE_MDEV_EXEC(" [@|$|*PROG]") \
1283 ) \
1284
1285#define mdev_notes_usage "" \
1286 IF_FEATURE_MDEV_CONFIG( \
1287 "The mdev config file contains lines that look like:\n" \
1288 " hd[a-z][0-9]* 0:3 660\n\n" \
1289 "That's device name (with regex match), uid:gid, and permissions.\n\n" \
1290 IF_FEATURE_MDEV_EXEC( \
1291 "Optionally, that can be followed (on the same line) by a special character\n" \
1292 "and a command line to run after creating/before deleting the corresponding\n" \
1293 "device(s). The environment variable $MDEV indicates the active device node\n" \
1294 "(which is useful if it's a regex match). For example:\n\n" \
1295 " hdc root:cdrom 660 *ln -s $MDEV cdrom\n\n" \
1296 "The special characters are @ (run after creating), $ (run before deleting),\n" \
1297 "and * (run both after creating and before deleting). The commands run in\n" \
1298 "the /dev directory, and use system() which calls /bin/sh.\n\n" \
1299 ) \
1300 "Config file parsing stops on the first matching line. If no config\n" \
1301 "entry is matched, devices are created with default 0:0 660. (Make\n" \
1302 "the last line match .* to override this.)\n\n" \
1303 )
1304
1305#define microcom_trivial_usage \
1306 "[-d DELAY] [-t TIMEOUT] [-s SPEED] [-X] TTY"
1307#define microcom_full_usage "\n\n" \
1308 "Copy bytes for stdin to TTY and from TTY to stdout\n" \
1309 "\nOptions:" \
1310 "\n -d Wait up to DELAY ms for TTY output before sending every" \
1311 "\n next byte to it" \
1312 "\n -t Exit if both stdin and TTY are silent for TIMEOUT ms" \
1313 "\n -s Set serial line to SPEED" \
1314 "\n -X Disable special meaning of NUL and Ctrl-X from stdin" \
1315
1316#define mkfs_ext2_trivial_usage \
1317 "[-Fn] " \
1318 /* "[-c|-l filename] " */ \
1319 "[-b BLK_SIZE] " \
1320 /* "[-f fragment-size] [-g blocks-per-group] " */ \
1321 "[-i INODE_RATIO] [-I INODE_SIZE] " \
1322 /* "[-j] [-J journal-options] [-N number-of-inodes] " */ \
1323 "[-m RESERVED_PERCENT] " \
1324 /* "[-o creator-os] [-O feature[,...]] [-q] " */ \
1325 /* "[r fs-revision-level] [-E extended-options] [-v] [-F] " */ \
1326 "[-L LABEL] " \
1327 /* "[-M last-mounted-directory] [-S] [-T filesystem-type] " */ \
1328 "BLOCKDEV [KBYTES]"
1329#define mkfs_ext2_full_usage "\n\n" \
1330 " -b BLK_SIZE Block size, bytes" \
1331/* "\n -c Check device for bad blocks" */ \
1332/* "\n -E opts Set extended options" */ \
1333/* "\n -f size Fragment size in bytes" */ \
1334 "\n -F Force" \
1335/* "\n -g N Number of blocks in a block group" */ \
1336 "\n -i RATIO Max number of files is filesystem_size / RATIO" \
1337 "\n -I BYTES Inode size (min 128)" \
1338/* "\n -j Create a journal (ext3)" */ \
1339/* "\n -J opts Set journal options (size/device)" */ \
1340/* "\n -l file Read bad blocks list from file" */ \
1341 "\n -L LBL Volume label" \
1342 "\n -m PERCENT Percent of blocks to reserve for admin" \
1343/* "\n -M dir Set last mounted directory" */ \
1344 "\n -n Dry run" \
1345/* "\n -N N Number of inodes to create" */ \
1346/* "\n -o os Set the 'creator os' field" */ \
1347/* "\n -O features Dir_index/filetype/has_journal/journal_dev/sparse_super" */ \
1348/* "\n -q Quiet" */ \
1349/* "\n -r rev Set filesystem revision" */ \
1350/* "\n -S Write superblock and group descriptors only" */ \
1351/* "\n -T fs-type Set usage type (news/largefile/largefile4)" */ \
1352/* "\n -v Verbose" */ \
1353
1354#define mkfs_minix_trivial_usage \
1355 "[-c | -l FILE] [-nXX] [-iXX] BLOCKDEV [KBYTES]"
1356#define mkfs_minix_full_usage "\n\n" \
1357 "Make a MINIX filesystem\n" \
1358 "\nOptions:" \
1359 "\n -c Check device for bad blocks" \
1360 "\n -n [14|30] Maximum length of filenames" \
1361 "\n -i INODES Number of inodes for the filesystem" \
1362 "\n -l FILE Read bad blocks list from FILE" \
1363 "\n -v Make version 2 filesystem" \
1364
1365#define mkfs_reiser_trivial_usage \
1366 "[-f] [-l LABEL] BLOCKDEV [4K-BLOCKS]"
1367
1368#define mkfs_reiser_full_usage "\n\n" \
1369 "Make a ReiserFS V3 filesystem\n" \
1370 "\nOptions:" \
1371 "\n -f Force" \
1372 "\n -l LBL Volume label" \
1373
1374#define mkfs_vfat_trivial_usage \
1375 "[-v] [-n LABEL] BLOCKDEV [KBYTES]"
1376/* Accepted but ignored:
1377 "[-c] [-C] [-I] [-l bad-block-file] [-b backup-boot-sector] "
1378 "[-m boot-msg-file] [-i volume-id] "
1379 "[-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs] "
1380 "[-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors] "
1381*/
1382#define mkfs_vfat_full_usage "\n\n" \
1383 "Make a FAT32 filesystem\n" \
1384 "\nOptions:" \
1385/* "\n -c Check device for bad blocks" */ \
1386 "\n -v Verbose" \
1387/* "\n -I Allow to use entire disk device (e.g. /dev/hda)" */ \
1388 "\n -n LBL Volume label" \
1389
1390#define mkswap_trivial_usage \
1391 "[-L LBL] BLOCKDEV [KBYTES]"
1392#define mkswap_full_usage "\n\n" \
1393 "Prepare BLOCKDEV to be used as swap partition\n" \
1394 "\nOptions:" \
1395 "\n -L LBL Label" \
1396
1397#define more_trivial_usage \
1398 "[FILE]..."
1399#define more_full_usage "\n\n" \
1400 "View FILE (or stdin) one screenful at a time"
1401
1402#define more_example_usage \
1403 "$ dmesg | more\n"
1404
1405#define mount_trivial_usage \
1406 "[OPTIONS] [-o OPTS] DEVICE NODE"
1407#define mount_full_usage "\n\n" \
1408 "Mount a filesystem. Filesystem autodetection requires /proc.\n" \
1409 "\nOptions:" \
1410 "\n -a Mount all filesystems in fstab" \
1411 IF_FEATURE_MOUNT_FAKE( \
1412 IF_FEATURE_MTAB_SUPPORT( \
1413 "\n -f Update /etc/mtab, but don't mount" \
1414 ) \
1415 IF_NOT_FEATURE_MTAB_SUPPORT( \
1416 "\n -f Dry run" \
1417 ) \
1418 ) \
1419 IF_FEATURE_MOUNT_HELPERS( \
1420 "\n -i Don't run mount helper" \
1421 ) \
1422 IF_FEATURE_MTAB_SUPPORT( \
1423 "\n -n Don't update /etc/mtab" \
1424 ) \
1425 "\n -r Read-only mount" \
1426 "\n -w Read-write mount (default)" \
1427 "\n -t FSTYPE Filesystem type" \
1428 "\n -O OPT Mount only filesystems with option OPT (-a only)" \
1429 "\n-o OPT:" \
1430 IF_FEATURE_MOUNT_LOOP( \
1431 "\n loop Ignored (loop devices are autodetected)" \
1432 ) \
1433 IF_FEATURE_MOUNT_FLAGS( \
1434 "\n [a]sync Writes are [a]synchronous" \
1435 "\n [no]atime Disable/enable updates to inode access times" \
1436 "\n [no]diratime Disable/enable atime updates to directories" \
1437 "\n [no]relatime Disable/enable atime updates relative to modification time" \
1438 "\n [no]dev (Dis)allow use of special device files" \
1439 "\n [no]exec (Dis)allow use of executable files" \
1440 "\n [no]suid (Dis)allow set-user-id-root programs" \
1441 "\n [r]shared Convert [recursively] to a shared subtree" \
1442 "\n [r]slave Convert [recursively] to a slave subtree" \
1443 "\n [r]private Convert [recursively] to a private subtree" \
1444 "\n [un]bindable Make mount point [un]able to be bind mounted" \
1445 "\n [r]bind Bind a file or directory [recursively] to another location" \
1446 "\n move Relocate an existing mount point" \
1447 ) \
1448 "\n remount Remount a mounted filesystem, changing flags" \
1449 "\n ro/rw Same as -r/-w" \
1450 "\n" \
1451 "\nThere are filesystem-specific -o flags." \
1452
1453#define mount_example_usage \
1454 "$ mount\n" \
1455 "/dev/hda3 on / type minix (rw)\n" \
1456 "proc on /proc type proc (rw)\n" \
1457 "devpts on /dev/pts type devpts (rw)\n" \
1458 "$ mount /dev/fd0 /mnt -t msdos -o ro\n" \
1459 "$ mount /tmp/diskimage /opt -t ext2 -o loop\n" \
1460 "$ mount cd_image.iso mydir\n"
1461#define mount_notes_usage \
1462 "Returns 0 for success, number of failed mounts for -a, or errno for one mount."
1463
1464#define mountpoint_trivial_usage \
1465 "[-q] <[-dn] DIR | -x DEVICE>"
1466#define mountpoint_full_usage "\n\n" \
1467 "Check if the directory is a mountpoint\n" \
1468 "\nOptions:" \
1469 "\n -q Quiet" \
1470 "\n -d Print major/minor device number of the filesystem" \
1471 "\n -n Print device name of the filesystem" \
1472 "\n -x Print major/minor device number of the blockdevice" \
1473
1474#define mountpoint_example_usage \
1475 "$ mountpoint /proc\n" \
1476 "/proc is not a mountpoint\n" \
1477 "$ mountpoint /sys\n" \
1478 "/sys is a mountpoint\n"
1479
1480#define mt_trivial_usage \
1481 "[-f device] opcode value"
1482#define mt_full_usage "\n\n" \
1483 "Control magnetic tape drive operation\n" \
1484 "\n" \
1485 "Available Opcodes:\n" \
1486 "\n" \
1487 "bsf bsfm bsr bss datacompression drvbuffer eof eom erase\n" \
1488 "fsf fsfm fsr fss load lock mkpart nop offline ras1 ras2\n" \
1489 "ras3 reset retension rewind rewoffline seek setblk setdensity\n" \
1490 "setpart tell unload unlock weof wset" \
1491
1492#define nslookup_trivial_usage \
1493 "[HOST] [SERVER]"
1494#define nslookup_full_usage "\n\n" \
1495 "Query the nameserver for the IP address of the given HOST\n" \
1496 "optionally using a specified DNS server"
1497#define nslookup_example_usage \
1498 "$ nslookup localhost\n" \
1499 "Server: default\n" \
1500 "Address: default\n" \
1501 "\n" \
1502 "Name: debian\n" \
1503 "Address: 127.0.0.1\n"
1504
1505#define ntpd_trivial_usage \
1506 "[-dnqNw"IF_FEATURE_NTPD_SERVER("l")"] [-S PROG] [-p PEER]..."
1507#define ntpd_full_usage "\n\n" \
1508 "NTP client/server\n" \
1509 "\nOptions:" \
1510 "\n -d Verbose" \
1511 "\n -n Do not daemonize" \
1512 "\n -q Quit after clock is set" \
1513 "\n -N Run at high priority" \
1514 "\n -w Do not set time (only query peers), implies -n" \
1515 IF_FEATURE_NTPD_SERVER( \
1516 "\n -l Run as server on port 123" \
1517 ) \
1518 "\n -S PROG Run PROG after stepping time, stratum change, and every 11 mins" \
1519 "\n -p PEER Obtain time from PEER (may be repeated)" \
1520
1521/*
1522#define parse_trivial_usage \
1523 "[-n MAXTOKENS] [-m MINTOKENS] [-d DELIMS] [-f FLAGS] FILE..."
1524#define parse_full_usage ""
1525*/
1526
1527#define pgrep_trivial_usage \
1528 "[-flnovx] [-s SID|-P PPID|PATTERN]"
1529#define pgrep_full_usage "\n\n" \
1530 "Display process(es) selected by regex PATTERN\n" \
1531 "\nOptions:" \
1532 "\n -l Show command name too" \
1533 "\n -f Match against entire command line" \
1534 "\n -n Show the newest process only" \
1535 "\n -o Show the oldest process only" \
1536 "\n -v Negate the match" \
1537 "\n -x Match whole name (not substring)" \
1538 "\n -s Match session ID (0 for current)" \
1539 "\n -P Match parent process ID" \
1540
1541#if (ENABLE_FEATURE_PIDOF_SINGLE || ENABLE_FEATURE_PIDOF_OMIT)
1542#define pidof_trivial_usage \
1543 "[OPTIONS] [NAME]..."
1544#define USAGE_PIDOF "\n\nOptions:"
1545#else
1546#define pidof_trivial_usage \
1547 "[NAME]..."
1548#define USAGE_PIDOF /* none */
1549#endif
1550#define pidof_full_usage "\n\n" \
1551 "List PIDs of all processes with names that match NAMEs" \
1552 USAGE_PIDOF \
1553 IF_FEATURE_PIDOF_SINGLE( \
1554 "\n -s Show only one PID" \
1555 ) \
1556 IF_FEATURE_PIDOF_OMIT( \
1557 "\n -o PID Omit given pid" \
1558 "\n Use %PPID to omit pid of pidof's parent" \
1559 ) \
1560
1561#define pidof_example_usage \
1562 "$ pidof init\n" \
1563 "1\n" \
1564 IF_FEATURE_PIDOF_OMIT( \
1565 "$ pidof /bin/sh\n20351 5973 5950\n") \
1566 IF_FEATURE_PIDOF_OMIT( \
1567 "$ pidof /bin/sh -o %PPID\n20351 5950")
1568
1569#define pivot_root_trivial_usage \
1570 "NEW_ROOT PUT_OLD"
1571#define pivot_root_full_usage "\n\n" \
1572 "Move the current root file system to PUT_OLD and make NEW_ROOT\n" \
1573 "the new root file system"
1574
1575#define pkill_trivial_usage \
1576 "[-l|-SIGNAL] [-fnovx] [-s SID|-P PPID|PATTERN]"
1577#define pkill_full_usage "\n\n" \
1578 "Send a signal to process(es) selected by regex PATTERN\n" \
1579 "\nOptions:" \
1580 "\n -l List all signals" \
1581 "\n -f Match against entire command line" \
1582 "\n -n Signal the newest process only" \
1583 "\n -o Signal the oldest process only" \
1584 "\n -v Negate the match" \
1585 "\n -x Match whole name (not substring)" \
1586 "\n -s Match session ID (0 for current)" \
1587 "\n -P Match parent process ID" \
1588
1589
1590#if ENABLE_DESKTOP
1591
1592#define ps_trivial_usage \
1593 "[-o COL1,COL2=HEADER]" IF_FEATURE_SHOW_THREADS(" [-T]")
1594#define ps_full_usage "\n\n" \
1595 "Show list of processes\n" \
1596 "\nOptions:" \
1597 "\n -o COL1,COL2=HEADER Select columns for display" \
1598 IF_FEATURE_SHOW_THREADS( \
1599 "\n -T Show threads" \
1600 )
1601
1602#else /* !ENABLE_DESKTOP */
1603
1604#if !ENABLE_SELINUX && !ENABLE_FEATURE_PS_WIDE
1605#define USAGE_PS "\nThis version of ps accepts no options"
1606#else
1607#define USAGE_PS "\nOptions:"
1608#endif
1609
1610#define ps_trivial_usage \
1611 ""
1612#define ps_full_usage "\n\n" \
1613 "Show list of processes\n" \
1614 USAGE_PS \
1615 IF_SELINUX( \
1616 "\n -Z Show selinux context" \
1617 ) \
1618 IF_FEATURE_PS_WIDE( \
1619 "\n w Wide output" \
1620 )
1621
1622#endif /* ENABLE_DESKTOP */
1623
1624#define ps_example_usage \
1625 "$ ps\n" \
1626 " PID Uid Gid State Command\n" \
1627 " 1 root root S init\n" \
1628 " 2 root root S [kflushd]\n" \
1629 " 3 root root S [kupdate]\n" \
1630 " 4 root root S [kpiod]\n" \
1631 " 5 root root S [kswapd]\n" \
1632 " 742 andersen andersen S [bash]\n" \
1633 " 743 andersen andersen S -bash\n" \
1634 " 745 root root S [getty]\n" \
1635 " 2990 andersen andersen R ps\n" \
1636
1637#define pscan_trivial_usage \
1638 "[-cb] [-p MIN_PORT] [-P MAX_PORT] [-t TIMEOUT] [-T MIN_RTT] HOST"
1639#define pscan_full_usage "\n\n" \
1640 "Scan a host, print all open ports\n" \
1641 "\nOptions:" \
1642 "\n -c Show closed ports too" \
1643 "\n -b Show blocked ports too" \
1644 "\n -p Scan from this port (default 1)" \
1645 "\n -P Scan up to this port (default 1024)" \
1646 "\n -t Timeout (default 5000 ms)" \
1647 "\n -T Minimum rtt (default 5 ms, increase for congested hosts)" \
1648
1649#define raidautorun_trivial_usage \
1650 "DEVICE"
1651#define raidautorun_full_usage "\n\n" \
1652 "Tell the kernel to automatically search and start RAID arrays"
1653#define raidautorun_example_usage \
1654 "$ raidautorun /dev/md0"
1655
1656#define rdate_trivial_usage \
1657 "[-sp] HOST"
1658#define rdate_full_usage "\n\n" \
1659 "Get and possibly set the system date and time from a remote HOST\n" \
1660 "\nOptions:" \
1661 "\n -s Set the system date and time (default)" \
1662 "\n -p Print the date and time" \
1663
1664#define rdev_trivial_usage \
1665 ""
1666#define rdev_full_usage "\n\n" \
1667 "Print the device node associated with the filesystem mounted at '/'"
1668#define rdev_example_usage \
1669 "$ rdev\n" \
1670 "/dev/mtdblock9 /\n"
1671
1672#define readahead_trivial_usage \
1673 "[FILE]..."
1674#define readahead_full_usage "\n\n" \
1675 "Preload FILEs to RAM"
1676
1677#define readprofile_trivial_usage \
1678 "[OPTIONS]"
1679#define readprofile_full_usage "\n\n" \
1680 "Options:" \
1681 "\n -m mapfile (Default: /boot/System.map)" \
1682 "\n -p profile (Default: /proc/profile)" \
1683 "\n -M NUM Set the profiling multiplier to NUM" \
1684 "\n -i Print only info about the sampling step" \
1685 "\n -v Verbose" \
1686 "\n -a Print all symbols, even if count is 0" \
1687 "\n -b Print individual histogram-bin counts" \
1688 "\n -s Print individual counters within functions" \
1689 "\n -r Reset all the counters (root only)" \
1690 "\n -n Disable byte order auto-detection" \
1691
1692#define scriptreplay_trivial_usage \
1693 "timingfile [typescript [divisor]]"
1694#define scriptreplay_full_usage "\n\n" \
1695 "Play back typescripts, using timing information"
1696
1697#define restorecon_trivial_usage \
1698 "[-iFnRv] [-e EXCLUDEDIR]... [-o FILE] [-f FILE]"
1699#define restorecon_full_usage "\n\n" \
1700 "Reset security contexts of files in pathname\n" \
1701 "\n -i Ignore files that don't exist" \
1702 "\n -f FILE File with list of files to process" \
1703 "\n -e DIR Directory to exclude" \
1704 "\n -R,-r Recurse" \
1705 "\n -n Don't change any file labels" \
1706 "\n -o FILE Save list of files with incorrect context" \
1707 "\n -v Verbose" \
1708 "\n -vv Show changed labels" \
1709 "\n -F Force reset of context to match file_context" \
1710 "\n for customizable files, or the user section," \
1711 "\n if it has changed" \
1712
1713#define rfkill_trivial_usage \
1714 "COMMAND [INDEX|TYPE]"
1715#define rfkill_full_usage "\n\n" \
1716 "Enable/disable wireless devices\n" \
1717 "\nCommands:" \
1718 "\n list [INDEX|TYPE] List current state" \
1719 "\n block INDEX|TYPE Disable device" \
1720 "\n unblock INDEX|TYPE Enable device" \
1721 "\n" \
1722 "\n TYPE: all, wlan(wifi), bluetooth, uwb(ultrawideband)," \
1723 "\n wimax, wwan, gps, fm" \
1724
1725#define route_trivial_usage \
1726 "[{add|del|delete}]"
1727#define route_full_usage "\n\n" \
1728 "Edit kernel routing tables\n" \
1729 "\nOptions:" \
1730 "\n -n Don't resolve names" \
1731 "\n -e Display other/more information" \
1732 "\n -A inet" IF_FEATURE_IPV6("{6}") " Select address family" \
1733
1734#define rtcwake_trivial_usage \
1735 "[-a | -l | -u] [-d DEV] [-m MODE] [-s SEC | -t TIME]"
1736#define rtcwake_full_usage "\n\n" \
1737 "Enter a system sleep state until specified wakeup time\n" \
1738 IF_LONG_OPTS( \
1739 "\n -a,--auto Read clock mode from adjtime" \
1740 "\n -l,--local Clock is set to local time" \
1741 "\n -u,--utc Clock is set to UTC time" \
1742 "\n -d,--device=DEV Specify the RTC device" \
1743 "\n -m,--mode=MODE Set the sleep state (default: standby)" \
1744 "\n -s,--seconds=SEC Set the timeout in SEC seconds from now" \
1745 "\n -t,--time=TIME Set the timeout to TIME seconds from epoch" \
1746 ) \
1747 IF_NOT_LONG_OPTS( \
1748 "\n -a Read clock mode from adjtime" \
1749 "\n -l Clock is set to local time" \
1750 "\n -u Clock is set to UTC time" \
1751 "\n -d DEV Specify the RTC device" \
1752 "\n -m MODE Set the sleep state (default: standby)" \
1753 "\n -s SEC Set the timeout in SEC seconds from now" \
1754 "\n -t TIME Set the timeout to TIME seconds from epoch" \
1755 )
1756
1757#define runcon_trivial_usage \
1758 "[-c] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] PROG ARGS\n" \
1759 "runcon CONTEXT PROG ARGS"
1760#define runcon_full_usage "\n\n" \
1761 "Run PROG in a different security context\n" \
1762 "\n CONTEXT Complete security context\n" \
1763 IF_FEATURE_RUNCON_LONG_OPTIONS( \
1764 "\n -c,--compute Compute process transition context before modifying" \
1765 "\n -t,--type=TYPE Type (for same role as parent)" \
1766 "\n -u,--user=USER User identity" \
1767 "\n -r,--role=ROLE Role" \
1768 "\n -l,--range=RNG Levelrange" \
1769 ) \
1770 IF_NOT_FEATURE_RUNCON_LONG_OPTIONS( \
1771 "\n -c Compute process transition context before modifying" \
1772 "\n -t TYPE Type (for same role as parent)" \
1773 "\n -u USER User identity" \
1774 "\n -r ROLE Role" \
1775 "\n -l RNG Levelrange" \
1776 )
1777
1778#define runlevel_trivial_usage \
1779 "[FILE]"
1780#define runlevel_full_usage "\n\n" \
1781 "Find the current and previous system runlevel\n" \
1782 "\n" \
1783 "If no utmp FILE exists or if no runlevel record can be found,\n" \
1784 "print \"unknown\""
1785#define runlevel_example_usage \
1786 "$ runlevel /var/run/utmp\n" \
1787 "N 2"
1788
1789#define runsv_trivial_usage \
1790 "DIR"
1791#define runsv_full_usage "\n\n" \
1792 "Start and monitor a service and optionally an appendant log service"
1793
1794#define runsvdir_trivial_usage \
1795 "[-P] [-s SCRIPT] DIR"
1796#define runsvdir_full_usage "\n\n" \
1797 "Start a runsv process for each subdirectory. If it exits, restart it.\n" \
1798 "\n -P Put each runsv in a new session" \
1799 "\n -s SCRIPT Run SCRIPT <signo> after signal is processed" \
1800
1801#define rx_trivial_usage \
1802 "FILE"
1803#define rx_full_usage "\n\n" \
1804 "Receive a file using the xmodem protocol"
1805#define rx_example_usage \
1806 "$ rx /tmp/foo\n"
1807
1808#define script_trivial_usage \
1809 "[-afq" IF_SCRIPTREPLAY("t") "] [-c PROG] [OUTFILE]"
1810#define script_full_usage "\n\n" \
1811 "Options:" \
1812 "\n -a Append output" \
1813 "\n -c PROG Run PROG, not shell" \
1814 "\n -f Flush output after each write" \
1815 "\n -q Quiet" \
1816 IF_SCRIPTREPLAY( \
1817 "\n -t Send timing to stderr" \
1818 )
1819
1820#define selinuxenabled_trivial_usage NOUSAGE_STR
1821#define selinuxenabled_full_usage ""
1822
1823#define sestatus_trivial_usage \
1824 "[-vb]"
1825#define sestatus_full_usage "\n\n" \
1826 " -v Verbose" \
1827 "\n -b Display current state of booleans" \
1828
1829#define setenforce_trivial_usage \
1830 "[Enforcing | Permissive | 1 | 0]"
1831#define setenforce_full_usage ""
1832
1833#define setfiles_trivial_usage \
1834 "[-dnpqsvW] [-e DIR]... [-o FILE] [-r alt_root_path]" \
1835 IF_FEATURE_SETFILES_CHECK_OPTION( \
1836 " [-c policyfile] spec_file" \
1837 ) \
1838 " pathname"
1839#define setfiles_full_usage "\n\n" \
1840 "Reset file contexts under pathname according to spec_file\n" \
1841 IF_FEATURE_SETFILES_CHECK_OPTION( \
1842 "\n -c FILE Check the validity of the contexts against the specified binary policy" \
1843 ) \
1844 "\n -d Show which specification matched each file" \
1845 "\n -l Log changes in file labels to syslog" \
1846 "\n -n Don't change any file labels" \
1847 "\n -q Suppress warnings" \
1848 "\n -r DIR Use an alternate root path" \
1849 "\n -e DIR Exclude DIR" \
1850 "\n -F Force reset of context to match file_context for customizable files" \
1851 "\n -o FILE Save list of files with incorrect context" \
1852 "\n -s Take a list of files from stdin (instead of command line)" \
1853 "\n -v Show changes in file labels, if type or role are changing" \
1854 "\n -vv Show changes in file labels, if type, role, or user are changing" \
1855 "\n -W Display warnings about entries that had no matching files" \
1856
1857#define setfont_trivial_usage \
1858 "FONT [-m MAPFILE] [-C TTY]"
1859#define setfont_full_usage "\n\n" \
1860 "Load a console font\n" \
1861 "\nOptions:" \
1862 "\n -m MAPFILE Load console screen map" \
1863 "\n -C TTY Affect TTY instead of /dev/tty" \
1864
1865#define setfont_example_usage \
1866 "$ setfont -m koi8-r /etc/i18n/fontname\n"
1867
1868#define setsebool_trivial_usage \
1869 "boolean value"
1870
1871#define setsebool_full_usage "\n\n" \
1872 "Change boolean setting"
1873
1874#define setsid_trivial_usage \
1875 "PROG ARGS"
1876#define setsid_full_usage "\n\n" \
1877 "Run PROG in a new session. PROG will have no controlling terminal\n" \
1878 "and will not be affected by keyboard signals (Ctrl-C etc).\n" \
1879 "See setsid(2) for details." \
1880
1881#define last_trivial_usage \
1882 ""IF_FEATURE_LAST_FANCY("[-HW] [-f FILE]")
1883#define last_full_usage "\n\n" \
1884 "Show listing of the last users that logged into the system" \
1885 IF_FEATURE_LAST_FANCY( "\n" \
1886 "\nOptions:" \
1887/* "\n -H Show header line" */ \
1888 "\n -W Display with no host column truncation" \
1889 "\n -f FILE Read from FILE instead of /var/log/wtmp" \
1890 )
1891
1892#define slattach_trivial_usage \
1893 "[-cehmLF] [-s SPEED] [-p PROTOCOL] DEVICE"
1894#define slattach_full_usage "\n\n" \
1895 "Attach network interface(s) to serial line(s)\n" \
1896 "\nOptions:" \
1897 "\n -p PROT Set protocol (slip, cslip, slip6, clisp6 or adaptive)" \
1898 "\n -s SPD Set line speed" \
1899 "\n -e Exit after initializing device" \
1900 "\n -h Exit when the carrier is lost" \
1901 "\n -c PROG Run PROG when the line is hung up" \
1902 "\n -m Do NOT initialize the line in raw 8 bits mode" \
1903 "\n -L Enable 3-wire operation" \
1904 "\n -F Disable RTS/CTS flow control" \
1905
1906#define strings_trivial_usage \
1907 "[-afo] [-n LEN] [FILE]..."
1908#define strings_full_usage "\n\n" \
1909 "Display printable strings in a binary file\n" \
1910 "\nOptions:" \
1911 "\n -a Scan whole file (default)" \
1912 "\n -f Precede strings with filenames" \
1913 "\n -n LEN At least LEN characters form a string (default 4)" \
1914 "\n -o Precede strings with decimal offsets" \
1915
1916#define sv_trivial_usage \
1917 "[-v] [-w SEC] CMD SERVICE_DIR..."
1918#define sv_full_usage "\n\n" \
1919 "Control services monitored by runsv supervisor.\n" \
1920 "Commands (only first character is enough):\n" \
1921 "\n" \
1922 "status: query service status\n" \
1923 "up: if service isn't running, start it. If service stops, restart it\n" \
1924 "once: like 'up', but if service stops, don't restart it\n" \
1925 "down: send TERM and CONT signals. If ./run exits, start ./finish\n" \
1926 " if it exists. After it stops, don't restart service\n" \
1927 "exit: send TERM and CONT signals to service and log service. If they exit,\n" \
1928 " runsv exits too\n" \
1929 "pause, cont, hup, alarm, interrupt, quit, 1, 2, term, kill: send\n" \
1930 "STOP, CONT, HUP, ALRM, INT, QUIT, USR1, USR2, TERM, KILL signal to service" \
1931
1932#define swapoff_trivial_usage \
1933 "[-a] [DEVICE]"
1934#define swapoff_full_usage "\n\n" \
1935 "Stop swapping on DEVICE\n" \
1936 "\nOptions:" \
1937 "\n -a Stop swapping on all swap devices" \
1938
1939#define swapon_trivial_usage \
1940 "[-a]" IF_FEATURE_SWAPON_PRI(" [-p PRI]") " [DEVICE]"
1941#define swapon_full_usage "\n\n" \
1942 "Start swapping on DEVICE\n" \
1943 "\nOptions:" \
1944 "\n -a Start swapping on all swap devices" \
1945 IF_FEATURE_SWAPON_PRI( \
1946 "\n -p PRI Set swap device priority" \
1947 ) \
1948
1949#define switch_root_trivial_usage \
1950 "[-c /dev/console] NEW_ROOT NEW_INIT [ARGS]"
1951#define switch_root_full_usage "\n\n" \
1952 "Free initramfs and switch to another root fs:\n" \
1953 "chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /,\n" \
1954 "execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint.\n" \
1955 "\nOptions:" \
1956 "\n -c DEV Reopen stdio to DEV after switch" \
1957
1958#define sysctl_trivial_usage \
1959 "[OPTIONS] [VALUE]..."
1960#define sysctl_full_usage "\n\n" \
1961 "Configure kernel parameters at runtime\n" \
1962 "\nOptions:" \
1963 "\n -n Don't print key names" \
1964 "\n -e Don't warn about unknown keys" \
1965 "\n -w Change sysctl setting" \
1966 "\n -p FILE Load sysctl settings from FILE (default /etc/sysctl.conf)" \
1967 "\n -a Display all values" \
1968 "\n -A Display all values in table form" \
1969
1970#define sysctl_example_usage \
1971 "sysctl [-n] [-e] variable...\n" \
1972 "sysctl [-n] [-e] -w variable=value...\n" \
1973 "sysctl [-n] [-e] -a\n" \
1974 "sysctl [-n] [-e] -p file (default /etc/sysctl.conf)\n" \
1975 "sysctl [-n] [-e] -A\n"
1976
1977#define syslogd_trivial_usage \
1978 "[OPTIONS]"
1979#define syslogd_full_usage "\n\n" \
1980 "System logging utility.\n" \
1981 "This version of syslogd ignores /etc/syslog.conf\n" \
1982 "\nOptions:" \
1983 "\n -n Run in foreground" \
1984 "\n -O FILE Log to given file (default:/var/log/messages)" \
1985 "\n -l N Set local log level" \
1986 "\n -S Smaller logging output" \
1987 IF_FEATURE_ROTATE_LOGFILE( \
1988 "\n -s SIZE Max size (KB) before rotate (default:200KB, 0=off)" \
1989 "\n -b N N rotated logs to keep (default:1, max=99, 0=purge)") \
1990 IF_FEATURE_REMOTE_LOG( \
1991 "\n -R HOST[:PORT] Log to IP or hostname on PORT (default PORT=514/UDP)" \
1992 "\n -L Log locally and via network (default is network only if -R)") \
1993 IF_FEATURE_SYSLOGD_DUP( \
1994 "\n -D Drop duplicates") \
1995 IF_FEATURE_IPC_SYSLOG( \
1996 "\n -C[size(KiB)] Log to shared mem buffer (read it using logread)") \
1997 /* NB: -Csize shouldn't have space (because size is optional) */
1998/* "\n -m MIN Minutes between MARK lines (default:20, 0=off)" */
1999
2000#define syslogd_example_usage \
2001 "$ syslogd -R masterlog:514\n" \
2002 "$ syslogd -R 192.168.1.1:601\n"
2003
2004#define taskset_trivial_usage \
2005 "[-p] [MASK] [PID | PROG ARGS]"
2006#define taskset_full_usage "\n\n" \
2007 "Set or get CPU affinity\n" \
2008 "\nOptions:" \
2009 "\n -p Operate on an existing PID" \
2010
2011#define taskset_example_usage \
2012 "$ taskset 0x7 ./dgemm_test&\n" \
2013 "$ taskset -p 0x1 $!\n" \
2014 "pid 4790's current affinity mask: 7\n" \
2015 "pid 4790's new affinity mask: 1\n" \
2016 "$ taskset 0x7 /bin/sh -c './taskset -p 0x1 $$'\n" \
2017 "pid 6671's current affinity mask: 1\n" \
2018 "pid 6671's new affinity mask: 1\n" \
2019 "$ taskset -p 1\n" \
2020 "pid 1's current affinity mask: 3\n"
2021
2022#if ENABLE_FEATURE_TELNET_AUTOLOGIN
2023#define telnet_trivial_usage \
2024 "[-a] [-l USER] HOST [PORT]"
2025#define telnet_full_usage "\n\n" \
2026 "Connect to telnet server\n" \
2027 "\nOptions:" \
2028 "\n -a Automatic login with $USER variable" \
2029 "\n -l USER Automatic login as USER" \
2030
2031#else
2032#define telnet_trivial_usage \
2033 "HOST [PORT]"
2034#define telnet_full_usage "\n\n" \
2035 "Connect to telnet server"
2036#endif
2037
2038#define telnetd_trivial_usage \
2039 "[OPTIONS]"
2040#define telnetd_full_usage "\n\n" \
2041 "Handle incoming telnet connections" \
2042 IF_NOT_FEATURE_TELNETD_STANDALONE(" via inetd") "\n" \
2043 "\nOptions:" \
2044 "\n -l LOGIN Exec LOGIN on connect" \
2045 "\n -f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue" \
2046 "\n -K Close connection as soon as login exits" \
2047 "\n (normally wait until all programs close slave pty)" \
2048 IF_FEATURE_TELNETD_STANDALONE( \
2049 "\n -p PORT Port to listen on" \
2050 "\n -b ADDR[:PORT] Address to bind to" \
2051 "\n -F Run in foreground" \
2052 "\n -i Inetd mode" \
2053 IF_FEATURE_TELNETD_INETD_WAIT( \
2054 "\n -w SEC Inetd 'wait' mode, linger time SEC" \
2055 "\n -S Log to syslog (implied by -i or without -F and -w)" \
2056 ) \
2057 )
2058
2059#define tc_trivial_usage \
2060 /*"[OPTIONS] "*/"OBJECT CMD [dev STRING]"
2061#define tc_full_usage "\n\n" \
2062 "OBJECT: {qdisc|class|filter}\n" \
2063 "CMD: {add|del|change|replace|show}\n" \
2064 "\n" \
2065 "qdisc [ handle QHANDLE ] [ root |"IF_FEATURE_TC_INGRESS(" ingress |")" parent CLASSID ]\n" \
2066 /* "[ estimator INTERVAL TIME_CONSTANT ]\n" */ \
2067 " [ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" \
2068 " QDISC_KIND := { [p|b]fifo | tbf | prio | cbq | red | etc. }\n" \
2069 "qdisc show [ dev STRING ]"IF_FEATURE_TC_INGRESS(" [ingress]")"\n" \
2070 "class [ classid CLASSID ] [ root | parent CLASSID ]\n" \
2071 " [ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" \
2072 "class show [ dev STRING ] [ root | parent CLASSID ]\n" \
2073 "filter [ pref PRIO ] [ protocol PROTO ]\n" \
2074 /* "\t[ estimator INTERVAL TIME_CONSTANT ]\n" */ \
2075 " [ root | classid CLASSID ] [ handle FILTERID ]\n" \
2076 " [ [ FILTER_TYPE ] [ help | OPTIONS ] ]\n" \
2077 "filter show [ dev STRING ] [ root | parent CLASSID ]"
2078
2079#define tcpsvd_trivial_usage \
2080 "[-hEv] [-c N] [-C N[:MSG]] [-b N] [-u USER] [-l NAME] IP PORT PROG"
2081/* with not-implemented options: */
2082/* "[-hpEvv] [-c N] [-C N[:MSG]] [-b N] [-u USER] [-l NAME] [-i DIR|-x CDB] [-t SEC] IP PORT PROG" */
2083#define tcpsvd_full_usage "\n\n" \
2084 "Create TCP socket, bind to IP:PORT and listen\n" \
2085 "for incoming connection. Run PROG for each connection.\n" \
2086 "\n IP IP to listen on. '0' = all" \
2087 "\n PORT Port to listen on" \
2088 "\n PROG ARGS Program to run" \
2089 "\n -l NAME Local hostname (else looks up local hostname in DNS)" \
2090 "\n -u USER[:GRP] Change to user/group after bind" \
2091 "\n -c N Handle up to N connections simultaneously" \
2092 "\n -b N Allow a backlog of approximately N TCP SYNs" \
2093 "\n -C N[:MSG] Allow only up to N connections from the same IP." \
2094 "\n New connections from this IP address are closed" \
2095 "\n immediately. MSG is written to the peer before close" \
2096 "\n -h Look up peer's hostname" \
2097 "\n -E Don't set up environment variables" \
2098 "\n -v Verbose" \
2099
2100#define udpsvd_trivial_usage \
2101 "[-hEv] [-c N] [-u USER] [-l NAME] IP PORT PROG"
2102#define udpsvd_full_usage "\n\n" \
2103 "Create UDP socket, bind to IP:PORT and wait\n" \
2104 "for incoming packets. Run PROG for each packet,\n" \
2105 "redirecting all further packets with same peer ip:port to it.\n" \
2106 "\n IP IP to listen on. '0' = all" \
2107 "\n PORT Port to listen on" \
2108 "\n PROG ARGS Program to run" \
2109 "\n -l NAME Local hostname (else looks up local hostname in DNS)" \
2110 "\n -u USER[:GRP] Change to user/group after bind" \
2111 "\n -c N Handle up to N connections simultaneously" \
2112 "\n -h Look up peer's hostname" \
2113 "\n -E Don't set up environment variables" \
2114 "\n -v Verbose" \
2115
2116#define tftp_trivial_usage \
2117 "[OPTIONS] HOST [PORT]"
2118#define tftp_full_usage "\n\n" \
2119 "Transfer a file from/to tftp server\n" \
2120 "\nOptions:" \
2121 "\n -l FILE Local FILE" \
2122 "\n -r FILE Remote FILE" \
2123 IF_FEATURE_TFTP_GET( \
2124 "\n -g Get file" \
2125 ) \
2126 IF_FEATURE_TFTP_PUT( \
2127 "\n -p Put file" \
2128 ) \
2129 IF_FEATURE_TFTP_BLOCKSIZE( \
2130 "\n -b SIZE Transfer blocks of SIZE octets" \
2131 )
2132
2133#define tftpd_trivial_usage \
2134 "[-cr] [-u USER] [DIR]"
2135#define tftpd_full_usage "\n\n" \
2136 "Transfer a file on tftp client's request\n" \
2137 "\n" \
2138 "tftpd should be used as an inetd service.\n" \
2139 "tftpd's line for inetd.conf:\n" \
2140 " 69 dgram udp nowait root tftpd tftpd /files/to/serve\n" \
2141 "It also can be ran from udpsvd:\n" \
2142 " udpsvd -vE 0.0.0.0 69 tftpd /files/to/serve\n" \
2143 "\nOptions:" \
2144 "\n -r Prohibit upload" \
2145 "\n -c Allow file creation via upload" \
2146 "\n -u Access files as USER" \
2147
2148#define time_trivial_usage \
2149 "[-v] PROG ARGS"
2150#define time_full_usage "\n\n" \
2151 "Run PROG, display resource usage when it exits\n" \
2152 "\nOptions:" \
2153 "\n -v Verbose" \
2154
2155#define timeout_trivial_usage \
2156 "[-t SECS] [-s SIG] PROG ARGS"
2157#define timeout_full_usage "\n\n" \
2158 "Runs PROG. Sends SIG to it if it is not gone in SECS seconds.\n" \
2159 "Defaults: SECS: 10, SIG: TERM." \
2160
2161#define traceroute_trivial_usage \
2162 "[-"IF_TRACEROUTE6("46")"FIldnrv] [-f 1ST_TTL] [-m MAXTTL] [-p PORT] [-q PROBES]\n" \
2163 " [-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-g GATEWAY] [-i IFACE]\n" \
2164 " [-z PAUSE_MSEC] HOST [BYTES]"
2165#define traceroute_full_usage "\n\n" \
2166 "Trace the route to HOST\n" \
2167 "\nOptions:" \
2168 IF_TRACEROUTE6( \
2169 "\n -4,-6 Force IP or IPv6 name resolution" \
2170 ) \
2171 "\n -F Set the don't fragment bit" \
2172 "\n -I Use ICMP ECHO instead of UDP datagrams" \
2173 "\n -l Display the TTL value of the returned packet" \
2174 "\n -d Set SO_DEBUG options to socket" \
2175 "\n -n Print numeric addresses" \
2176 "\n -r Bypass routing tables, send directly to HOST" \
2177 "\n -v Verbose" \
2178 "\n -m Max time-to-live (max number of hops)" \
2179 "\n -p Base UDP port number used in probes" \
2180 "\n (default 33434)" \
2181 "\n -q Number of probes per TTL (default 3)" \
2182 "\n -s IP address to use as the source address" \
2183 "\n -t Type-of-service in probe packets (default 0)" \
2184 "\n -w Time in seconds to wait for a response (default 3)" \
2185 "\n -g Loose source route gateway (8 max)" \
2186
2187#define traceroute6_trivial_usage \
2188 "[-dnrv] [-m MAXTTL] [-p PORT] [-q PROBES]\n" \
2189 " [-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-i IFACE]\n" \
2190 " HOST [BYTES]"
2191#define traceroute6_full_usage "\n\n" \
2192 "Trace the route to HOST\n" \
2193 "\nOptions:" \
2194 "\n -d Set SO_DEBUG options to socket" \
2195 "\n -n Print numeric addresses" \
2196 "\n -r Bypass routing tables, send directly to HOST" \
2197 "\n -v Verbose" \
2198 "\n -m Max time-to-live (max number of hops)" \
2199 "\n -p Base UDP port number used in probes" \
2200 "\n (default is 33434)" \
2201 "\n -q Number of probes per TTL (default 3)" \
2202 "\n -s IP address to use as the source address" \
2203 "\n -t Type-of-service in probe packets (default 0)" \
2204 "\n -w Time in seconds to wait for a response (default 3)" \
2205
2206#define ttysize_trivial_usage \
2207 "[w] [h]"
2208#define ttysize_full_usage "\n\n" \
2209 "Print dimension(s) of stdin's terminal, on error return 80x25"
2210
2211#define tunctl_trivial_usage \
2212 "[-f device] ([-t name] | -d name)" IF_FEATURE_TUNCTL_UG(" [-u owner] [-g group] [-b]")
2213#define tunctl_full_usage "\n\n" \
2214 "Create or delete tun interfaces\n" \
2215 "\nOptions:" \
2216 "\n -f name tun device (/dev/net/tun)" \
2217 "\n -t name Create iface 'name'" \
2218 "\n -d name Delete iface 'name'" \
2219 IF_FEATURE_TUNCTL_UG( \
2220 "\n -u owner Set iface owner" \
2221 "\n -g group Set iface group" \
2222 "\n -b Brief output" \
2223 )
2224#define tunctl_example_usage \
2225 "# tunctl\n" \
2226 "# tunctl -d tun0\n"
2227
2228#define udhcpd_trivial_usage \
2229 "[-fS]" IF_FEATURE_UDHCP_PORT(" [-P N]") " [CONFFILE]" \
2230
2231#define udhcpd_full_usage "\n\n" \
2232 "DHCP server\n" \
2233 "\n -f Run in foreground" \
2234 "\n -S Log to syslog too" \
2235 IF_FEATURE_UDHCP_PORT( \
2236 "\n -P N Use port N (default 67)" \
2237 )
2238
2239#define umount_trivial_usage \
2240 "[OPTIONS] FILESYSTEM|DIRECTORY"
2241#define umount_full_usage "\n\n" \
2242 "Unmount file systems\n" \
2243 "\nOptions:" \
2244 IF_FEATURE_UMOUNT_ALL( \
2245 "\n -a Unmount all file systems" IF_FEATURE_MTAB_SUPPORT(" in /etc/mtab") \
2246 ) \
2247 IF_FEATURE_MTAB_SUPPORT( \
2248 "\n -n Don't erase /etc/mtab entries" \
2249 ) \
2250 "\n -r Try to remount devices as read-only if mount is busy" \
2251 "\n -l Lazy umount (detach filesystem)" \
2252 "\n -f Force umount (i.e., unreachable NFS server)" \
2253 IF_FEATURE_MOUNT_LOOP( \
2254 "\n -d Free loop device if it has been used" \
2255 )
2256
2257#define umount_example_usage \
2258 "$ umount /dev/hdc1\n"
2259
2260#define uptime_trivial_usage \
2261 ""
2262#define uptime_full_usage "\n\n" \
2263 "Display the time since the last boot"
2264
2265#define uptime_example_usage \
2266 "$ uptime\n" \
2267 " 1:55pm up 2:30, load average: 0.09, 0.04, 0.00\n"
2268
2269#define vconfig_trivial_usage \
2270 "COMMAND [OPTIONS]"
2271#define vconfig_full_usage "\n\n" \
2272 "Create and remove virtual ethernet devices\n" \
2273 "\nOptions:" \
2274 "\n add [interface-name] [vlan_id]" \
2275 "\n rem [vlan-name]" \
2276 "\n set_flag [interface-name] [flag-num] [0 | 1]" \
2277 "\n set_egress_map [vlan-name] [skb_priority] [vlan_qos]" \
2278 "\n set_ingress_map [vlan-name] [skb_priority] [vlan_qos]" \
2279 "\n set_name_type [name-type]" \
2280
2281#define volname_trivial_usage \
2282 "[DEVICE]"
2283#define volname_full_usage "\n\n" \
2284 "Show CD volume name of the DEVICE (default /dev/cdrom)"
2285
2286#define wall_trivial_usage \
2287 "[FILE]"
2288#define wall_full_usage "\n\n" \
2289 "Write content of FILE or stdin to all logged-in users"
2290#define wall_sample_usage \
2291 "echo foo | wall\n" \
2292 "wall ./mymessage"
2293
2294#define watch_trivial_usage \
2295 "[-n SEC] [-t] PROG ARGS"
2296#define watch_full_usage "\n\n" \
2297 "Run PROG periodically\n" \
2298 "\nOptions:" \
2299 "\n -n Loop period in seconds (default 2)" \
2300 "\n -t Don't print header" \
2301
2302#define watch_example_usage \
2303 "$ watch date\n" \
2304 "Mon Dec 17 10:31:40 GMT 2000\n" \
2305 "Mon Dec 17 10:31:42 GMT 2000\n" \
2306 "Mon Dec 17 10:31:44 GMT 2000"
2307
2308#define watchdog_trivial_usage \
2309 "[-t N[ms]] [-T N[ms]] [-F] DEV"
2310#define watchdog_full_usage "\n\n" \
2311 "Periodically write to watchdog device DEV\n" \
2312 "\nOptions:" \
2313 "\n -T N Reboot after N seconds if not reset (default 60)" \
2314 "\n -t N Reset every N seconds (default 30)" \
2315 "\n -F Run in foreground" \
2316 "\n" \
2317 "\nUse 500ms to specify period in milliseconds" \
2318
2319#define zcip_trivial_usage \
2320 "[OPTIONS] IFACE SCRIPT"
2321#define zcip_full_usage "\n\n" \
2322 "Manage a ZeroConf IPv4 link-local address\n" \
2323 "\nOptions:" \
2324 "\n -f Run in foreground" \
2325 "\n -q Quit after obtaining address" \
2326 "\n -r 169.254.x.x Request this address first" \
2327 "\n -v Verbose" \
2328 "\n" \
2329 "\nWith no -q, runs continuously monitoring for ARP conflicts," \
2330 "\nexits only on I/O errors (link down etc)" \
2331
2332
2333#endif 22#endif
diff --git a/libbb/parse_config.c b/libbb/parse_config.c
index d471edbee..4b0236028 100644
--- a/libbb/parse_config.c
+++ b/libbb/parse_config.c
@@ -8,6 +8,12 @@
8 * Also for use in uClibc (http://uclibc.org/) licensed under LGPLv2.1 or later. 8 * Also for use in uClibc (http://uclibc.org/) licensed under LGPLv2.1 or later.
9 */ 9 */
10 10
11/*
12//usage:#define parse_trivial_usage
13//usage: "[-n MAXTOKENS] [-m MINTOKENS] [-d DELIMS] [-f FLAGS] FILE..."
14//usage:#define parse_full_usage ""
15*/
16
11#include "libbb.h" 17#include "libbb.h"
12 18
13#if defined ENABLE_PARSE && ENABLE_PARSE 19#if defined ENABLE_PARSE && ENABLE_PARSE
diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c
index 8e8ff8c0a..e1edbbebc 100644
--- a/miscutils/adjtimex.c
+++ b/miscutils/adjtimex.c
@@ -11,6 +11,18 @@
11 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 11 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
12 */ 12 */
13 13
14//usage:#define adjtimex_trivial_usage
15//usage: "[-q] [-o OFF] [-f FREQ] [-p TCONST] [-t TICK]"
16//usage:#define adjtimex_full_usage "\n\n"
17//usage: "Read and optionally set system timebase parameters. See adjtimex(2)\n"
18//usage: "\nOptions:"
19//usage: "\n -q Quiet"
20//usage: "\n -o OFF Time offset, microseconds"
21//usage: "\n -f FREQ Frequency adjust, integer kernel units (65536 is 1ppm)"
22//usage: "\n (positive values make clock run faster)"
23//usage: "\n -t TICK Microseconds per tick, usually 10000"
24//usage: "\n -p TCONST"
25
14#include "libbb.h" 26#include "libbb.h"
15#include <sys/timex.h> 27#include <sys/timex.h>
16 28
diff --git a/miscutils/bbconfig.c b/miscutils/bbconfig.c
index 7c30669a3..e8be81352 100644
--- a/miscutils/bbconfig.c
+++ b/miscutils/bbconfig.c
@@ -1,6 +1,12 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* This file was released into the public domain by Paul Fox. 2/* This file was released into the public domain by Paul Fox.
3 */ 3 */
4
5//usage:#define bbconfig_trivial_usage
6//usage: ""
7//usage:#define bbconfig_full_usage "\n\n"
8//usage: "Print the config file used by busybox build"
9
4#include "libbb.h" 10#include "libbb.h"
5#include "bbconfigopts.h" 11#include "bbconfigopts.h"
6#if ENABLE_FEATURE_COMPRESS_BBCONFIG 12#if ENABLE_FEATURE_COMPRESS_BBCONFIG
diff --git a/miscutils/beep.c b/miscutils/beep.c
index 013a72543..c7699ffe1 100644
--- a/miscutils/beep.c
+++ b/miscutils/beep.c
@@ -7,6 +7,17 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 * 8 *
9 */ 9 */
10
11//usage:#define beep_trivial_usage
12//usage: "-f FREQ -l LEN -d DELAY -r COUNT -n"
13//usage:#define beep_full_usage "\n\n"
14//usage: "Options:"
15//usage: "\n -f Frequency in Hz"
16//usage: "\n -l Length in ms"
17//usage: "\n -d Delay in ms"
18//usage: "\n -r Repetitions"
19//usage: "\n -n Start new tone"
20
10#include "libbb.h" 21#include "libbb.h"
11 22
12#include <linux/kd.h> 23#include <linux/kd.h>
diff --git a/miscutils/chat.c b/miscutils/chat.c
index d8370a963..ce994f870 100644
--- a/miscutils/chat.c
+++ b/miscutils/chat.c
@@ -7,6 +7,15 @@
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10
11//usage:#define chat_trivial_usage
12//usage: "EXPECT [SEND [EXPECT [SEND...]]]"
13//usage:#define chat_full_usage "\n\n"
14//usage: "Useful for interacting with a modem connected to stdin/stdout.\n"
15//usage: "A script consists of one or more \"expect-send\" pairs of strings,\n"
16//usage: "each pair is a pair of arguments. Example:\n"
17//usage: "chat '' ATZ OK ATD123456 CONNECT '' ogin: pppuser word: ppppass '~'"
18
10#include "libbb.h" 19#include "libbb.h"
11 20
12// default timeout: 45 sec 21// default timeout: 45 sec
diff --git a/miscutils/chrt.c b/miscutils/chrt.c
index 1c6737a3c..7e40b9f13 100644
--- a/miscutils/chrt.c
+++ b/miscutils/chrt.c
@@ -5,6 +5,23 @@
5 * 5 *
6 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 6 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
7 */ 7 */
8
9//usage:#define chrt_trivial_usage
10//usage: "[-prfom] [PRIO] [PID | PROG ARGS]"
11//usage:#define chrt_full_usage "\n\n"
12//usage: "Change scheduling priority and class for a process\n"
13//usage: "\nOptions:"
14//usage: "\n -p Operate on PID"
15//usage: "\n -r Set SCHED_RR class"
16//usage: "\n -f Set SCHED_FIFO class"
17//usage: "\n -o Set SCHED_OTHER class"
18//usage: "\n -m Show min/max priorities"
19//usage:
20//usage:#define chrt_example_usage
21//usage: "$ chrt -r 4 sleep 900; x=$!\n"
22//usage: "$ chrt -f -p 3 $x\n"
23//usage: "You need CAP_SYS_NICE privileges to set scheduling attributes of a process"
24
8#include <sched.h> 25#include <sched.h>
9#include "libbb.h" 26#include "libbb.h"
10#ifndef _POSIX_PRIORITY_SCHEDULING 27#ifndef _POSIX_PRIORITY_SCHEDULING
diff --git a/miscutils/crond.c b/miscutils/crond.c
index 5bf053609..014016fb6 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -11,6 +11,19 @@
11 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 11 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
12 */ 12 */
13 13
14//usage:#define crond_trivial_usage
15//usage: "-fbS -l N " IF_FEATURE_CROND_D("-d N ") "-L LOGFILE -c DIR"
16//usage:#define crond_full_usage "\n\n"
17//usage: " -f Foreground"
18//usage: "\n -b Background (default)"
19//usage: "\n -S Log to syslog (default)"
20//usage: "\n -l Set log level. 0 is the most verbose, default 8"
21//usage: IF_FEATURE_CROND_D(
22//usage: "\n -d Set log level, log to stderr"
23//usage: )
24//usage: "\n -L Log to file"
25//usage: "\n -c Working dir"
26
14#include "libbb.h" 27#include "libbb.h"
15#include <syslog.h> 28#include <syslog.h>
16 29
diff --git a/miscutils/crontab.c b/miscutils/crontab.c
index 16d7fdf69..4731d8da6 100644
--- a/miscutils/crontab.c
+++ b/miscutils/crontab.c
@@ -10,6 +10,16 @@
10 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 10 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
11 */ 11 */
12 12
13//usage:#define crontab_trivial_usage
14//usage: "[-c DIR] [-u USER] [-ler]|[FILE]"
15//usage:#define crontab_full_usage "\n\n"
16//usage: " -c Crontab directory"
17//usage: "\n -u User"
18//usage: "\n -l List crontab"
19//usage: "\n -e Edit crontab"
20//usage: "\n -r Delete crontab"
21//usage: "\n FILE Replace crontab by FILE ('-': stdin)"
22
13#include "libbb.h" 23#include "libbb.h"
14 24
15#define CRONTABS CONFIG_FEATURE_CROND_DIR "/crontabs" 25#define CRONTABS CONFIG_FEATURE_CROND_DIR "/crontabs"
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c
index 35e431951..706276015 100644
--- a/miscutils/devfsd.c
+++ b/miscutils/devfsd.c
@@ -53,6 +53,22 @@
53 The postal address is: 53 The postal address is:
54 Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia. 54 Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
55*/ 55*/
56
57//usage:#define devfsd_trivial_usage
58//usage: "mntpnt [-v]" IF_DEVFSD_FG_NP("[-fg][-np]")
59//usage:#define devfsd_full_usage "\n\n"
60//usage: "Manage devfs permissions and old device name symlinks\n"
61//usage: "\nOptions:"
62//usage: "\n mntpnt The mount point where devfs is mounted"
63//usage: "\n -v Print the protocol version numbers for devfsd"
64//usage: "\n and the kernel-side protocol version and exit"
65//usage: IF_DEVFSD_FG_NP(
66//usage: "\n -fg Run in foreground"
67//usage: "\n -np Exit after parsing the configuration file"
68//usage: "\n and processing synthetic REGISTER events,"
69//usage: "\n don't poll for events"
70//usage: )
71
56#include "libbb.h" 72#include "libbb.h"
57#include "xregex.h" 73#include "xregex.h"
58#include <syslog.h> 74#include <syslog.h>
diff --git a/miscutils/devmem.c b/miscutils/devmem.c
index 7a9f533af..786a21bee 100644
--- a/miscutils/devmem.c
+++ b/miscutils/devmem.c
@@ -4,6 +4,14 @@
4 * Copyright (C) 2008, BusyBox Team. -solar 4/26/08 4 * Copyright (C) 2008, BusyBox Team. -solar 4/26/08
5 */ 5 */
6 6
7//usage:#define devmem_trivial_usage
8//usage: "ADDRESS [WIDTH [VALUE]]"
9//usage:#define devmem_full_usage "\n\n"
10//usage: "Read/write from physical address\n"
11//usage: "\n ADDRESS Address to act upon"
12//usage: "\n WIDTH Width (8/16/...)"
13//usage: "\n VALUE Data to be written"
14
7#include "libbb.h" 15#include "libbb.h"
8 16
9int devmem_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 17int devmem_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/miscutils/eject.c b/miscutils/eject.c
index 63d20d3ad..184ccc5d7 100644
--- a/miscutils/eject.c
+++ b/miscutils/eject.c
@@ -13,6 +13,17 @@
13 * Most of the dirty work blatantly ripped off from cat.c =) 13 * Most of the dirty work blatantly ripped off from cat.c =)
14 */ 14 */
15 15
16//usage:#define eject_trivial_usage
17//usage: "[-t] [-T] [DEVICE]"
18//usage:#define eject_full_usage "\n\n"
19//usage: "Eject DEVICE or default /dev/cdrom\n"
20//usage: "\nOptions:"
21//usage: IF_FEATURE_EJECT_SCSI(
22//usage: "\n -s SCSI device"
23//usage: )
24//usage: "\n -t Close tray"
25//usage: "\n -T Open/close tray (toggle)"
26
16#include <sys/mount.h> 27#include <sys/mount.h>
17#include "libbb.h" 28#include "libbb.h"
18/* Must be after libbb.h: they need size_t */ 29/* Must be after libbb.h: they need size_t */
diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c
index 770e70026..c761a88ca 100644
--- a/miscutils/fbsplash.c
+++ b/miscutils/fbsplash.c
@@ -21,6 +21,19 @@
21 * "exit" (or just close fifo) - well you guessed it. 21 * "exit" (or just close fifo) - well you guessed it.
22 */ 22 */
23 23
24//usage:#define fbsplash_trivial_usage
25//usage: "-s IMGFILE [-c] [-d DEV] [-i INIFILE] [-f CMD]"
26//usage:#define fbsplash_full_usage "\n\n"
27//usage: "Options:"
28//usage: "\n -s Image"
29//usage: "\n -c Hide cursor"
30//usage: "\n -d Framebuffer device (default /dev/fb0)"
31//usage: "\n -i Config file (var=value):"
32//usage: "\n BAR_LEFT,BAR_TOP,BAR_WIDTH,BAR_HEIGHT"
33//usage: "\n BAR_R,BAR_G,BAR_B"
34//usage: "\n -f Control pipe (else exit after drawing image)"
35//usage: "\n commands: 'NN' (% for progress bar) or 'exit'"
36
24#include "libbb.h" 37#include "libbb.h"
25#include <linux/fb.h> 38#include <linux/fb.h>
26 39
diff --git a/miscutils/flash_eraseall.c b/miscutils/flash_eraseall.c
index 68596e11b..33803f87d 100644
--- a/miscutils/flash_eraseall.c
+++ b/miscutils/flash_eraseall.c
@@ -10,6 +10,14 @@
10 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 10 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
11 */ 11 */
12 12
13//usage:#define flash_eraseall_trivial_usage
14//usage: "[-jq] MTD_DEVICE"
15//usage:#define flash_eraseall_full_usage "\n\n"
16//usage: "Erase an MTD device\n"
17//usage: "\nOptions:"
18//usage: "\n -j Format the device for jffs2"
19//usage: "\n -q Don't display progress messages"
20
13#include "libbb.h" 21#include "libbb.h"
14#include <mtd/mtd-user.h> 22#include <mtd/mtd-user.h>
15#include <linux/jffs2.h> 23#include <linux/jffs2.h>
diff --git a/miscutils/flash_lock_unlock.c b/miscutils/flash_lock_unlock.c
index fcb836b07..1fefd95f9 100644
--- a/miscutils/flash_lock_unlock.c
+++ b/miscutils/flash_lock_unlock.c
@@ -3,6 +3,18 @@
3 * 3 *
4 * Licensed under GPLv2, see file LICENSE in this source tree. 4 * Licensed under GPLv2, see file LICENSE in this source tree.
5 */ 5 */
6
7//usage:#define flash_lock_trivial_usage
8//usage: "MTD_DEVICE OFFSET SECTORS"
9//usage:#define flash_lock_full_usage "\n\n"
10//usage: "Lock part or all of an MTD device. If SECTORS is -1, then all sectors\n"
11//usage: "will be locked, regardless of the value of OFFSET"
12//usage:
13//usage:#define flash_unlock_trivial_usage
14//usage: "MTD_DEVICE"
15//usage:#define flash_unlock_full_usage "\n\n"
16//usage: "Unlock an MTD device"
17
6#include "libbb.h" 18#include "libbb.h"
7#include <mtd/mtd-user.h> 19#include <mtd/mtd-user.h>
8 20
diff --git a/miscutils/flashcp.c b/miscutils/flashcp.c
index fe37c3913..e4bb3a902 100644
--- a/miscutils/flashcp.c
+++ b/miscutils/flashcp.c
@@ -7,6 +7,13 @@
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define flashcp_trivial_usage
11//usage: "-v FILE MTD_DEVICE"
12//usage:#define flashcp_full_usage "\n\n"
13//usage: "Copy an image to MTD device\n"
14//usage: "\nOptions:"
15//usage: "\n -v Verbose"
16
10#include "libbb.h" 17#include "libbb.h"
11#include <mtd/mtd-user.h> 18#include <mtd/mtd-user.h>
12 19
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index 38b265d60..7608408dd 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -11,6 +11,58 @@
11 * hdparm.c - Command line interface to get/set hard disk parameters 11 * hdparm.c - Command line interface to get/set hard disk parameters
12 * - by Mark Lord (C) 1994-2002 -- freely distributable 12 * - by Mark Lord (C) 1994-2002 -- freely distributable
13 */ 13 */
14
15//usage:#define hdparm_trivial_usage
16//usage: "[OPTIONS] [DEVICE]"
17//usage:#define hdparm_full_usage "\n\n"
18//usage: "Options:"
19//usage: "\n -a Get/set fs readahead"
20//usage: "\n -A Set drive read-lookahead flag (0/1)"
21//usage: "\n -b Get/set bus state (0 == off, 1 == on, 2 == tristate)"
22//usage: "\n -B Set Advanced Power Management setting (1-255)"
23//usage: "\n -c Get/set IDE 32-bit IO setting"
24//usage: "\n -C Check IDE power mode status"
25//usage: IF_FEATURE_HDPARM_HDIO_GETSET_DMA(
26//usage: "\n -d Get/set using_dma flag")
27//usage: "\n -D Enable/disable drive defect-mgmt"
28//usage: "\n -f Flush buffer cache for device on exit"
29//usage: "\n -g Display drive geometry"
30//usage: "\n -h Display terse usage information"
31//usage: IF_FEATURE_HDPARM_GET_IDENTITY(
32//usage: "\n -i Display drive identification")
33//usage: IF_FEATURE_HDPARM_GET_IDENTITY(
34//usage: "\n -I Detailed/current information directly from drive")
35//usage: "\n -k Get/set keep_settings_over_reset flag (0/1)"
36//usage: "\n -K Set drive keep_features_over_reset flag (0/1)"
37//usage: "\n -L Set drive doorlock (0/1) (removable harddisks only)"
38//usage: "\n -m Get/set multiple sector count"
39//usage: "\n -n Get/set ignore-write-errors flag (0/1)"
40//usage: "\n -p Set PIO mode on IDE interface chipset (0,1,2,3,4,...)"
41//usage: "\n -P Set drive prefetch count"
42/* //usage: "\n -q Change next setting quietly" - not supported ib bbox */
43//usage: "\n -Q Get/set DMA tagged-queuing depth (if supported)"
44//usage: "\n -r Get/set readonly flag (DANGEROUS to set)"
45//usage: IF_FEATURE_HDPARM_HDIO_SCAN_HWIF(
46//usage: "\n -R Register an IDE interface (DANGEROUS)")
47//usage: "\n -S Set standby (spindown) timeout"
48//usage: "\n -t Perform device read timings"
49//usage: "\n -T Perform cache read timings"
50//usage: "\n -u Get/set unmaskirq flag (0/1)"
51//usage: IF_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF(
52//usage: "\n -U Unregister an IDE interface (DANGEROUS)")
53//usage: "\n -v Defaults; same as -mcudkrag for IDE drives"
54//usage: "\n -V Display program version and exit immediately"
55//usage: IF_FEATURE_HDPARM_HDIO_DRIVE_RESET(
56//usage: "\n -w Perform device reset (DANGEROUS)")
57//usage: "\n -W Set drive write-caching flag (0/1) (DANGEROUS)"
58//usage: IF_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(
59//usage: "\n -x Tristate device for hotswap (0/1) (DANGEROUS)")
60//usage: "\n -X Set IDE xfer mode (DANGEROUS)"
61//usage: "\n -y Put IDE drive in standby mode"
62//usage: "\n -Y Put IDE drive to sleep"
63//usage: "\n -Z Disable Seagate auto-powersaving mode"
64//usage: "\n -z Reread partition table"
65
14#include "libbb.h" 66#include "libbb.h"
15/* must be _after_ libbb.h: */ 67/* must be _after_ libbb.h: */
16#include <linux/hdreg.h> 68#include <linux/hdreg.h>
diff --git a/miscutils/inotifyd.c b/miscutils/inotifyd.c
index fe429b636..b64e0abb9 100644
--- a/miscutils/inotifyd.c
+++ b/miscutils/inotifyd.c
@@ -27,6 +27,33 @@
27 * See below for mask names explanation. 27 * See below for mask names explanation.
28 */ 28 */
29 29
30//usage:#define inotifyd_trivial_usage
31//usage: "PROG FILE1[:MASK]..."
32//usage:#define inotifyd_full_usage "\n\n"
33//usage: "Run PROG on filesystem changes."
34//usage: "\nWhen a filesystem event matching MASK occurs on FILEn,"
35//usage: "\nPROG ACTUAL_EVENTS FILEn [SUBFILE] is run."
36//usage: "\nEvents:"
37//usage: "\n a File is accessed"
38//usage: "\n c File is modified"
39//usage: "\n e Metadata changed"
40//usage: "\n w Writable file is closed"
41//usage: "\n 0 Unwritable file is closed"
42//usage: "\n r File is opened"
43//usage: "\n D File is deleted"
44//usage: "\n M File is moved"
45//usage: "\n u Backing fs is unmounted"
46//usage: "\n o Event queue overflowed"
47//usage: "\n x File can't be watched anymore"
48//usage: "\nIf watching a directory:"
49//usage: "\n m Subfile is moved into dir"
50//usage: "\n y Subfile is moved out of dir"
51//usage: "\n n Subfile is created"
52//usage: "\n d Subfile is deleted"
53//usage: "\n"
54//usage: "\ninotifyd waits for PROG to exit."
55//usage: "\nWhen x event happens for all FILEs, inotifyd exits."
56
30#include "libbb.h" 57#include "libbb.h"
31#include <sys/inotify.h> 58#include <sys/inotify.h>
32 59
diff --git a/miscutils/ionice.c b/miscutils/ionice.c
index 481a738ee..2bc83c5eb 100644
--- a/miscutils/ionice.c
+++ b/miscutils/ionice.c
@@ -7,6 +7,14 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define ionice_trivial_usage
11//usage: "[-c 1-3] [-n 0-7] [-p PID] [PROG]"
12//usage:#define ionice_full_usage "\n\n"
13//usage: "Change I/O priority and class\n"
14//usage: "\nOptions:"
15//usage: "\n -c Class. 1:realtime 2:best-effort 3:idle"
16//usage: "\n -n Priority"
17
10#include <sys/syscall.h> 18#include <sys/syscall.h>
11#include <asm/unistd.h> 19#include <asm/unistd.h>
12#include "libbb.h" 20#include "libbb.h"
diff --git a/miscutils/last.c b/miscutils/last.c
index 12457b157..27f5a35ce 100644
--- a/miscutils/last.c
+++ b/miscutils/last.c
@@ -7,6 +7,17 @@
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define last_trivial_usage
11//usage: ""IF_FEATURE_LAST_FANCY("[-HW] [-f FILE]")
12//usage:#define last_full_usage "\n\n"
13//usage: "Show listing of the last users that logged into the system"
14//usage: IF_FEATURE_LAST_FANCY( "\n"
15//usage: "\nOptions:"
16/* //usage: "\n -H Show header line" */
17//usage: "\n -W Display with no host column truncation"
18//usage: "\n -f FILE Read from FILE instead of /var/log/wtmp"
19//usage: )
20
10#include "libbb.h" 21#include "libbb.h"
11 22
12/* NB: ut_name and ut_user are the same field, use only one name (ut_user) 23/* NB: ut_name and ut_user are the same field, use only one name (ut_user)
diff --git a/miscutils/less.c b/miscutils/less.c
index 9e12c11a7..77fd5a8de 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -21,6 +21,18 @@
21 * redirected input has been read from stdin 21 * redirected input has been read from stdin
22 */ 22 */
23 23
24//usage:#define less_trivial_usage
25//usage: "[-EMNmh~I?] [FILE]..."
26//usage:#define less_full_usage "\n\n"
27//usage: "View FILE (or stdin) one screenful at a time\n"
28//usage: "\nOptions:"
29//usage: "\n -E Quit once the end of a file is reached"
30//usage: "\n -M,-m Display status line with line numbers"
31//usage: "\n and percentage through the file"
32//usage: "\n -N Prefix line number to each line"
33//usage: "\n -I Ignore case in all searches"
34//usage: "\n -~ Suppress ~s displayed past the end of the file"
35
24#include <sched.h> /* sched_yield() */ 36#include <sched.h> /* sched_yield() */
25 37
26#include "libbb.h" 38#include "libbb.h"
diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c
index e74c47c35..8cca83882 100644
--- a/miscutils/makedevs.c
+++ b/miscutils/makedevs.c
@@ -7,6 +7,66 @@
7 * known bugs: can't deal with alpha ranges 7 * known bugs: can't deal with alpha ranges
8 */ 8 */
9 9
10//usage:#if ENABLE_FEATURE_MAKEDEVS_LEAF
11//usage:#define makedevs_trivial_usage
12//usage: "NAME TYPE MAJOR MINOR FIRST LAST [s]"
13//usage:#define makedevs_full_usage "\n\n"
14//usage: "Create a range of block or character special files"
15//usage: "\n"
16//usage: "\nTYPE is:"
17//usage: "\n b Block device"
18//usage: "\n c Character device"
19//usage: "\n f FIFO, MAJOR and MINOR are ignored"
20//usage: "\n"
21//usage: "\nFIRST..LAST specify numbers appended to NAME."
22//usage: "\nIf 's' is the last argument, the base device is created as well."
23//usage: "\n"
24//usage: "\nExamples:"
25//usage: "\n makedevs /dev/ttyS c 4 66 2 63 -> ttyS2-ttyS63"
26//usage: "\n makedevs /dev/hda b 3 0 0 8 s -> hda,hda1-hda8"
27//usage:
28//usage:#define makedevs_example_usage
29//usage: "# makedevs /dev/ttyS c 4 66 2 63\n"
30//usage: "[creates ttyS2-ttyS63]\n"
31//usage: "# makedevs /dev/hda b 3 0 0 8 s\n"
32//usage: "[creates hda,hda1-hda8]\n"
33//usage:#endif
34//usage:
35//usage:#if ENABLE_FEATURE_MAKEDEVS_TABLE
36//usage:#define makedevs_trivial_usage
37//usage: "[-d device_table] rootdir"
38//usage:#define makedevs_full_usage "\n\n"
39//usage: "Create a range of special files as specified in a device table.\n"
40//usage: "Device table entries take the form of:\n"
41//usage: "<type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>\n"
42//usage: "Where name is the file name, type can be one of:\n"
43//usage: " f Regular file\n"
44//usage: " d Directory\n"
45//usage: " c Character device\n"
46//usage: " b Block device\n"
47//usage: " p Fifo (named pipe)\n"
48//usage: "uid is the user id for the target file, gid is the group id for the\n"
49//usage: "target file. The rest of the entries (major, minor, etc) apply to\n"
50//usage: "to device special files. A '-' may be used for blank entries."
51//usage:
52//usage:#define makedevs_example_usage
53//usage: "For example:\n"
54//usage: "<name> <type> <mode><uid><gid><major><minor><start><inc><count>\n"
55//usage: "/dev d 755 0 0 - - - - -\n"
56//usage: "/dev/console c 666 0 0 5 1 - - -\n"
57//usage: "/dev/null c 666 0 0 1 3 0 0 -\n"
58//usage: "/dev/zero c 666 0 0 1 5 0 0 -\n"
59//usage: "/dev/hda b 640 0 0 3 0 0 0 -\n"
60//usage: "/dev/hda b 640 0 0 3 1 1 1 15\n\n"
61//usage: "Will Produce:\n"
62//usage: "/dev\n"
63//usage: "/dev/console\n"
64//usage: "/dev/null\n"
65//usage: "/dev/zero\n"
66//usage: "/dev/hda\n"
67//usage: "/dev/hda[0-15]\n"
68//usage:#endif
69
10#include "libbb.h" 70#include "libbb.h"
11 71
12#if ENABLE_FEATURE_MAKEDEVS_LEAF 72#if ENABLE_FEATURE_MAKEDEVS_LEAF
diff --git a/miscutils/man.c b/miscutils/man.c
index b356e726f..2c6b25ceb 100644
--- a/miscutils/man.c
+++ b/miscutils/man.c
@@ -3,6 +3,14 @@
3 * Licensed under GPLv2, see file LICENSE in this source tree. 3 * Licensed under GPLv2, see file LICENSE in this source tree.
4 */ 4 */
5 5
6//usage:#define man_trivial_usage
7//usage: "[-aw] [MANPAGE]..."
8//usage:#define man_full_usage "\n\n"
9//usage: "Format and display manual page\n"
10//usage: "\nOptions:"
11//usage: "\n -a Display all pages"
12//usage: "\n -w Show page locations"
13
6#include "libbb.h" 14#include "libbb.h"
7 15
8enum { 16enum {
diff --git a/miscutils/microcom.c b/miscutils/microcom.c
index 3acbe3023..edaeb6fa5 100644
--- a/miscutils/microcom.c
+++ b/miscutils/microcom.c
@@ -7,6 +7,18 @@
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10
11//usage:#define microcom_trivial_usage
12//usage: "[-d DELAY] [-t TIMEOUT] [-s SPEED] [-X] TTY"
13//usage:#define microcom_full_usage "\n\n"
14//usage: "Copy bytes for stdin to TTY and from TTY to stdout\n"
15//usage: "\nOptions:"
16//usage: "\n -d Wait up to DELAY ms for TTY output before sending every"
17//usage: "\n next byte to it"
18//usage: "\n -t Exit if both stdin and TTY are silent for TIMEOUT ms"
19//usage: "\n -s Set serial line to SPEED"
20//usage: "\n -X Disable special meaning of NUL and Ctrl-X from stdin"
21
10#include "libbb.h" 22#include "libbb.h"
11 23
12// set raw tty mode 24// set raw tty mode
diff --git a/miscutils/mountpoint.c b/miscutils/mountpoint.c
index 784c3cbfc..a1a5b396a 100644
--- a/miscutils/mountpoint.c
+++ b/miscutils/mountpoint.c
@@ -9,6 +9,22 @@
9 * Based on sysvinit's mountpoint 9 * Based on sysvinit's mountpoint
10 */ 10 */
11 11
12//usage:#define mountpoint_trivial_usage
13//usage: "[-q] <[-dn] DIR | -x DEVICE>"
14//usage:#define mountpoint_full_usage "\n\n"
15//usage: "Check if the directory is a mountpoint\n"
16//usage: "\nOptions:"
17//usage: "\n -q Quiet"
18//usage: "\n -d Print major/minor device number of the filesystem"
19//usage: "\n -n Print device name of the filesystem"
20//usage: "\n -x Print major/minor device number of the blockdevice"
21//usage:
22//usage:#define mountpoint_example_usage
23//usage: "$ mountpoint /proc\n"
24//usage: "/proc is not a mountpoint\n"
25//usage: "$ mountpoint /sys\n"
26//usage: "/sys is a mountpoint\n"
27
12#include "libbb.h" 28#include "libbb.h"
13 29
14int mountpoint_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 30int mountpoint_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/miscutils/mt.c b/miscutils/mt.c
index 142901bb0..20afd3a50 100644
--- a/miscutils/mt.c
+++ b/miscutils/mt.c
@@ -3,6 +3,18 @@
3 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 3 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
4 */ 4 */
5 5
6//usage:#define mt_trivial_usage
7//usage: "[-f device] opcode value"
8//usage:#define mt_full_usage "\n\n"
9//usage: "Control magnetic tape drive operation\n"
10//usage: "\n"
11//usage: "Available Opcodes:\n"
12//usage: "\n"
13//usage: "bsf bsfm bsr bss datacompression drvbuffer eof eom erase\n"
14//usage: "fsf fsfm fsr fss load lock mkpart nop offline ras1 ras2\n"
15//usage: "ras3 reset retension rewind rewoffline seek setblk setdensity\n"
16//usage: "setpart tell unload unlock weof wset"
17
6#include "libbb.h" 18#include "libbb.h"
7#include <sys/mtio.h> 19#include <sys/mtio.h>
8 20
diff --git a/miscutils/raidautorun.c b/miscutils/raidautorun.c
index bbfa8577c..b72d89058 100644
--- a/miscutils/raidautorun.c
+++ b/miscutils/raidautorun.c
@@ -8,6 +8,14 @@
8 * 8 *
9 */ 9 */
10 10
11//usage:#define raidautorun_trivial_usage
12//usage: "DEVICE"
13//usage:#define raidautorun_full_usage "\n\n"
14//usage: "Tell the kernel to automatically search and start RAID arrays"
15//usage:
16//usage:#define raidautorun_example_usage
17//usage: "$ raidautorun /dev/md0"
18
11#include "libbb.h" 19#include "libbb.h"
12 20
13#include <linux/major.h> 21#include <linux/major.h>
diff --git a/miscutils/readahead.c b/miscutils/readahead.c
index dd6de7c45..e22aaa468 100644
--- a/miscutils/readahead.c
+++ b/miscutils/readahead.c
@@ -10,6 +10,11 @@
10 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 10 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
11 */ 11 */
12 12
13//usage:#define readahead_trivial_usage
14//usage: "[FILE]..."
15//usage:#define readahead_full_usage "\n\n"
16//usage: "Preload FILEs to RAM"
17
13#include "libbb.h" 18#include "libbb.h"
14 19
15int readahead_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 20int readahead_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/miscutils/rfkill.c b/miscutils/rfkill.c
index b150b2cae..467197371 100644
--- a/miscutils/rfkill.c
+++ b/miscutils/rfkill.c
@@ -6,6 +6,19 @@
6* 6*
7* Licensed under GPLv2 or later, see file LICENSE in this source tree. 7* Licensed under GPLv2 or later, see file LICENSE in this source tree.
8*/ 8*/
9
10//usage:#define rfkill_trivial_usage
11//usage: "COMMAND [INDEX|TYPE]"
12//usage:#define rfkill_full_usage "\n\n"
13//usage: "Enable/disable wireless devices\n"
14//usage: "\nCommands:"
15//usage: "\n list [INDEX|TYPE] List current state"
16//usage: "\n block INDEX|TYPE Disable device"
17//usage: "\n unblock INDEX|TYPE Enable device"
18//usage: "\n"
19//usage: "\n TYPE: all, wlan(wifi), bluetooth, uwb(ultrawideband),"
20//usage: "\n wimax, wwan, gps, fm"
21
9#include "libbb.h" 22#include "libbb.h"
10#include <linux/rfkill.h> 23#include <linux/rfkill.h>
11 24
diff --git a/miscutils/runlevel.c b/miscutils/runlevel.c
index 7024361e7..9d38b791f 100644
--- a/miscutils/runlevel.c
+++ b/miscutils/runlevel.c
@@ -11,6 +11,19 @@
11 * 11 *
12 * initially busyboxified by Bernhard Reutner-Fischer 12 * initially busyboxified by Bernhard Reutner-Fischer
13 */ 13 */
14
15//usage:#define runlevel_trivial_usage
16//usage: "[FILE]"
17//usage:#define runlevel_full_usage "\n\n"
18//usage: "Find the current and previous system runlevel\n"
19//usage: "\n"
20//usage: "If no utmp FILE exists or if no runlevel record can be found,\n"
21//usage: "print \"unknown\""
22//usage:
23//usage:#define runlevel_example_usage
24//usage: "$ runlevel /var/run/utmp\n"
25//usage: "N 2"
26
14#include "libbb.h" 27#include "libbb.h"
15 28
16int runlevel_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 29int runlevel_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/miscutils/rx.c b/miscutils/rx.c
index de785d53c..e1225779e 100644
--- a/miscutils/rx.c
+++ b/miscutils/rx.c
@@ -15,6 +15,14 @@
15 * This was originally written for blob and then adapted for busybox. 15 * This was originally written for blob and then adapted for busybox.
16 */ 16 */
17 17
18//usage:#define rx_trivial_usage
19//usage: "FILE"
20//usage:#define rx_full_usage "\n\n"
21//usage: "Receive a file using the xmodem protocol"
22//usage:
23//usage:#define rx_example_usage
24//usage: "$ rx /tmp/foo\n"
25
18#include "libbb.h" 26#include "libbb.h"
19 27
20#define SOH 0x01 28#define SOH 0x01
diff --git a/miscutils/setsid.c b/miscutils/setsid.c
index c573fae34..ad2c8a4de 100644
--- a/miscutils/setsid.c
+++ b/miscutils/setsid.c
@@ -14,6 +14,13 @@
14 * - busyboxed 14 * - busyboxed
15 */ 15 */
16 16
17//usage:#define setsid_trivial_usage
18//usage: "PROG ARGS"
19//usage:#define setsid_full_usage "\n\n"
20//usage: "Run PROG in a new session. PROG will have no controlling terminal\n"
21//usage: "and will not be affected by keyboard signals (Ctrl-C etc).\n"
22//usage: "See setsid(2) for details."
23
17#include "libbb.h" 24#include "libbb.h"
18 25
19int setsid_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 26int setsid_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/miscutils/strings.c b/miscutils/strings.c
index 7ab0e227c..6e8b9aefc 100644
--- a/miscutils/strings.c
+++ b/miscutils/strings.c
@@ -7,6 +7,16 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define strings_trivial_usage
11//usage: "[-afo] [-n LEN] [FILE]..."
12//usage:#define strings_full_usage "\n\n"
13//usage: "Display printable strings in a binary file\n"
14//usage: "\nOptions:"
15//usage: "\n -a Scan whole file (default)"
16//usage: "\n -f Precede strings with filenames"
17//usage: "\n -n LEN At least LEN characters form a string (default 4)"
18//usage: "\n -o Precede strings with decimal offsets"
19
10#include "libbb.h" 20#include "libbb.h"
11 21
12#define WHOLE_FILE 1 22#define WHOLE_FILE 1
diff --git a/miscutils/taskset.c b/miscutils/taskset.c
index 389ef43e4..77fc8643d 100644
--- a/miscutils/taskset.c
+++ b/miscutils/taskset.c
@@ -6,6 +6,24 @@
6 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 6 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
7 */ 7 */
8 8
9//usage:#define taskset_trivial_usage
10//usage: "[-p] [MASK] [PID | PROG ARGS]"
11//usage:#define taskset_full_usage "\n\n"
12//usage: "Set or get CPU affinity\n"
13//usage: "\nOptions:"
14//usage: "\n -p Operate on an existing PID"
15//usage:
16//usage:#define taskset_example_usage
17//usage: "$ taskset 0x7 ./dgemm_test&\n"
18//usage: "$ taskset -p 0x1 $!\n"
19//usage: "pid 4790's current affinity mask: 7\n"
20//usage: "pid 4790's new affinity mask: 1\n"
21//usage: "$ taskset 0x7 /bin/sh -c './taskset -p 0x1 $$'\n"
22//usage: "pid 6671's current affinity mask: 1\n"
23//usage: "pid 6671's new affinity mask: 1\n"
24//usage: "$ taskset -p 1\n"
25//usage: "pid 1's current affinity mask: 3\n"
26
9#include <sched.h> 27#include <sched.h>
10#include "libbb.h" 28#include "libbb.h"
11 29
diff --git a/miscutils/time.c b/miscutils/time.c
index 6b1c3c42c..dcd89f8fc 100644
--- a/miscutils/time.c
+++ b/miscutils/time.c
@@ -9,6 +9,13 @@
9 Heavily modified for busybox by Erik Andersen <andersen@codepoet.org> 9 Heavily modified for busybox by Erik Andersen <andersen@codepoet.org>
10*/ 10*/
11 11
12//usage:#define time_trivial_usage
13//usage: "[-v] PROG ARGS"
14//usage:#define time_full_usage "\n\n"
15//usage: "Run PROG, display resource usage when it exits\n"
16//usage: "\nOptions:"
17//usage: "\n -v Verbose"
18
12#include "libbb.h" 19#include "libbb.h"
13 20
14/* Information on the resources used by a child process. */ 21/* Information on the resources used by a child process. */
diff --git a/miscutils/timeout.c b/miscutils/timeout.c
index 841669416..9d56593ba 100644
--- a/miscutils/timeout.c
+++ b/miscutils/timeout.c
@@ -28,6 +28,12 @@
28 * rewrite 14-11-2008 vda 28 * rewrite 14-11-2008 vda
29 */ 29 */
30 30
31//usage:#define timeout_trivial_usage
32//usage: "[-t SECS] [-s SIG] PROG ARGS"
33//usage:#define timeout_full_usage "\n\n"
34//usage: "Runs PROG. Sends SIG to it if it is not gone in SECS seconds.\n"
35//usage: "Defaults: SECS: 10, SIG: TERM."
36
31#include "libbb.h" 37#include "libbb.h"
32 38
33int timeout_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 39int timeout_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/miscutils/ttysize.c b/miscutils/ttysize.c
index f93a506a2..d2d48d0a9 100644
--- a/miscutils/ttysize.c
+++ b/miscutils/ttysize.c
@@ -9,6 +9,12 @@
9 * 9 *
10 * Licensed under GPLv2, see file LICENSE in this source tree. 10 * Licensed under GPLv2, see file LICENSE in this source tree.
11 */ 11 */
12
13//usage:#define ttysize_trivial_usage
14//usage: "[w] [h]"
15//usage:#define ttysize_full_usage "\n\n"
16//usage: "Print dimension(s) of stdin's terminal, on error return 80x25"
17
12#include "libbb.h" 18#include "libbb.h"
13 19
14int ttysize_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 20int ttysize_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/miscutils/volname.c b/miscutils/volname.c
index 6e8615617..b50e79573 100644
--- a/miscutils/volname.c
+++ b/miscutils/volname.c
@@ -27,6 +27,12 @@
27 * mods from distributed source (eject-2.0.13) are by 27 * mods from distributed source (eject-2.0.13) are by
28 * Matthew Stoltenberg <d3matt@gmail.com> 28 * Matthew Stoltenberg <d3matt@gmail.com>
29 */ 29 */
30
31//usage:#define volname_trivial_usage
32//usage: "[DEVICE]"
33//usage:#define volname_full_usage "\n\n"
34//usage: "Show CD volume name of the DEVICE (default /dev/cdrom)"
35
30#include "libbb.h" 36#include "libbb.h"
31 37
32int volname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 38int volname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/miscutils/wall.c b/miscutils/wall.c
index 0a2b89e5e..762f53b72 100644
--- a/miscutils/wall.c
+++ b/miscutils/wall.c
@@ -6,6 +6,15 @@
6 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 6 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
7 */ 7 */
8 8
9//usage:#define wall_trivial_usage
10//usage: "[FILE]"
11//usage:#define wall_full_usage "\n\n"
12//usage: "Write content of FILE or stdin to all logged-in users"
13//usage:
14//usage:#define wall_sample_usage
15//usage: "echo foo | wall\n"
16//usage: "wall ./mymessage"
17
9#include "libbb.h" 18#include "libbb.h"
10 19
11int wall_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 20int wall_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c
index 630782660..b24dd4b82 100644
--- a/miscutils/watchdog.c
+++ b/miscutils/watchdog.c
@@ -9,6 +9,17 @@
9 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 9 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
10 */ 10 */
11 11
12//usage:#define watchdog_trivial_usage
13//usage: "[-t N[ms]] [-T N[ms]] [-F] DEV"
14//usage:#define watchdog_full_usage "\n\n"
15//usage: "Periodically write to watchdog device DEV\n"
16//usage: "\nOptions:"
17//usage: "\n -T N Reboot after N seconds if not reset (default 60)"
18//usage: "\n -t N Reset every N seconds (default 30)"
19//usage: "\n -F Run in foreground"
20//usage: "\n"
21//usage: "\nUse 500ms to specify period in milliseconds"
22
12#include "libbb.h" 23#include "libbb.h"
13#include "linux/types.h" /* for __u32 */ 24#include "linux/types.h" /* for __u32 */
14#include "linux/watchdog.h" 25#include "linux/watchdog.h"
diff --git a/networking/arp.c b/networking/arp.c
index 0ef267a35..3f68f5cf7 100644
--- a/networking/arp.c
+++ b/networking/arp.c
@@ -13,6 +13,25 @@
13 * modified for getopt32 by Arne Bernin <arne [at] alamut.de> 13 * modified for getopt32 by Arne Bernin <arne [at] alamut.de>
14 */ 14 */
15 15
16//usage:#define arp_trivial_usage
17//usage: "\n[-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME]"
18//usage: "\n[-v] [-i IF] -d HOSTNAME [pub]"
19//usage: "\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [temp]"
20//usage: "\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [netmask MASK] pub"
21//usage: "\n[-v] [-H HWTYPE] [-i IF] -Ds HOSTNAME IFACE [netmask MASK] pub"
22//usage:#define arp_full_usage "\n\n"
23//usage: "Manipulate ARP cache\n"
24//usage: "\nOptions:"
25//usage: "\n -a Display (all) hosts"
26//usage: "\n -s Set new ARP entry"
27//usage: "\n -d Delete a specified entry"
28//usage: "\n -v Verbose"
29//usage: "\n -n Don't resolve names"
30//usage: "\n -i IF Network interface"
31//usage: "\n -D Read <hwaddr> from given device"
32//usage: "\n -A,-p AF Protocol family"
33//usage: "\n -H HWTYPE Hardware address type"
34
16#include "libbb.h" 35#include "libbb.h"
17#include "inet_common.h" 36#include "inet_common.h"
18 37
diff --git a/networking/arping.c b/networking/arping.c
index 6f6b59cfb..357dcaaf0 100644
--- a/networking/arping.c
+++ b/networking/arping.c
@@ -6,6 +6,23 @@
6 * Busybox port: Nick Fedchik <nick@fedchik.org.ua> 6 * Busybox port: Nick Fedchik <nick@fedchik.org.ua>
7 */ 7 */
8 8
9//usage:#define arping_trivial_usage
10//usage: "[-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP"
11//usage:#define arping_full_usage "\n\n"
12//usage: "Send ARP requests/replies\n"
13//usage: "\nOptions:"
14//usage: "\n -f Quit on first ARP reply"
15//usage: "\n -q Quiet"
16//usage: "\n -b Keep broadcasting, don't go unicast"
17//usage: "\n -D Duplicated address detection mode"
18//usage: "\n -U Unsolicited ARP mode, update your neighbors"
19//usage: "\n -A ARP answer mode, update your neighbors"
20//usage: "\n -c N Stop after sending N ARP requests"
21//usage: "\n -w TIMEOUT Time to wait for ARP reply, seconds"
22//usage: "\n -I IFACE Interface to use (default eth0)"
23//usage: "\n -s SRC_IP Sender IP address"
24//usage: "\n DST_IP Target IP address"
25
9#include <arpa/inet.h> 26#include <arpa/inet.h>
10#include <net/if.h> 27#include <net/if.h>
11#include <netinet/ether.h> 28#include <netinet/ether.h>
diff --git a/networking/brctl.c b/networking/brctl.c
index c0b094eba..19f474fce 100644
--- a/networking/brctl.c
+++ b/networking/brctl.c
@@ -12,6 +12,30 @@
12/* This applet currently uses only the ioctl interface and no sysfs at all. 12/* This applet currently uses only the ioctl interface and no sysfs at all.
13 * At the time of this writing this was considered a feature. 13 * At the time of this writing this was considered a feature.
14 */ 14 */
15
16//usage:#define brctl_trivial_usage
17//usage: "COMMAND [BRIDGE [INTERFACE]]"
18//usage:#define brctl_full_usage "\n\n"
19//usage: "Manage ethernet bridges\n"
20//usage: "\nCommands:"
21//usage: IF_FEATURE_BRCTL_SHOW(
22//usage: "\n show Show a list of bridges"
23//usage: )
24//usage: "\n addbr BRIDGE Create BRIDGE"
25//usage: "\n delbr BRIDGE Delete BRIDGE"
26//usage: "\n addif BRIDGE IFACE Add IFACE to BRIDGE"
27//usage: "\n delif BRIDGE IFACE Delete IFACE from BRIDGE"
28//usage: IF_FEATURE_BRCTL_FANCY(
29//usage: "\n setageing BRIDGE TIME Set ageing time"
30//usage: "\n setfd BRIDGE TIME Set bridge forward delay"
31//usage: "\n sethello BRIDGE TIME Set hello time"
32//usage: "\n setmaxage BRIDGE TIME Set max message age"
33//usage: "\n setpathcost BRIDGE COST Set path cost"
34//usage: "\n setportprio BRIDGE PRIO Set port priority"
35//usage: "\n setbridgeprio BRIDGE PRIO Set bridge priority"
36//usage: "\n stp BRIDGE [1/yes/on|0/no/off] STP on/off"
37//usage: )
38
15#include "libbb.h" 39#include "libbb.h"
16#include <linux/sockios.h> 40#include <linux/sockios.h>
17#include <net/if.h> 41#include <net/if.h>
diff --git a/networking/dnsd.c b/networking/dnsd.c
index 8ed31cea2..65eae9670 100644
--- a/networking/dnsd.c
+++ b/networking/dnsd.c
@@ -17,6 +17,22 @@
17 * the first porting of oao' scdns to busybox also. 17 * the first porting of oao' scdns to busybox also.
18 */ 18 */
19 19
20//usage:#define dnsd_trivial_usage
21//usage: "[-dvs] [-c CONFFILE] [-t TTL_SEC] [-p PORT] [-i ADDR]"
22//usage:#define dnsd_full_usage "\n\n"
23//usage: "Small static DNS server daemon\n"
24//usage: "\nOptions:"
25//usage: "\n -c FILE Config file"
26//usage: "\n -t SEC TTL"
27//usage: "\n -p PORT Listen on PORT"
28//usage: "\n -i ADDR Listen on ADDR"
29//usage: "\n -d Daemonize"
30//usage: "\n -v Verbose"
31//usage: "\n -s Send successful replies only. Use this if you want"
32//usage: "\n to use /etc/resolv.conf with two nameserver lines:"
33//usage: "\n nameserver DNSD_SERVER"
34//usage: "\n nameserver NORNAL_DNS_SERVER"
35
20#include "libbb.h" 36#include "libbb.h"
21#include <syslog.h> 37#include <syslog.h>
22 38
diff --git a/networking/ether-wake.c b/networking/ether-wake.c
index 8f1479c02..7bb9aa5a7 100644
--- a/networking/ether-wake.c
+++ b/networking/ether-wake.c
@@ -64,6 +64,16 @@
64 * filter. That configuration consumes more power. 64 * filter. That configuration consumes more power.
65*/ 65*/
66 66
67//usage:#define ether_wake_trivial_usage
68//usage: "[-b] [-i iface] [-p aa:bb:cc:dd[:ee:ff]] MAC"
69//usage:#define ether_wake_full_usage "\n\n"
70//usage: "Send a magic packet to wake up sleeping machines.\n"
71//usage: "MAC must be a station address (00:11:22:33:44:55) or\n"
72//usage: "a hostname with a known 'ethers' entry.\n"
73//usage: "\nOptions:"
74//usage: "\n -b Send wake-up packet to the broadcast address"
75//usage: "\n -i iface Interface to use (default eth0)"
76//usage: "\n -p pass Append four or six byte password PW to the packet"
67 77
68#include <netpacket/packet.h> 78#include <netpacket/packet.h>
69#include <net/ethernet.h> 79#include <net/ethernet.h>
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 09c5ff30f..66316e21f 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -13,6 +13,44 @@
13 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 13 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
14 */ 14 */
15 15
16//usage:#define ftpget_trivial_usage
17//usage: "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE"
18//usage:#define ftpget_full_usage "\n\n"
19//usage: "Retrieve a remote file via FTP\n"
20//usage: "\nOptions:"
21//usage: IF_FEATURE_FTPGETPUT_LONG_OPTIONS(
22//usage: "\n -c,--continue Continue previous transfer"
23//usage: "\n -v,--verbose Verbose"
24//usage: "\n -u,--username Username"
25//usage: "\n -p,--password Password"
26//usage: "\n -P,--port Port number"
27//usage: )
28//usage: IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS(
29//usage: "\n -c Continue previous transfer"
30//usage: "\n -v Verbose"
31//usage: "\n -u Username"
32//usage: "\n -p Password"
33//usage: "\n -P Port number"
34//usage: )
35//usage:
36//usage:#define ftpput_trivial_usage
37//usage: "[OPTIONS] HOST [REMOTE_FILE] LOCAL_FILE"
38//usage:#define ftpput_full_usage "\n\n"
39//usage: "Store a local file on a remote machine via FTP\n"
40//usage: "\nOptions:"
41//usage: IF_FEATURE_FTPGETPUT_LONG_OPTIONS(
42//usage: "\n -v,--verbose Verbose"
43//usage: "\n -u,--username Username"
44//usage: "\n -p,--password Password"
45//usage: "\n -P,--port Port number"
46//usage: )
47//usage: IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS(
48//usage: "\n -v Verbose"
49//usage: "\n -u Username"
50//usage: "\n -p Password"
51//usage: "\n -P Port number"
52//usage: )
53
16#include "libbb.h" 54#include "libbb.h"
17 55
18struct globals { 56struct globals {
diff --git a/networking/hostname.c b/networking/hostname.c
index 66b52dd90..49a3e89bb 100644
--- a/networking/hostname.c
+++ b/networking/hostname.c
@@ -9,6 +9,25 @@
9 * 9 *
10 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 10 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
11 */ 11 */
12
13//usage:#define hostname_trivial_usage
14//usage: "[OPTIONS] [HOSTNAME | -F FILE]"
15//usage:#define hostname_full_usage "\n\n"
16//usage: "Get or set hostname or DNS domain name\n"
17//usage: "\nOptions:"
18//usage: "\n -s Short"
19//usage: "\n -i Addresses for the hostname"
20//usage: "\n -d DNS domain name"
21//usage: "\n -f Fully qualified domain name"
22//usage: "\n -F FILE Use FILE's content as hostname"
23//usage:
24//usage:#define hostname_example_usage
25//usage: "$ hostname\n"
26//usage: "sage\n"
27//usage:
28//usage:#define dnsdomainname_trivial_usage NOUSAGE_STR
29//usage:#define dnsdomainname_full_usage ""
30
12#include "libbb.h" 31#include "libbb.h"
13 32
14static void do_sethostname(char *s, int isfile) 33static void do_sethostname(char *s, int isfile)
diff --git a/networking/httpd.c b/networking/httpd.c
index eded7b63f..d6157aca2 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -97,6 +97,32 @@
97 */ 97 */
98 /* TODO: use TCP_CORK, parse_config() */ 98 /* TODO: use TCP_CORK, parse_config() */
99 99
100//usage:#define httpd_trivial_usage
101//usage: "[-ifv[v]]"
102//usage: " [-c CONFFILE]"
103//usage: " [-p [IP:]PORT]"
104//usage: IF_FEATURE_HTTPD_SETUID(" [-u USER[:GRP]]")
105//usage: IF_FEATURE_HTTPD_BASIC_AUTH(" [-r REALM]")
106//usage: " [-h HOME]\n"
107//usage: "or httpd -d/-e" IF_FEATURE_HTTPD_AUTH_MD5("/-m") " STRING"
108//usage:#define httpd_full_usage "\n\n"
109//usage: "Listen for incoming HTTP requests\n"
110//usage: "\nOptions:"
111//usage: "\n -i Inetd mode"
112//usage: "\n -f Don't daemonize"
113//usage: "\n -v[v] Verbose"
114//usage: "\n -p [IP:]PORT Bind to IP:PORT (default *:80)"
115//usage: IF_FEATURE_HTTPD_SETUID(
116//usage: "\n -u USER[:GRP] Set uid/gid after binding to port")
117//usage: IF_FEATURE_HTTPD_BASIC_AUTH(
118//usage: "\n -r REALM Authentication Realm for Basic Authentication")
119//usage: "\n -h HOME Home directory (default .)"
120//usage: "\n -c FILE Configuration file (default {/etc,HOME}/httpd.conf)"
121//usage: IF_FEATURE_HTTPD_AUTH_MD5(
122//usage: "\n -m STRING MD5 crypt STRING")
123//usage: "\n -e STRING HTML encode STRING"
124//usage: "\n -d STRING URL decode STRING"
125
100#include "libbb.h" 126#include "libbb.h"
101#if ENABLE_FEATURE_HTTPD_USE_SENDFILE 127#if ENABLE_FEATURE_HTTPD_USE_SENDFILE
102# include <sys/sendfile.h> 128# include <sys/sendfile.h>
diff --git a/networking/ifconfig.c b/networking/ifconfig.c
index da2635ce0..220b02126 100644
--- a/networking/ifconfig.c
+++ b/networking/ifconfig.c
@@ -26,6 +26,27 @@
26 * IPV6 support added by Bart Visscher <magick@linux-fan.com> 26 * IPV6 support added by Bart Visscher <magick@linux-fan.com>
27 */ 27 */
28 28
29//usage:#define ifconfig_trivial_usage
30//usage: IF_FEATURE_IFCONFIG_STATUS("[-a]") " interface [address]"
31//usage:#define ifconfig_full_usage "\n\n"
32//usage: "Configure a network interface\n"
33//usage: "\nOptions:"
34//usage: "\n"
35//usage: IF_FEATURE_IPV6(
36//usage: " [add ADDRESS[/PREFIXLEN]]\n")
37//usage: IF_FEATURE_IPV6(
38//usage: " [del ADDRESS[/PREFIXLEN]]\n")
39//usage: " [[-]broadcast [ADDRESS]] [[-]pointopoint [ADDRESS]]\n"
40//usage: " [netmask ADDRESS] [dstaddr ADDRESS]\n"
41//usage: IF_FEATURE_IFCONFIG_SLIP(
42//usage: " [outfill NN] [keepalive NN]\n")
43//usage: " " IF_FEATURE_IFCONFIG_HW("[hw ether" IF_FEATURE_HWIB("|infiniband")" ADDRESS] ") "[metric NN] [mtu NN]\n"
44//usage: " [[-]trailers] [[-]arp] [[-]allmulti]\n"
45//usage: " [multicast] [[-]promisc] [txqueuelen NN] [[-]dynamic]\n"
46//usage: IF_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ(
47//usage: " [mem_start NN] [io_addr NN] [irq NN]\n")
48//usage: " [up|down] ..."
49
29#include <net/if.h> 50#include <net/if.h>
30#include <net/if_arp.h> 51#include <net/if_arp.h>
31#include <netinet/in.h> 52#include <netinet/in.h>
diff --git a/networking/ifenslave.c b/networking/ifenslave.c
index 0b3ebf72a..208623e7d 100644
--- a/networking/ifenslave.c
+++ b/networking/ifenslave.c
@@ -98,6 +98,33 @@
98 * set version to 1.1.0 98 * set version to 1.1.0
99 */ 99 */
100 100
101//usage:#define ifenslave_trivial_usage
102//usage: "[-cdf] MASTER_IFACE SLAVE_IFACE..."
103//usage:#define ifenslave_full_usage "\n\n"
104//usage: "Configure network interfaces for parallel routing\n"
105//usage: "\nOptions:"
106//usage: "\n -c,--change-active Change active slave"
107//usage: "\n -d,--detach Remove slave interface from bonding device"
108//usage: "\n -f,--force Force, even if interface is not Ethernet"
109/* //usage: "\n -r,--receive-slave Create a receive-only slave" */
110//usage:
111//usage:#define ifenslave_example_usage
112//usage: "To create a bond device, simply follow these three steps:\n"
113//usage: "- ensure that the required drivers are properly loaded:\n"
114//usage: " # modprobe bonding ; modprobe <3c59x|eepro100|pcnet32|tulip|...>\n"
115//usage: "- assign an IP address to the bond device:\n"
116//usage: " # ifconfig bond0 <addr> netmask <mask> broadcast <bcast>\n"
117//usage: "- attach all the interfaces you need to the bond device:\n"
118//usage: " # ifenslave bond0 eth0 eth1 eth2\n"
119//usage: " If bond0 didn't have a MAC address, it will take eth0's. Then, all\n"
120//usage: " interfaces attached AFTER this assignment will get the same MAC addr.\n\n"
121//usage: " To detach a dead interface without setting the bond device down:\n"
122//usage: " # ifenslave -d bond0 eth1\n\n"
123//usage: " To set the bond device down and automatically release all the slaves:\n"
124//usage: " # ifconfig bond0 down\n\n"
125//usage: " To change active slave:\n"
126//usage: " # ifenslave -c bond0 eth0\n"
127
101#include "libbb.h" 128#include "libbb.h"
102 129
103/* #include <net/if.h> - no. linux/if_bonding.h pulls in linux/if.h */ 130/* #include <net/if.h> - no. linux/if_bonding.h pulls in linux/if.h */
diff --git a/networking/ifplugd.c b/networking/ifplugd.c
index 8dd0a5bd8..421611aae 100644
--- a/networking/ifplugd.c
+++ b/networking/ifplugd.c
@@ -6,6 +6,32 @@
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9
10//usage:#define ifplugd_trivial_usage
11//usage: "[OPTIONS]"
12//usage:#define ifplugd_full_usage "\n\n"
13//usage: "Network interface plug detection daemon\n"
14//usage: "\nOptions:"
15//usage: "\n -n Don't daemonize"
16//usage: "\n -s Don't log to syslog"
17//usage: "\n -i IFACE Interface"
18//usage: "\n -f/-F Treat link detection error as link down/link up"
19//usage: "\n (otherwise exit on error)"
20//usage: "\n -a Don't up interface at each link probe"
21//usage: "\n -M Monitor creation/destruction of interface"
22//usage: "\n (otherwise it must exist)"
23//usage: "\n -r PROG Script to run"
24//usage: "\n -x ARG Extra argument for script"
25//usage: "\n -I Don't exit on nonzero exit code from script"
26//usage: "\n -p Don't run script on daemon startup"
27//usage: "\n -q Don't run script on daemon quit"
28//usage: "\n -l Run script on startup even if no cable is detected"
29//usage: "\n -t SECS Poll time in seconds"
30//usage: "\n -u SECS Delay before running script after link up"
31//usage: "\n -d SECS Delay after link down"
32//usage: "\n -m MODE API mode (mii, priv, ethtool, wlan, iff, auto)"
33//usage: "\n -k Kill running daemon"
34
9#include "libbb.h" 35#include "libbb.h"
10 36
11#include "fix_u32.h" 37#include "fix_u32.h"
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 7706a84b7..b48abb7dc 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -17,6 +17,34 @@
17 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 17 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
18 */ 18 */
19 19
20//usage:#define ifup_trivial_usage
21//usage: "[-an"IF_FEATURE_IFUPDOWN_MAPPING("m")"vf] [-i FILE] IFACE..."
22//usage:#define ifup_full_usage "\n\n"
23//usage: "Options:"
24//usage: "\n -a De/configure all interfaces automatically"
25//usage: "\n -i FILE Use FILE for interface definitions"
26//usage: "\n -n Print out what would happen, but don't do it"
27//usage: IF_FEATURE_IFUPDOWN_MAPPING(
28//usage: "\n (note: doesn't disable mappings)"
29//usage: "\n -m Don't run any mappings"
30//usage: )
31//usage: "\n -v Print out what would happen before doing it"
32//usage: "\n -f Force de/configuration"
33//usage:
34//usage:#define ifdown_trivial_usage
35//usage: "[-an"IF_FEATURE_IFUPDOWN_MAPPING("m")"vf] [-i FILE] IFACE..."
36//usage:#define ifdown_full_usage "\n\n"
37//usage: "Options:"
38//usage: "\n -a De/configure all interfaces automatically"
39//usage: "\n -i FILE Use FILE for interface definitions"
40//usage: "\n -n Print out what would happen, but don't do it"
41//usage: IF_FEATURE_IFUPDOWN_MAPPING(
42//usage: "\n (note: doesn't disable mappings)"
43//usage: "\n -m Don't run any mappings"
44//usage: )
45//usage: "\n -v Print out what would happen before doing it"
46//usage: "\n -f Force de/configuration"
47
20#include "libbb.h" 48#include "libbb.h"
21/* After libbb.h, since it needs sys/types.h on some systems */ 49/* After libbb.h, since it needs sys/types.h on some systems */
22#include <sys/utsname.h> 50#include <sys/utsname.h>
diff --git a/networking/inetd.c b/networking/inetd.c
index 6018665ef..226a6491c 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -154,6 +154,17 @@
154 * setuid() 154 * setuid()
155 */ 155 */
156 156
157//usage:#define inetd_trivial_usage
158//usage: "[-fe] [-q N] [-R N] [CONFFILE]"
159//usage:#define inetd_full_usage "\n\n"
160//usage: "Listen for network connections and launch programs\n"
161//usage: "\nOptions:"
162//usage: "\n -f Run in foreground"
163//usage: "\n -e Log to stderr"
164//usage: "\n -q N Socket listen queue (default: 128)"
165//usage: "\n -R N Pause services after N connects/min"
166//usage: "\n (default: 0 - disabled)"
167
157#include <syslog.h> 168#include <syslog.h>
158#include <sys/un.h> 169#include <sys/un.h>
159 170
diff --git a/networking/ip.c b/networking/ip.c
index 350656cef..98d583325 100644
--- a/networking/ip.c
+++ b/networking/ip.c
@@ -9,6 +9,79 @@
9 * Bernhard Reutner-Fischer rewrote to use index_in_substr_array 9 * Bernhard Reutner-Fischer rewrote to use index_in_substr_array
10 */ 10 */
11 11
12/* would need to make the " | " optional depending on more than one selected: */
13//usage:#define ip_trivial_usage
14//usage: "[OPTIONS] {"
15//usage: IF_FEATURE_IP_ADDRESS("address | ")
16//usage: IF_FEATURE_IP_ROUTE("route | ")
17//usage: IF_FEATURE_IP_LINK("link | ")
18//usage: IF_FEATURE_IP_TUNNEL("tunnel | ")
19//usage: IF_FEATURE_IP_RULE("rule")
20//usage: "} {COMMAND}"
21//usage:#define ip_full_usage "\n\n"
22//usage: "ip [OPTIONS] OBJECT {COMMAND}\n"
23//usage: "where OBJECT := {"
24//usage: IF_FEATURE_IP_ADDRESS("address | ")
25//usage: IF_FEATURE_IP_ROUTE("route | ")
26//usage: IF_FEATURE_IP_LINK("link | ")
27//usage: IF_FEATURE_IP_TUNNEL("tunnel | ")
28//usage: IF_FEATURE_IP_RULE("rule")
29//usage: "}\n"
30//usage: "OPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }"
31//usage:
32//usage:#define ipaddr_trivial_usage
33//usage: "{ {add|del} IFADDR dev STRING | {show|flush}\n"
34//usage: " [dev STRING] [to PREFIX] }"
35//usage:#define ipaddr_full_usage "\n\n"
36//usage: "ipaddr {add|delete} IFADDR dev STRING\n"
37//usage: "ipaddr {show|flush} [dev STRING] [scope SCOPE-ID]\n"
38//usage: " [to PREFIX] [label PATTERN]\n"
39//usage: " IFADDR := PREFIX | ADDR peer PREFIX\n"
40//usage: " [broadcast ADDR] [anycast ADDR]\n"
41//usage: " [label STRING] [scope SCOPE-ID]\n"
42//usage: " SCOPE-ID := [host | link | global | NUMBER]"
43//usage:
44//usage:#define iplink_trivial_usage
45//usage: "{ set DEVICE { up | down | arp { on | off } | show [DEVICE] }"
46//usage:#define iplink_full_usage "\n\n"
47//usage: "iplink set DEVICE { up | down | arp | multicast { on | off } |\n"
48//usage: " dynamic { on | off } |\n"
49//usage: " mtu MTU }\n"
50//usage: "iplink show [DEVICE]"
51//usage:
52//usage:#define iproute_trivial_usage
53//usage: "{ list | flush | { add | del | change | append |\n"
54//usage: " replace | monitor } ROUTE }"
55//usage:#define iproute_full_usage "\n\n"
56//usage: "iproute { list | flush } SELECTOR\n"
57//usage: "iproute get ADDRESS [from ADDRESS iif STRING]\n"
58//usage: " [oif STRING] [tos TOS]\n"
59//usage: "iproute { add | del | change | append | replace | monitor } ROUTE\n"
60//usage: " SELECTOR := [root PREFIX] [match PREFIX] [proto RTPROTO]\n"
61//usage: " ROUTE := [TYPE] PREFIX [tos TOS] [proto RTPROTO]\n"
62//usage: " [metric METRIC]"
63//usage:
64//usage:#define iprule_trivial_usage
65//usage: "{[list | add | del] RULE}"
66//usage:#define iprule_full_usage "\n\n"
67//usage: "iprule [list | add | del] SELECTOR ACTION\n"
68//usage: " SELECTOR := [from PREFIX] [to PREFIX] [tos TOS] [fwmark FWMARK]\n"
69//usage: " [dev STRING] [pref NUMBER]\n"
70//usage: " ACTION := [table TABLE_ID] [nat ADDRESS]\n"
71//usage: " [prohibit | reject | unreachable]\n"
72//usage: " [realms [SRCREALM/]DSTREALM]\n"
73//usage: " TABLE_ID := [local | main | default | NUMBER]"
74//usage:
75//usage:#define iptunnel_trivial_usage
76//usage: "{ add | change | del | show } [NAME]\n"
77//usage: " [mode { ipip | gre | sit }]\n"
78//usage: " [remote ADDR] [local ADDR] [ttl TTL]"
79//usage:#define iptunnel_full_usage "\n\n"
80//usage: "iptunnel { add | change | del | show } [NAME]\n"
81//usage: " [mode { ipip | gre | sit }] [remote ADDR] [local ADDR]\n"
82//usage: " [[i|o]seq] [[i|o]key KEY] [[i|o]csum]\n"
83//usage: " [ttl TTL] [tos TOS] [[no]pmtudisc] [dev PHYS_DEV]"
84
12#include "libbb.h" 85#include "libbb.h"
13 86
14#include "libiproute/utils.h" 87#include "libiproute/utils.h"
diff --git a/networking/ipcalc.c b/networking/ipcalc.c
index acbaa4ac5..f96c73912 100644
--- a/networking/ipcalc.c
+++ b/networking/ipcalc.c
@@ -11,6 +11,33 @@
11 * 11 *
12 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 12 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
13 */ 13 */
14
15//usage:#define ipcalc_trivial_usage
16//usage: "[OPTIONS] ADDRESS[[/]NETMASK] [NETMASK]"
17//usage:#define ipcalc_full_usage "\n\n"
18//usage: "Calculate IP network settings from a IP address\n"
19//usage: "\nOptions:"
20//usage: IF_FEATURE_IPCALC_LONG_OPTIONS(
21//usage: "\n -b,--broadcast Display calculated broadcast address"
22//usage: "\n -n,--network Display calculated network address"
23//usage: "\n -m,--netmask Display default netmask for IP"
24//usage: IF_FEATURE_IPCALC_FANCY(
25//usage: "\n -p,--prefix Display the prefix for IP/NETMASK"
26//usage: "\n -h,--hostname Display first resolved host name"
27//usage: "\n -s,--silent Don't ever display error messages"
28//usage: )
29//usage: )
30//usage: IF_NOT_FEATURE_IPCALC_LONG_OPTIONS(
31//usage: "\n -b Display calculated broadcast address"
32//usage: "\n -n Display calculated network address"
33//usage: "\n -m Display default netmask for IP"
34//usage: IF_FEATURE_IPCALC_FANCY(
35//usage: "\n -p Display the prefix for IP/NETMASK"
36//usage: "\n -h Display first resolved host name"
37//usage: "\n -s Don't ever display error messages"
38//usage: )
39//usage: )
40
14#include "libbb.h" 41#include "libbb.h"
15/* After libbb.h, because on some systems it needs other includes */ 42/* After libbb.h, because on some systems it needs other includes */
16#include <arpa/inet.h> 43#include <arpa/inet.h>
diff --git a/networking/isrv_identd.c b/networking/isrv_identd.c
index 18ce59aaf..199e11225 100644
--- a/networking/isrv_identd.c
+++ b/networking/isrv_identd.c
@@ -7,6 +7,17 @@
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define fakeidentd_trivial_usage
11//usage: "[-fiw] [-b ADDR] [STRING]"
12//usage:#define fakeidentd_full_usage "\n\n"
13//usage: "Provide fake ident (auth) service\n"
14//usage: "\nOptions:"
15//usage: "\n -f Run in foreground"
16//usage: "\n -i Inetd mode"
17//usage: "\n -w Inetd 'wait' mode"
18//usage: "\n -b ADDR Bind to specified address"
19//usage: "\n STRING Ident answer string (default: nobody)"
20
10#include "libbb.h" 21#include "libbb.h"
11#include <syslog.h> 22#include <syslog.h>
12#include "isrv.h" 23#include "isrv.h"
diff --git a/networking/nslookup.c b/networking/nslookup.c
index 67fc01547..f4fd407dd 100644
--- a/networking/nslookup.c
+++ b/networking/nslookup.c
@@ -11,6 +11,20 @@
11 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 11 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
12 */ 12 */
13 13
14//usage:#define nslookup_trivial_usage
15//usage: "[HOST] [SERVER]"
16//usage:#define nslookup_full_usage "\n\n"
17//usage: "Query the nameserver for the IP address of the given HOST\n"
18//usage: "optionally using a specified DNS server"
19//usage:
20//usage:#define nslookup_example_usage
21//usage: "$ nslookup localhost\n"
22//usage: "Server: default\n"
23//usage: "Address: default\n"
24//usage: "\n"
25//usage: "Name: debian\n"
26//usage: "Address: 127.0.0.1\n"
27
14#include <resolv.h> 28#include <resolv.h>
15#include "libbb.h" 29#include "libbb.h"
16 30
diff --git a/networking/ntpd.c b/networking/ntpd.c
index ba2950d8f..e27dbaa6b 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -27,6 +27,23 @@
27 * * 27 * *
28 *********************************************************************** 28 ***********************************************************************
29 */ 29 */
30
31//usage:#define ntpd_trivial_usage
32//usage: "[-dnqNw"IF_FEATURE_NTPD_SERVER("l")"] [-S PROG] [-p PEER]..."
33//usage:#define ntpd_full_usage "\n\n"
34//usage: "NTP client/server\n"
35//usage: "\nOptions:"
36//usage: "\n -d Verbose"
37//usage: "\n -n Do not daemonize"
38//usage: "\n -q Quit after clock is set"
39//usage: "\n -N Run at high priority"
40//usage: "\n -w Do not set time (only query peers), implies -n"
41//usage: IF_FEATURE_NTPD_SERVER(
42//usage: "\n -l Run as server on port 123"
43//usage: )
44//usage: "\n -S PROG Run PROG after stepping time, stratum change, and every 11 mins"
45//usage: "\n -p PEER Obtain time from PEER (may be repeated)"
46
30#include "libbb.h" 47#include "libbb.h"
31#include <math.h> 48#include <math.h>
32#include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */ 49#include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */
diff --git a/networking/pscan.c b/networking/pscan.c
index a9e5d5c29..5595148fc 100644
--- a/networking/pscan.c
+++ b/networking/pscan.c
@@ -6,6 +6,18 @@
6 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 6 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
7 */ 7 */
8 8
9//usage:#define pscan_trivial_usage
10//usage: "[-cb] [-p MIN_PORT] [-P MAX_PORT] [-t TIMEOUT] [-T MIN_RTT] HOST"
11//usage:#define pscan_full_usage "\n\n"
12//usage: "Scan a host, print all open ports\n"
13//usage: "\nOptions:"
14//usage: "\n -c Show closed ports too"
15//usage: "\n -b Show blocked ports too"
16//usage: "\n -p Scan from this port (default 1)"
17//usage: "\n -P Scan up to this port (default 1024)"
18//usage: "\n -t Timeout (default 5000 ms)"
19//usage: "\n -T Minimum rtt (default 5 ms, increase for congested hosts)"
20
9#include "libbb.h" 21#include "libbb.h"
10 22
11/* debugging */ 23/* debugging */
diff --git a/networking/route.c b/networking/route.c
index 98a03ded7..6699a1c32 100644
--- a/networking/route.c
+++ b/networking/route.c
@@ -25,6 +25,15 @@
25 * remove ridiculous amounts of bloat. 25 * remove ridiculous amounts of bloat.
26 */ 26 */
27 27
28//usage:#define route_trivial_usage
29//usage: "[{add|del|delete}]"
30//usage:#define route_full_usage "\n\n"
31//usage: "Edit kernel routing tables\n"
32//usage: "\nOptions:"
33//usage: "\n -n Don't resolve names"
34//usage: "\n -e Display other/more information"
35//usage: "\n -A inet" IF_FEATURE_IPV6("{6}") " Select address family"
36
28#include <net/route.h> 37#include <net/route.h>
29#include <net/if.h> 38#include <net/if.h>
30 39
diff --git a/networking/slattach.c b/networking/slattach.c
index 71edd2f27..d1221b11a 100644
--- a/networking/slattach.c
+++ b/networking/slattach.c
@@ -13,6 +13,20 @@
13 * - The -F options allows disabling of RTS/CTS flow control. 13 * - The -F options allows disabling of RTS/CTS flow control.
14 */ 14 */
15 15
16//usage:#define slattach_trivial_usage
17//usage: "[-cehmLF] [-s SPEED] [-p PROTOCOL] DEVICE"
18//usage:#define slattach_full_usage "\n\n"
19//usage: "Attach network interface(s) to serial line(s)\n"
20//usage: "\nOptions:"
21//usage: "\n -p PROT Set protocol (slip, cslip, slip6, clisp6 or adaptive)"
22//usage: "\n -s SPD Set line speed"
23//usage: "\n -e Exit after initializing device"
24//usage: "\n -h Exit when the carrier is lost"
25//usage: "\n -c PROG Run PROG when the line is hung up"
26//usage: "\n -m Do NOT initialize the line in raw 8 bits mode"
27//usage: "\n -L Enable 3-wire operation"
28//usage: "\n -F Disable RTS/CTS flow control"
29
16#include "libbb.h" 30#include "libbb.h"
17#include "libiproute/utils.h" /* invarg() */ 31#include "libiproute/utils.h" /* invarg() */
18 32
diff --git a/networking/tc.c b/networking/tc.c
index 9b3245546..e9848a86b 100644
--- a/networking/tc.c
+++ b/networking/tc.c
@@ -7,6 +7,27 @@
7 * Bernhard Reutner-Fischer adjusted for busybox 7 * Bernhard Reutner-Fischer adjusted for busybox
8 */ 8 */
9 9
10//usage:#define tc_trivial_usage
11/* //usage: "[OPTIONS] OBJECT CMD [dev STRING]" */
12//usage: "OBJECT CMD [dev STRING]"
13//usage:#define tc_full_usage "\n\n"
14//usage: "OBJECT: {qdisc|class|filter}\n"
15//usage: "CMD: {add|del|change|replace|show}\n"
16//usage: "\n"
17//usage: "qdisc [ handle QHANDLE ] [ root |"IF_FEATURE_TC_INGRESS(" ingress |")" parent CLASSID ]\n"
18/* //usage: "[ estimator INTERVAL TIME_CONSTANT ]\n" */
19//usage: " [ [ QDISC_KIND ] [ help | OPTIONS ] ]\n"
20//usage: " QDISC_KIND := { [p|b]fifo | tbf | prio | cbq | red | etc. }\n"
21//usage: "qdisc show [ dev STRING ]"IF_FEATURE_TC_INGRESS(" [ingress]")"\n"
22//usage: "class [ classid CLASSID ] [ root | parent CLASSID ]\n"
23//usage: " [ [ QDISC_KIND ] [ help | OPTIONS ] ]\n"
24//usage: "class show [ dev STRING ] [ root | parent CLASSID ]\n"
25//usage: "filter [ pref PRIO ] [ protocol PROTO ]\n"
26/* //usage: "\t[ estimator INTERVAL TIME_CONSTANT ]\n" */
27//usage: " [ root | classid CLASSID ] [ handle FILTERID ]\n"
28//usage: " [ [ FILTER_TYPE ] [ help | OPTIONS ] ]\n"
29//usage: "filter show [ dev STRING ] [ root | parent CLASSID ]"
30
10#include "libbb.h" 31#include "libbb.h"
11 32
12#include "libiproute/utils.h" 33#include "libiproute/utils.h"
diff --git a/networking/tcpudp.c b/networking/tcpudp.c
index 3ff2acbf8..a2b8c958c 100644
--- a/networking/tcpudp.c
+++ b/networking/tcpudp.c
@@ -29,6 +29,43 @@
29 * - don't know how to retrieve ORIGDST for udp. 29 * - don't know how to retrieve ORIGDST for udp.
30 */ 30 */
31 31
32//usage:#define tcpsvd_trivial_usage
33//usage: "[-hEv] [-c N] [-C N[:MSG]] [-b N] [-u USER] [-l NAME] IP PORT PROG"
34/* with not-implemented options: */
35/* //usage: "[-hpEvv] [-c N] [-C N[:MSG]] [-b N] [-u USER] [-l NAME] [-i DIR|-x CDB] [-t SEC] IP PORT PROG" */
36//usage:#define tcpsvd_full_usage "\n\n"
37//usage: "Create TCP socket, bind to IP:PORT and listen\n"
38//usage: "for incoming connection. Run PROG for each connection.\n"
39//usage: "\n IP IP to listen on. '0' = all"
40//usage: "\n PORT Port to listen on"
41//usage: "\n PROG ARGS Program to run"
42//usage: "\n -l NAME Local hostname (else looks up local hostname in DNS)"
43//usage: "\n -u USER[:GRP] Change to user/group after bind"
44//usage: "\n -c N Handle up to N connections simultaneously"
45//usage: "\n -b N Allow a backlog of approximately N TCP SYNs"
46//usage: "\n -C N[:MSG] Allow only up to N connections from the same IP."
47//usage: "\n New connections from this IP address are closed"
48//usage: "\n immediately. MSG is written to the peer before close"
49//usage: "\n -h Look up peer's hostname"
50//usage: "\n -E Don't set up environment variables"
51//usage: "\n -v Verbose"
52//usage:
53//usage:#define udpsvd_trivial_usage
54//usage: "[-hEv] [-c N] [-u USER] [-l NAME] IP PORT PROG"
55//usage:#define udpsvd_full_usage "\n\n"
56//usage: "Create UDP socket, bind to IP:PORT and wait\n"
57//usage: "for incoming packets. Run PROG for each packet,\n"
58//usage: "redirecting all further packets with same peer ip:port to it.\n"
59//usage: "\n IP IP to listen on. '0' = all"
60//usage: "\n PORT Port to listen on"
61//usage: "\n PROG ARGS Program to run"
62//usage: "\n -l NAME Local hostname (else looks up local hostname in DNS)"
63//usage: "\n -u USER[:GRP] Change to user/group after bind"
64//usage: "\n -c N Handle up to N connections simultaneously"
65//usage: "\n -h Look up peer's hostname"
66//usage: "\n -E Don't set up environment variables"
67//usage: "\n -v Verbose"
68
32#include "libbb.h" 69#include "libbb.h"
33 70
34/* Wants <limits.h> etc, thus included after libbb.h: */ 71/* Wants <limits.h> etc, thus included after libbb.h: */
diff --git a/networking/telnet.c b/networking/telnet.c
index f6fad684c..1f0d85107 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -21,6 +21,22 @@
21 * 21 *
22 */ 22 */
23 23
24//usage:#if ENABLE_FEATURE_TELNET_AUTOLOGIN
25//usage:#define telnet_trivial_usage
26//usage: "[-a] [-l USER] HOST [PORT]"
27//usage:#define telnet_full_usage "\n\n"
28//usage: "Connect to telnet server\n"
29//usage: "\nOptions:"
30//usage: "\n -a Automatic login with $USER variable"
31//usage: "\n -l USER Automatic login as USER"
32//usage:
33//usage:#else
34//usage:#define telnet_trivial_usage
35//usage: "HOST [PORT]"
36//usage:#define telnet_full_usage "\n\n"
37//usage: "Connect to telnet server"
38//usage:#endif
39
24#include <arpa/telnet.h> 40#include <arpa/telnet.h>
25#include <netinet/in.h> 41#include <netinet/in.h>
26#include "libbb.h" 42#include "libbb.h"
diff --git a/networking/telnetd.c b/networking/telnetd.c
index eec4417ca..4404064fc 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -20,6 +20,28 @@
20 * Vladimir Oleynik <dzo@simtreas.ru> 2001 20 * Vladimir Oleynik <dzo@simtreas.ru> 2001
21 * Set process group corrections, initial busybox port 21 * Set process group corrections, initial busybox port
22 */ 22 */
23
24//usage:#define telnetd_trivial_usage
25//usage: "[OPTIONS]"
26//usage:#define telnetd_full_usage "\n\n"
27//usage: "Handle incoming telnet connections"
28//usage: IF_NOT_FEATURE_TELNETD_STANDALONE(" via inetd") "\n"
29//usage: "\nOptions:"
30//usage: "\n -l LOGIN Exec LOGIN on connect"
31//usage: "\n -f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue"
32//usage: "\n -K Close connection as soon as login exits"
33//usage: "\n (normally wait until all programs close slave pty)"
34//usage: IF_FEATURE_TELNETD_STANDALONE(
35//usage: "\n -p PORT Port to listen on"
36//usage: "\n -b ADDR[:PORT] Address to bind to"
37//usage: "\n -F Run in foreground"
38//usage: "\n -i Inetd mode"
39//usage: IF_FEATURE_TELNETD_INETD_WAIT(
40//usage: "\n -w SEC Inetd 'wait' mode, linger time SEC"
41//usage: "\n -S Log to syslog (implied by -i or without -F and -w)"
42//usage: )
43//usage: )
44
23#define DEBUG 0 45#define DEBUG 0
24 46
25#include "libbb.h" 47#include "libbb.h"
diff --git a/networking/tftp.c b/networking/tftp.c
index 35cf0dbd9..f52e49d51 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -18,6 +18,39 @@
18 * 18 *
19 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 19 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
20 */ 20 */
21
22//usage:#define tftp_trivial_usage
23//usage: "[OPTIONS] HOST [PORT]"
24//usage:#define tftp_full_usage "\n\n"
25//usage: "Transfer a file from/to tftp server\n"
26//usage: "\nOptions:"
27//usage: "\n -l FILE Local FILE"
28//usage: "\n -r FILE Remote FILE"
29//usage: IF_FEATURE_TFTP_GET(
30//usage: "\n -g Get file"
31//usage: )
32//usage: IF_FEATURE_TFTP_PUT(
33//usage: "\n -p Put file"
34//usage: )
35//usage: IF_FEATURE_TFTP_BLOCKSIZE(
36//usage: "\n -b SIZE Transfer blocks of SIZE octets"
37//usage: )
38//usage:
39//usage:#define tftpd_trivial_usage
40//usage: "[-cr] [-u USER] [DIR]"
41//usage:#define tftpd_full_usage "\n\n"
42//usage: "Transfer a file on tftp client's request\n"
43//usage: "\n"
44//usage: "tftpd should be used as an inetd service.\n"
45//usage: "tftpd's line for inetd.conf:\n"
46//usage: " 69 dgram udp nowait root tftpd tftpd /files/to/serve\n"
47//usage: "It also can be ran from udpsvd:\n"
48//usage: " udpsvd -vE 0.0.0.0 69 tftpd /files/to/serve\n"
49//usage: "\nOptions:"
50//usage: "\n -r Prohibit upload"
51//usage: "\n -c Allow file creation via upload"
52//usage: "\n -u Access files as USER"
53
21#include "libbb.h" 54#include "libbb.h"
22 55
23#if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT 56#if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT
diff --git a/networking/traceroute.c b/networking/traceroute.c
index 55dc15b66..96f9d3472 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -210,6 +210,51 @@
210 * Tue Dec 20 03:50:13 PST 1988 210 * Tue Dec 20 03:50:13 PST 1988
211 */ 211 */
212 212
213//usage:#define traceroute_trivial_usage
214//usage: "[-"IF_TRACEROUTE6("46")"FIldnrv] [-f 1ST_TTL] [-m MAXTTL] [-p PORT] [-q PROBES]\n"
215//usage: " [-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-g GATEWAY] [-i IFACE]\n"
216//usage: " [-z PAUSE_MSEC] HOST [BYTES]"
217//usage:#define traceroute_full_usage "\n\n"
218//usage: "Trace the route to HOST\n"
219//usage: "\nOptions:"
220//usage: IF_TRACEROUTE6(
221//usage: "\n -4,-6 Force IP or IPv6 name resolution"
222//usage: )
223//usage: "\n -F Set the don't fragment bit"
224//usage: "\n -I Use ICMP ECHO instead of UDP datagrams"
225//usage: "\n -l Display the TTL value of the returned packet"
226//usage: "\n -d Set SO_DEBUG options to socket"
227//usage: "\n -n Print numeric addresses"
228//usage: "\n -r Bypass routing tables, send directly to HOST"
229//usage: "\n -v Verbose"
230//usage: "\n -m Max time-to-live (max number of hops)"
231//usage: "\n -p Base UDP port number used in probes"
232//usage: "\n (default 33434)"
233//usage: "\n -q Number of probes per TTL (default 3)"
234//usage: "\n -s IP address to use as the source address"
235//usage: "\n -t Type-of-service in probe packets (default 0)"
236//usage: "\n -w Time in seconds to wait for a response (default 3)"
237//usage: "\n -g Loose source route gateway (8 max)"
238//usage:
239//usage:#define traceroute6_trivial_usage
240//usage: "[-dnrv] [-m MAXTTL] [-p PORT] [-q PROBES]\n"
241//usage: " [-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-i IFACE]\n"
242//usage: " HOST [BYTES]"
243//usage:#define traceroute6_full_usage "\n\n"
244//usage: "Trace the route to HOST\n"
245//usage: "\nOptions:"
246//usage: "\n -d Set SO_DEBUG options to socket"
247//usage: "\n -n Print numeric addresses"
248//usage: "\n -r Bypass routing tables, send directly to HOST"
249//usage: "\n -v Verbose"
250//usage: "\n -m Max time-to-live (max number of hops)"
251//usage: "\n -p Base UDP port number used in probes"
252//usage: "\n (default is 33434)"
253//usage: "\n -q Number of probes per TTL (default 3)"
254//usage: "\n -s IP address to use as the source address"
255//usage: "\n -t Type-of-service in probe packets (default 0)"
256//usage: "\n -w Time in seconds to wait for a response (default 3)"
257
213#define TRACEROUTE_SO_DEBUG 0 258#define TRACEROUTE_SO_DEBUG 0
214 259
215/* TODO: undefs were uncommented - ??! we have config system for that! */ 260/* TODO: undefs were uncommented - ??! we have config system for that! */
diff --git a/networking/tunctl.c b/networking/tunctl.c
index e17a9db64..8cb733b68 100644
--- a/networking/tunctl.c
+++ b/networking/tunctl.c
@@ -9,6 +9,25 @@
9 * 9 *
10 * Licensed under GPLv2, see file LICENSE in this source tree. 10 * Licensed under GPLv2, see file LICENSE in this source tree.
11 */ 11 */
12
13//usage:#define tunctl_trivial_usage
14//usage: "[-f device] ([-t name] | -d name)" IF_FEATURE_TUNCTL_UG(" [-u owner] [-g group] [-b]")
15//usage:#define tunctl_full_usage "\n\n"
16//usage: "Create or delete tun interfaces\n"
17//usage: "\nOptions:"
18//usage: "\n -f name tun device (/dev/net/tun)"
19//usage: "\n -t name Create iface 'name'"
20//usage: "\n -d name Delete iface 'name'"
21//usage: IF_FEATURE_TUNCTL_UG(
22//usage: "\n -u owner Set iface owner"
23//usage: "\n -g group Set iface group"
24//usage: "\n -b Brief output"
25//usage: )
26//usage:
27//usage:#define tunctl_example_usage
28//usage: "# tunctl\n"
29//usage: "# tunctl -d tun0\n"
30
12#include <netinet/in.h> 31#include <netinet/in.h>
13#include <net/if.h> 32#include <net/if.h>
14#include <linux/if_tun.h> 33#include <linux/if_tun.h>
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index 6fb48a19a..747472d0c 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -20,6 +20,17 @@
20 * along with this program; if not, write to the Free Software 20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */ 22 */
23
24//usage:#define udhcpd_trivial_usage
25//usage: "[-fS]" IF_FEATURE_UDHCP_PORT(" [-P N]") " [CONFFILE]"
26//usage:#define udhcpd_full_usage "\n\n"
27//usage: "DHCP server\n"
28//usage: "\n -f Run in foreground"
29//usage: "\n -S Log to syslog too"
30//usage: IF_FEATURE_UDHCP_PORT(
31//usage: "\n -P N Use port N (default 67)"
32//usage: )
33
23#include <syslog.h> 34#include <syslog.h>
24#include "common.h" 35#include "common.h"
25#include "dhcpc.h" 36#include "dhcpc.h"
diff --git a/networking/udhcp/dhcprelay.c b/networking/udhcp/dhcprelay.c
index 86ef04a62..f82ac05b4 100644
--- a/networking/udhcp/dhcprelay.c
+++ b/networking/udhcp/dhcprelay.c
@@ -9,6 +9,12 @@
9 * Netbeat AG 9 * Netbeat AG
10 * Upstream has GPL v2 or later 10 * Upstream has GPL v2 or later
11 */ 11 */
12
13//usage:#define dhcprelay_trivial_usage
14//usage: "CLIENT_IFACE[,CLIENT_IFACE2]... SERVER_IFACE [SERVER_IP]"
15//usage:#define dhcprelay_full_usage "\n\n"
16//usage: "Relay DHCP requests between clients and server"
17
12#include "common.h" 18#include "common.h"
13 19
14#define SERVER_PORT 67 20#define SERVER_PORT 67
diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c
index 21d62a2d2..ec07192c1 100644
--- a/networking/udhcp/dumpleases.c
+++ b/networking/udhcp/dumpleases.c
@@ -2,6 +2,23 @@
2/* 2/*
3 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 3 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
4 */ 4 */
5
6//usage:#define dumpleases_trivial_usage
7//usage: "[-r|-a] [-f LEASEFILE]"
8//usage:#define dumpleases_full_usage "\n\n"
9//usage: "Display DHCP leases granted by udhcpd\n"
10//usage: "\nOptions:"
11//usage: IF_LONG_OPTS(
12//usage: "\n -f,--file=FILE Lease file"
13//usage: "\n -r,--remaining Show remaining time"
14//usage: "\n -a,--absolute Show expiration time"
15//usage: )
16//usage: IF_NOT_LONG_OPTS(
17//usage: "\n -f FILE Lease file"
18//usage: "\n -r Show remaining time"
19//usage: "\n -a Show expiration time"
20//usage: )
21
5#include "common.h" 22#include "common.h"
6#include "dhcpd.h" 23#include "dhcpd.h"
7#include "unicode.h" 24#include "unicode.h"
diff --git a/networking/vconfig.c b/networking/vconfig.c
index 13c65ad78..4fa341ac3 100644
--- a/networking/vconfig.c
+++ b/networking/vconfig.c
@@ -9,6 +9,18 @@
9 9
10/* BB_AUDIT SUSv3 N/A */ 10/* BB_AUDIT SUSv3 N/A */
11 11
12//usage:#define vconfig_trivial_usage
13//usage: "COMMAND [OPTIONS]"
14//usage:#define vconfig_full_usage "\n\n"
15//usage: "Create and remove virtual ethernet devices\n"
16//usage: "\nOptions:"
17//usage: "\n add [interface-name] [vlan_id]"
18//usage: "\n rem [vlan-name]"
19//usage: "\n set_flag [interface-name] [flag-num] [0 | 1]"
20//usage: "\n set_egress_map [vlan-name] [skb_priority] [vlan_qos]"
21//usage: "\n set_ingress_map [vlan-name] [skb_priority] [vlan_qos]"
22//usage: "\n set_name_type [name-type]"
23
12#include "libbb.h" 24#include "libbb.h"
13#include <net/if.h> 25#include <net/if.h>
14 26
diff --git a/networking/zcip.c b/networking/zcip.c
index 6fa265ad4..7250fb2fd 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -23,6 +23,19 @@
23// - avoid silent script failures, especially under load... 23// - avoid silent script failures, especially under load...
24// - link status monitoring (restart on link-up; stop on link-down) 24// - link status monitoring (restart on link-up; stop on link-down)
25 25
26//usage:#define zcip_trivial_usage
27//usage: "[OPTIONS] IFACE SCRIPT"
28//usage:#define zcip_full_usage "\n\n"
29//usage: "Manage a ZeroConf IPv4 link-local address\n"
30//usage: "\nOptions:"
31//usage: "\n -f Run in foreground"
32//usage: "\n -q Quit after obtaining address"
33//usage: "\n -r 169.254.x.x Request this address first"
34//usage: "\n -v Verbose"
35//usage: "\n"
36//usage: "\nWith no -q, runs continuously monitoring for ARP conflicts,"
37//usage: "\nexits only on I/O errors (link down etc)"
38
26#include <netinet/ether.h> 39#include <netinet/ether.h>
27#include <net/ethernet.h> 40#include <net/ethernet.h>
28#include <net/if.h> 41#include <net/if.h>
diff --git a/printutils/lpd.c b/printutils/lpd.c
index 157cbe8ae..115552e0b 100644
--- a/printutils/lpd.c
+++ b/printutils/lpd.c
@@ -70,6 +70,17 @@
70 * mv -f ./"$DATAFILE" save/ 70 * mv -f ./"$DATAFILE" save/
71 */ 71 */
72 72
73//usage:#define lpd_trivial_usage
74//usage: "SPOOLDIR [HELPER [ARGS]]"
75//usage:#define lpd_full_usage "\n\n"
76//usage: "SPOOLDIR must contain (symlinks to) device nodes or directories"
77//usage: "\nwith names matching print queue names. In the first case, jobs are"
78//usage: "\nsent directly to the device. Otherwise each job is stored in queue"
79//usage: "\ndirectory and HELPER program is called. Name of file to print"
80//usage: "\nis passed in $DATAFILE variable."
81//usage: "\nExample:"
82//usage: "\n tcpsvd -E 0 515 softlimit -m 999999 lpd /var/spool ./print"
83
73#include "libbb.h" 84#include "libbb.h"
74 85
75// strip argument of bad chars 86// strip argument of bad chars
diff --git a/printutils/lpr.c b/printutils/lpr.c
index 284917926..f8ee9a11b 100644
--- a/printutils/lpr.c
+++ b/printutils/lpr.c
@@ -11,6 +11,27 @@
11 * 11 *
12 * See RFC 1179 for protocol description. 12 * See RFC 1179 for protocol description.
13 */ 13 */
14
15//usage:#define lpr_trivial_usage
16//usage: "-P queue[@host[:port]] -U USERNAME -J TITLE -Vmh [FILE]..."
17/* -C CLASS exists too, not shown.
18 * CLASS is supposed to be printed on banner page, if one is requested */
19//usage:#define lpr_full_usage "\n\n"
20//usage: "Options:"
21//usage: "\n -P lp service to connect to (else uses $PRINTER)"
22//usage: "\n -m Send mail on completion"
23//usage: "\n -h Print banner page too"
24//usage: "\n -V Verbose"
25//usage:
26//usage:#define lpq_trivial_usage
27//usage: "[-P queue[@host[:port]]] [-U USERNAME] [-d JOBID]... [-fs]"
28//usage:#define lpq_full_usage "\n\n"
29//usage: "Options:"
30//usage: "\n -P lp service to connect to (else uses $PRINTER)"
31//usage: "\n -d Delete jobs"
32//usage: "\n -f Force any waiting job to be printed"
33//usage: "\n -s Short display"
34
14#include "libbb.h" 35#include "libbb.h"
15 36
16/* 37/*
diff --git a/procps/free.c b/procps/free.c
index ad8711f8a..ca753134c 100644
--- a/procps/free.c
+++ b/procps/free.c
@@ -9,6 +9,18 @@
9 9
10/* getopt not needed */ 10/* getopt not needed */
11 11
12//usage:#define free_trivial_usage
13//usage: "" IF_DESKTOP("[-b/k/m/g]")
14//usage:#define free_full_usage "\n\n"
15//usage: "Display the amount of free and used system memory"
16//usage:
17//usage:#define free_example_usage
18//usage: "$ free\n"
19//usage: " total used free shared buffers\n"
20//usage: " Mem: 257628 248724 8904 59644 93124\n"
21//usage: " Swap: 128516 8404 120112\n"
22//usage: "Total: 386144 257128 129016\n"
23
12#include "libbb.h" 24#include "libbb.h"
13 25
14struct globals { 26struct globals {
diff --git a/procps/fuser.c b/procps/fuser.c
index a1b93d77f..7837ff883 100644
--- a/procps/fuser.c
+++ b/procps/fuser.c
@@ -7,6 +7,17 @@
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define fuser_trivial_usage
11//usage: "[OPTIONS] FILE or PORT/PROTO"
12//usage:#define fuser_full_usage "\n\n"
13//usage: "Find processes which use FILEs or PORTs\n"
14//usage: "\nOptions:"
15//usage: "\n -m Find processes which use same fs as FILEs"
16//usage: "\n -4,-6 Search only IPv4/IPv6 space"
17//usage: "\n -s Don't display PIDs"
18//usage: "\n -k Kill found processes"
19//usage: "\n -SIGNAL Signal to send (default: KILL)"
20
10#include "libbb.h" 21#include "libbb.h"
11 22
12#define MAX_LINE 255 23#define MAX_LINE 255
diff --git a/procps/kill.c b/procps/kill.c
index 695d266c5..6776d9546 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -8,6 +8,45 @@
8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11//usage:#define kill_trivial_usage
12//usage: "[-l] [-SIG] PID..."
13//usage:#define kill_full_usage "\n\n"
14//usage: "Send a signal (default: TERM) to given PIDs\n"
15//usage: "\nOptions:"
16//usage: "\n -l List all signal names and numbers"
17/* //usage: "\n -s SIG Yet another way of specifying SIG" */
18//usage:
19//usage:#define kill_example_usage
20//usage: "$ ps | grep apache\n"
21//usage: "252 root root S [apache]\n"
22//usage: "263 www-data www-data S [apache]\n"
23//usage: "264 www-data www-data S [apache]\n"
24//usage: "265 www-data www-data S [apache]\n"
25//usage: "266 www-data www-data S [apache]\n"
26//usage: "267 www-data www-data S [apache]\n"
27//usage: "$ kill 252\n"
28//usage:
29//usage:#define killall_trivial_usage
30//usage: "[-l] [-q] [-SIG] PROCESS_NAME..."
31//usage:#define killall_full_usage "\n\n"
32//usage: "Send a signal (default: TERM) to given processes\n"
33//usage: "\nOptions:"
34//usage: "\n -l List all signal names and numbers"
35/* //usage: "\n -s SIG Yet another way of specifying SIG" */
36//usage: "\n -q Don't complain if no processes were killed"
37//usage:
38//usage:#define killall_example_usage
39//usage: "$ killall apache\n"
40//usage:
41//usage:#define killall5_trivial_usage
42//usage: "[-l] [-SIG] [-o PID]..."
43//usage:#define killall5_full_usage "\n\n"
44//usage: "Send a signal (default: TERM) to all processes outside current session\n"
45//usage: "\nOptions:"
46//usage: "\n -l List all signal names and numbers"
47//usage: "\n -o PID Don't signal this PID"
48/* //usage: "\n -s SIG Yet another way of specifying SIG" */
49
11#include "libbb.h" 50#include "libbb.h"
12 51
13/* Note: kill_main is directly called from shell in order to implement 52/* Note: kill_main is directly called from shell in order to implement
diff --git a/procps/pgrep.c b/procps/pgrep.c
index 5d388a87d..902a3a75e 100644
--- a/procps/pgrep.c
+++ b/procps/pgrep.c
@@ -6,6 +6,35 @@
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9
10//usage:#define pgrep_trivial_usage
11//usage: "[-flnovx] [-s SID|-P PPID|PATTERN]"
12//usage:#define pgrep_full_usage "\n\n"
13//usage: "Display process(es) selected by regex PATTERN\n"
14//usage: "\nOptions:"
15//usage: "\n -l Show command name too"
16//usage: "\n -f Match against entire command line"
17//usage: "\n -n Show the newest process only"
18//usage: "\n -o Show the oldest process only"
19//usage: "\n -v Negate the match"
20//usage: "\n -x Match whole name (not substring)"
21//usage: "\n -s Match session ID (0 for current)"
22//usage: "\n -P Match parent process ID"
23//usage:
24//usage:#define pkill_trivial_usage
25//usage: "[-l|-SIGNAL] [-fnovx] [-s SID|-P PPID|PATTERN]"
26//usage:#define pkill_full_usage "\n\n"
27//usage: "Send a signal to process(es) selected by regex PATTERN\n"
28//usage: "\nOptions:"
29//usage: "\n -l List all signals"
30//usage: "\n -f Match against entire command line"
31//usage: "\n -n Signal the newest process only"
32//usage: "\n -o Signal the oldest process only"
33//usage: "\n -v Negate the match"
34//usage: "\n -x Match whole name (not substring)"
35//usage: "\n -s Match session ID (0 for current)"
36//usage: "\n -P Match parent process ID"
37
9#include "libbb.h" 38#include "libbb.h"
10#include "xregex.h" 39#include "xregex.h"
11 40
diff --git a/procps/pidof.c b/procps/pidof.c
index 49e469ca5..e102a31c6 100644
--- a/procps/pidof.c
+++ b/procps/pidof.c
@@ -7,6 +7,34 @@
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#if (ENABLE_FEATURE_PIDOF_SINGLE || ENABLE_FEATURE_PIDOF_OMIT)
11//usage:#define pidof_trivial_usage
12//usage: "[OPTIONS] [NAME]..."
13//usage:#define USAGE_PIDOF "\n\nOptions:"
14//usage:#else
15//usage:#define pidof_trivial_usage
16//usage: "[NAME]..."
17//usage:#define USAGE_PIDOF /* none */
18//usage:#endif
19//usage:#define pidof_full_usage "\n\n"
20//usage: "List PIDs of all processes with names that match NAMEs"
21//usage: USAGE_PIDOF
22//usage: IF_FEATURE_PIDOF_SINGLE(
23//usage: "\n -s Show only one PID"
24//usage: )
25//usage: IF_FEATURE_PIDOF_OMIT(
26//usage: "\n -o PID Omit given pid"
27//usage: "\n Use %PPID to omit pid of pidof's parent"
28//usage: )
29//usage:
30//usage:#define pidof_example_usage
31//usage: "$ pidof init\n"
32//usage: "1\n"
33//usage: IF_FEATURE_PIDOF_OMIT(
34//usage: "$ pidof /bin/sh\n20351 5973 5950\n")
35//usage: IF_FEATURE_PIDOF_OMIT(
36//usage: "$ pidof /bin/sh -o %PPID\n20351 5950")
37
10#include "libbb.h" 38#include "libbb.h"
11 39
12enum { 40enum {
diff --git a/procps/ps.c b/procps/ps.c
index 6945780ec..7f273d0a6 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -9,6 +9,53 @@
9 * Licensed under GPLv2, see file LICENSE in this source tree. 9 * Licensed under GPLv2, see file LICENSE in this source tree.
10 */ 10 */
11 11
12//usage:#if ENABLE_DESKTOP
13//usage:
14//usage:#define ps_trivial_usage
15//usage: "[-o COL1,COL2=HEADER]" IF_FEATURE_SHOW_THREADS(" [-T]")
16//usage:#define ps_full_usage "\n\n"
17//usage: "Show list of processes\n"
18//usage: "\nOptions:"
19//usage: "\n -o COL1,COL2=HEADER Select columns for display"
20//usage: IF_FEATURE_SHOW_THREADS(
21//usage: "\n -T Show threads"
22//usage: )
23//usage:
24//usage:#else /* !ENABLE_DESKTOP */
25//usage:
26//usage:#if !ENABLE_SELINUX && !ENABLE_FEATURE_PS_WIDE
27//usage:#define USAGE_PS "\nThis version of ps accepts no options"
28//usage:#else
29//usage:#define USAGE_PS "\nOptions:"
30//usage:#endif
31//usage:
32//usage:#define ps_trivial_usage
33//usage: ""
34//usage:#define ps_full_usage "\n\n"
35//usage: "Show list of processes\n"
36//usage: USAGE_PS
37//usage: IF_SELINUX(
38//usage: "\n -Z Show selinux context"
39//usage: )
40//usage: IF_FEATURE_PS_WIDE(
41//usage: "\n w Wide output"
42//usage: )
43//usage:
44//usage:#endif /* ENABLE_DESKTOP */
45//usage:
46//usage:#define ps_example_usage
47//usage: "$ ps\n"
48//usage: " PID Uid Gid State Command\n"
49//usage: " 1 root root S init\n"
50//usage: " 2 root root S [kflushd]\n"
51//usage: " 3 root root S [kupdate]\n"
52//usage: " 4 root root S [kpiod]\n"
53//usage: " 5 root root S [kswapd]\n"
54//usage: " 742 andersen andersen S [bash]\n"
55//usage: " 743 andersen andersen S -bash\n"
56//usage: " 745 root root S [getty]\n"
57//usage: " 2990 andersen andersen R ps\n"
58
12#include "libbb.h" 59#include "libbb.h"
13 60
14/* Absolute maximum on output line length */ 61/* Absolute maximum on output line length */
diff --git a/procps/renice.c b/procps/renice.c
index 59194b5f4..067c8f75a 100644
--- a/procps/renice.c
+++ b/procps/renice.c
@@ -19,6 +19,16 @@
19 * following IDs (if any). Multiple switches are allowed. 19 * following IDs (if any). Multiple switches are allowed.
20 */ 20 */
21 21
22//usage:#define renice_trivial_usage
23//usage: "{{-n INCREMENT} | PRIORITY} [[-p | -g | -u] ID...]"
24//usage:#define renice_full_usage "\n\n"
25//usage: "Change scheduling priority for a running process\n"
26//usage: "\nOptions:"
27//usage: "\n -n Adjust current nice value (smaller is faster)"
28//usage: "\n -p Process id(s) (default)"
29//usage: "\n -g Process group id(s)"
30//usage: "\n -u Process user name(s) and/or id(s)"
31
22#include "libbb.h" 32#include "libbb.h"
23#include <sys/resource.h> 33#include <sys/resource.h>
24 34
diff --git a/procps/sysctl.c b/procps/sysctl.c
index aba966e7f..f36548f87 100644
--- a/procps/sysctl.c
+++ b/procps/sysctl.c
@@ -11,6 +11,25 @@
11 * v1.01.1 - busybox applet aware by <solar@gentoo.org> 11 * v1.01.1 - busybox applet aware by <solar@gentoo.org>
12 */ 12 */
13 13
14//usage:#define sysctl_trivial_usage
15//usage: "[OPTIONS] [VALUE]..."
16//usage:#define sysctl_full_usage "\n\n"
17//usage: "Configure kernel parameters at runtime\n"
18//usage: "\nOptions:"
19//usage: "\n -n Don't print key names"
20//usage: "\n -e Don't warn about unknown keys"
21//usage: "\n -w Change sysctl setting"
22//usage: "\n -p FILE Load sysctl settings from FILE (default /etc/sysctl.conf)"
23//usage: "\n -a Display all values"
24//usage: "\n -A Display all values in table form"
25//usage:
26//usage:#define sysctl_example_usage
27//usage: "sysctl [-n] [-e] variable...\n"
28//usage: "sysctl [-n] [-e] -w variable=value...\n"
29//usage: "sysctl [-n] [-e] -a\n"
30//usage: "sysctl [-n] [-e] -p file (default /etc/sysctl.conf)\n"
31//usage: "sysctl [-n] [-e] -A\n"
32
14#include "libbb.h" 33#include "libbb.h"
15 34
16enum { 35enum {
diff --git a/procps/uptime.c b/procps/uptime.c
index 5c48795bf..1a7da46a3 100644
--- a/procps/uptime.c
+++ b/procps/uptime.c
@@ -15,6 +15,15 @@
15 15
16/* getopt not needed */ 16/* getopt not needed */
17 17
18//usage:#define uptime_trivial_usage
19//usage: ""
20//usage:#define uptime_full_usage "\n\n"
21//usage: "Display the time since the last boot"
22//usage:
23//usage:#define uptime_example_usage
24//usage: "$ uptime\n"
25//usage: " 1:55pm up 2:30, load average: 0.09, 0.04, 0.00\n"
26
18#include "libbb.h" 27#include "libbb.h"
19 28
20#ifndef FSHIFT 29#ifndef FSHIFT
diff --git a/procps/watch.c b/procps/watch.c
index 36f71c469..e289bf8cb 100644
--- a/procps/watch.c
+++ b/procps/watch.c
@@ -11,6 +11,20 @@
11/* BB_AUDIT SUSv3 N/A */ 11/* BB_AUDIT SUSv3 N/A */
12/* BB_AUDIT GNU defects -- only option -n is supported. */ 12/* BB_AUDIT GNU defects -- only option -n is supported. */
13 13
14//usage:#define watch_trivial_usage
15//usage: "[-n SEC] [-t] PROG ARGS"
16//usage:#define watch_full_usage "\n\n"
17//usage: "Run PROG periodically\n"
18//usage: "\nOptions:"
19//usage: "\n -n Loop period in seconds (default 2)"
20//usage: "\n -t Don't print header"
21//usage:
22//usage:#define watch_example_usage
23//usage: "$ watch date\n"
24//usage: "Mon Dec 17 10:31:40 GMT 2000\n"
25//usage: "Mon Dec 17 10:31:42 GMT 2000\n"
26//usage: "Mon Dec 17 10:31:44 GMT 2000"
27
14#include "libbb.h" 28#include "libbb.h"
15 29
16// procps 2.0.18: 30// procps 2.0.18:
diff --git a/runit/chpst.c b/runit/chpst.c
index dc8a26aeb..63da4797f 100644
--- a/runit/chpst.c
+++ b/runit/chpst.c
@@ -28,6 +28,70 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */ 28/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
29/* Dependencies on runit_lib.c removed */ 29/* Dependencies on runit_lib.c removed */
30 30
31//usage:#define chpst_trivial_usage
32//usage: "[-vP012] [-u USER[:GRP]] [-U USER[:GRP]] [-e DIR]\n"
33//usage: " [-/ DIR] [-n NICE] [-m BYTES] [-d BYTES] [-o N]\n"
34//usage: " [-p N] [-f BYTES] [-c BYTES] PROG ARGS"
35//usage:#define chpst_full_usage "\n\n"
36//usage: "Change the process state, run PROG\n"
37//usage: "\nOptions:"
38//usage: "\n -u USER[:GRP] Set uid and gid"
39//usage: "\n -U USER[:GRP] Set $UID and $GID in environment"
40//usage: "\n -e DIR Set environment variables as specified by files"
41//usage: "\n in DIR: file=1st_line_of_file"
42//usage: "\n -/ DIR Chroot to DIR"
43//usage: "\n -n NICE Add NICE to nice value"
44//usage: "\n -m BYTES Same as -d BYTES -s BYTES -l BYTES"
45//usage: "\n -d BYTES Limit data segment"
46//usage: "\n -o N Limit number of open files per process"
47//usage: "\n -p N Limit number of processes per uid"
48//usage: "\n -f BYTES Limit output file sizes"
49//usage: "\n -c BYTES Limit core file size"
50//usage: "\n -v Verbose"
51//usage: "\n -P Create new process group"
52//usage: "\n -0 Close stdin"
53//usage: "\n -1 Close stdout"
54//usage: "\n -2 Close stderr"
55//usage:
56//usage:#define envdir_trivial_usage
57//usage: "DIR PROG ARGS"
58//usage:#define envdir_full_usage "\n\n"
59//usage: "Set various environment variables as specified by files\n"
60//usage: "in the directory DIR, run PROG"
61//usage:
62//usage:#define envuidgid_trivial_usage
63//usage: "USER PROG ARGS"
64//usage:#define envuidgid_full_usage "\n\n"
65//usage: "Set $UID to USER's uid and $GID to USER's gid, run PROG"
66//usage:
67//usage:#define setuidgid_trivial_usage
68//usage: "USER PROG ARGS"
69//usage:#define setuidgid_full_usage "\n\n"
70//usage: "Set uid and gid to USER's uid and gid, drop supplementary group ids,\n"
71//usage: "run PROG"
72//usage:
73//usage:#define softlimit_trivial_usage
74//usage: "[-a BYTES] [-m BYTES] [-d BYTES] [-s BYTES] [-l BYTES]\n"
75//usage: " [-f BYTES] [-c BYTES] [-r BYTES] [-o N] [-p N] [-t N]\n"
76//usage: " PROG ARGS"
77//usage:#define softlimit_full_usage "\n\n"
78//usage: "Set soft resource limits, then run PROG\n"
79//usage: "\nOptions:"
80//usage: "\n -a BYTES Limit total size of all segments"
81//usage: "\n -m BYTES Same as -d BYTES -s BYTES -l BYTES -a BYTES"
82//usage: "\n -d BYTES Limit data segment"
83//usage: "\n -s BYTES Limit stack segment"
84//usage: "\n -l BYTES Limit locked memory size"
85//usage: "\n -o N Limit number of open files per process"
86//usage: "\n -p N Limit number of processes per uid"
87//usage: "\nOptions controlling file sizes:"
88//usage: "\n -f BYTES Limit output file sizes"
89//usage: "\n -c BYTES Limit core file size"
90//usage: "\nEfficiency opts:"
91//usage: "\n -r BYTES Limit resident set size"
92//usage: "\n -t N Limit CPU time, process receives"
93//usage: "\n a SIGXCPU after N seconds"
94
31#include "libbb.h" 95#include "libbb.h"
32 96
33/* 97/*
diff --git a/runit/runsv.c b/runit/runsv.c
index e76572daa..ad8d84f74 100644
--- a/runit/runsv.c
+++ b/runit/runsv.c
@@ -28,6 +28,11 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */ 28/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
29/* TODO: depends on runit_lib.c - review and reduce/eliminate */ 29/* TODO: depends on runit_lib.c - review and reduce/eliminate */
30 30
31//usage:#define runsv_trivial_usage
32//usage: "DIR"
33//usage:#define runsv_full_usage "\n\n"
34//usage: "Start and monitor a service and optionally an appendant log service"
35
31#include <sys/poll.h> 36#include <sys/poll.h>
32#include <sys/file.h> 37#include <sys/file.h>
33#include "libbb.h" 38#include "libbb.h"
diff --git a/runit/runsvdir.c b/runit/runsvdir.c
index 166664237..9495a2a4f 100644
--- a/runit/runsvdir.c
+++ b/runit/runsvdir.c
@@ -28,6 +28,13 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */ 28/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
29/* TODO: depends on runit_lib.c - review and reduce/eliminate */ 29/* TODO: depends on runit_lib.c - review and reduce/eliminate */
30 30
31//usage:#define runsvdir_trivial_usage
32//usage: "[-P] [-s SCRIPT] DIR"
33//usage:#define runsvdir_full_usage "\n\n"
34//usage: "Start a runsv process for each subdirectory. If it exits, restart it.\n"
35//usage: "\n -P Put each runsv in a new session"
36//usage: "\n -s SCRIPT Run SCRIPT <signo> after signal is processed"
37
31#include <sys/poll.h> 38#include <sys/poll.h>
32#include <sys/file.h> 39#include <sys/file.h>
33#include "libbb.h" 40#include "libbb.h"
diff --git a/runit/sv.c b/runit/sv.c
index c420a91a6..322688a36 100644
--- a/runit/sv.c
+++ b/runit/sv.c
@@ -153,6 +153,22 @@ Exit Codes
153/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */ 153/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
154/* TODO: depends on runit_lib.c - review and reduce/eliminate */ 154/* TODO: depends on runit_lib.c - review and reduce/eliminate */
155 155
156//usage:#define sv_trivial_usage
157//usage: "[-v] [-w SEC] CMD SERVICE_DIR..."
158//usage:#define sv_full_usage "\n\n"
159//usage: "Control services monitored by runsv supervisor.\n"
160//usage: "Commands (only first character is enough):\n"
161//usage: "\n"
162//usage: "status: query service status\n"
163//usage: "up: if service isn't running, start it. If service stops, restart it\n"
164//usage: "once: like 'up', but if service stops, don't restart it\n"
165//usage: "down: send TERM and CONT signals. If ./run exits, start ./finish\n"
166//usage: " if it exists. After it stops, don't restart service\n"
167//usage: "exit: send TERM and CONT signals to service and log service. If they exit,\n"
168//usage: " runsv exits too\n"
169//usage: "pause, cont, hup, alarm, interrupt, quit, 1, 2, term, kill: send\n"
170//usage: "STOP, CONT, HUP, ALRM, INT, QUIT, USR1, USR2, TERM, KILL signal to service"
171
156#include <sys/poll.h> 172#include <sys/poll.h>
157#include <sys/file.h> 173#include <sys/file.h>
158#include "libbb.h" 174#include "libbb.h"
diff --git a/selinux/chcon.c b/selinux/chcon.c
index e00cdda1b..8644502b5 100644
--- a/selinux/chcon.c
+++ b/selinux/chcon.c
@@ -7,6 +7,39 @@
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10
11//usage:#define chcon_trivial_usage
12//usage: "[OPTIONS] CONTEXT FILE..."
13//usage: "\n chcon [OPTIONS] [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE..."
14//usage: IF_FEATURE_CHCON_LONG_OPTIONS(
15//usage: "\n chcon [OPTIONS] --reference=RFILE FILE..."
16//usage: )
17//usage:#define chcon_full_usage "\n\n"
18//usage: "Change the security context of each FILE to CONTEXT\n"
19//usage: IF_FEATURE_CHCON_LONG_OPTIONS(
20//usage: "\n -v,--verbose Verbose"
21//usage: "\n -c,--changes Report changes made"
22//usage: "\n -h,--no-dereference Affect symlinks instead of their targets"
23//usage: "\n -f,--silent,--quiet Suppress most error messages"
24//usage: "\n --reference=RFILE Use RFILE's group instead of using a CONTEXT value"
25//usage: "\n -u,--user=USER Set user/role/type/range in the target"
26//usage: "\n -r,--role=ROLE security context"
27//usage: "\n -t,--type=TYPE"
28//usage: "\n -l,--range=RANGE"
29//usage: "\n -R,--recursive Recurse"
30//usage: )
31//usage: IF_NOT_FEATURE_CHCON_LONG_OPTIONS(
32//usage: "\n -v Verbose"
33//usage: "\n -c Report changes made"
34//usage: "\n -h Affect symlinks instead of their targets"
35//usage: "\n -f Suppress most error messages"
36//usage: "\n -u USER Set user/role/type/range in the target security context"
37//usage: "\n -r ROLE"
38//usage: "\n -t TYPE"
39//usage: "\n -l RNG"
40//usage: "\n -R Recurse"
41//usage: )
42
10#include <getopt.h> 43#include <getopt.h>
11#include <selinux/context.h> 44#include <selinux/context.h>
12 45
diff --git a/selinux/getenforce.c b/selinux/getenforce.c
index d9d9d0f65..56611d693 100644
--- a/selinux/getenforce.c
+++ b/selinux/getenforce.c
@@ -7,6 +7,9 @@
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define getenforce_trivial_usage NOUSAGE_STR
11//usage:#define getenforce_full_usage ""
12
10#include "libbb.h" 13#include "libbb.h"
11 14
12int getenforce_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 15int getenforce_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/selinux/getsebool.c b/selinux/getsebool.c
index 924356cae..e8f0fefb0 100644
--- a/selinux/getsebool.c
+++ b/selinux/getsebool.c
@@ -7,6 +7,11 @@
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define getsebool_trivial_usage
11//usage: "-a or getsebool boolean..."
12//usage:#define getsebool_full_usage "\n\n"
13//usage: " -a Show all selinux booleans"
14
10#include "libbb.h" 15#include "libbb.h"
11 16
12int getsebool_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 17int getsebool_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/selinux/load_policy.c b/selinux/load_policy.c
index 8fc92dbf3..ce139dbf2 100644
--- a/selinux/load_policy.c
+++ b/selinux/load_policy.c
@@ -4,6 +4,10 @@
4 * 4 *
5 * Licensed under GPLv2, see file LICENSE in this source tree. 5 * Licensed under GPLv2, see file LICENSE in this source tree.
6 */ 6 */
7
8//usage:#define load_policy_trivial_usage NOUSAGE_STR
9//usage:#define load_policy_full_usage ""
10
7#include "libbb.h" 11#include "libbb.h"
8 12
9int load_policy_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 13int load_policy_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/selinux/matchpathcon.c b/selinux/matchpathcon.c
index ec49077c8..9e5728eb3 100644
--- a/selinux/matchpathcon.c
+++ b/selinux/matchpathcon.c
@@ -5,6 +5,16 @@
5 * 5 *
6 * Licensed under GPLv2, see file LICENSE in this source tree. 6 * Licensed under GPLv2, see file LICENSE in this source tree.
7 */ 7 */
8
9//usage:#define matchpathcon_trivial_usage
10//usage: "[-n] [-N] [-f file_contexts_file] [-p prefix] [-V]"
11//usage:#define matchpathcon_full_usage "\n\n"
12//usage: " -n Don't display path"
13//usage: "\n -N Don't use translations"
14//usage: "\n -f Use alternate file_context file"
15//usage: "\n -p Use prefix to speed translations"
16//usage: "\n -V Verify file context on disk matches defaults"
17
8#include "libbb.h" 18#include "libbb.h"
9 19
10static int print_matchpathcon(char *path, int noprint) 20static int print_matchpathcon(char *path, int noprint)
diff --git a/selinux/runcon.c b/selinux/runcon.c
index 54349b25c..f0b21269f 100644
--- a/selinux/runcon.c
+++ b/selinux/runcon.c
@@ -28,6 +28,28 @@
28 * 28 *
29 * Licensed under GPLv2, see file LICENSE in this source tree. 29 * Licensed under GPLv2, see file LICENSE in this source tree.
30 */ 30 */
31
32//usage:#define runcon_trivial_usage
33//usage: "[-c] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] PROG ARGS\n"
34//usage: "runcon CONTEXT PROG ARGS"
35//usage:#define runcon_full_usage "\n\n"
36//usage: "Run PROG in a different security context\n"
37//usage: "\n CONTEXT Complete security context\n"
38//usage: IF_FEATURE_RUNCON_LONG_OPTIONS(
39//usage: "\n -c,--compute Compute process transition context before modifying"
40//usage: "\n -t,--type=TYPE Type (for same role as parent)"
41//usage: "\n -u,--user=USER User identity"
42//usage: "\n -r,--role=ROLE Role"
43//usage: "\n -l,--range=RNG Levelrange"
44//usage: )
45//usage: IF_NOT_FEATURE_RUNCON_LONG_OPTIONS(
46//usage: "\n -c Compute process transition context before modifying"
47//usage: "\n -t TYPE Type (for same role as parent)"
48//usage: "\n -u USER User identity"
49//usage: "\n -r ROLE Role"
50//usage: "\n -l RNG Levelrange"
51//usage: )
52
31#include <getopt.h> 53#include <getopt.h>
32#include <selinux/context.h> 54#include <selinux/context.h>
33#include <selinux/flask.h> 55#include <selinux/flask.h>
diff --git a/selinux/selinuxenabled.c b/selinux/selinuxenabled.c
index aa4e63f74..ce830dc22 100644
--- a/selinux/selinuxenabled.c
+++ b/selinux/selinuxenabled.c
@@ -6,6 +6,10 @@
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9
10//usage:#define selinuxenabled_trivial_usage NOUSAGE_STR
11//usage:#define selinuxenabled_full_usage ""
12
9#include "libbb.h" 13#include "libbb.h"
10 14
11int selinuxenabled_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 15int selinuxenabled_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/selinux/sestatus.c b/selinux/sestatus.c
index aa12e806c..0bd1a0dda 100644
--- a/selinux/sestatus.c
+++ b/selinux/sestatus.c
@@ -8,6 +8,12 @@
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10 10
11//usage:#define sestatus_trivial_usage
12//usage: "[-vb]"
13//usage:#define sestatus_full_usage "\n\n"
14//usage: " -v Verbose"
15//usage: "\n -b Display current state of booleans"
16
11#include "libbb.h" 17#include "libbb.h"
12 18
13extern char *selinux_mnt; 19extern char *selinux_mnt;
diff --git a/selinux/setenforce.c b/selinux/setenforce.c
index be5432147..c5bc0a5a6 100644
--- a/selinux/setenforce.c
+++ b/selinux/setenforce.c
@@ -7,6 +7,10 @@
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define setenforce_trivial_usage
11//usage: "[Enforcing | Permissive | 1 | 0]"
12//usage:#define setenforce_full_usage ""
13
10#include "libbb.h" 14#include "libbb.h"
11 15
12/* These strings are arranged so that odd ones 16/* These strings are arranged so that odd ones
diff --git a/selinux/setfiles.c b/selinux/setfiles.c
index 989510e3d..ca3fd9361 100644
--- a/selinux/setfiles.c
+++ b/selinux/setfiles.c
@@ -4,6 +4,46 @@
4 Port to BusyBox (c) 2007 by Yuichi Nakamura <ynakam@hitachisoft.jp> 4 Port to BusyBox (c) 2007 by Yuichi Nakamura <ynakam@hitachisoft.jp>
5*/ 5*/
6 6
7//usage:#define setfiles_trivial_usage
8//usage: "[-dnpqsvW] [-e DIR]... [-o FILE] [-r alt_root_path]"
9//usage: IF_FEATURE_SETFILES_CHECK_OPTION(
10//usage: " [-c policyfile] spec_file"
11//usage: )
12//usage: " pathname"
13//usage:#define setfiles_full_usage "\n\n"
14//usage: "Reset file contexts under pathname according to spec_file\n"
15//usage: IF_FEATURE_SETFILES_CHECK_OPTION(
16//usage: "\n -c FILE Check the validity of the contexts against the specified binary policy"
17//usage: )
18//usage: "\n -d Show which specification matched each file"
19//usage: "\n -l Log changes in file labels to syslog"
20//usage: "\n -n Don't change any file labels"
21//usage: "\n -q Suppress warnings"
22//usage: "\n -r DIR Use an alternate root path"
23//usage: "\n -e DIR Exclude DIR"
24//usage: "\n -F Force reset of context to match file_context for customizable files"
25//usage: "\n -o FILE Save list of files with incorrect context"
26//usage: "\n -s Take a list of files from stdin (instead of command line)"
27//usage: "\n -v Show changes in file labels, if type or role are changing"
28//usage: "\n -vv Show changes in file labels, if type, role, or user are changing"
29//usage: "\n -W Display warnings about entries that had no matching files"
30//usage:
31//usage:#define restorecon_trivial_usage
32//usage: "[-iFnRv] [-e EXCLUDEDIR]... [-o FILE] [-f FILE]"
33//usage:#define restorecon_full_usage "\n\n"
34//usage: "Reset security contexts of files in pathname\n"
35//usage: "\n -i Ignore files that don't exist"
36//usage: "\n -f FILE File with list of files to process"
37//usage: "\n -e DIR Directory to exclude"
38//usage: "\n -R,-r Recurse"
39//usage: "\n -n Don't change any file labels"
40//usage: "\n -o FILE Save list of files with incorrect context"
41//usage: "\n -v Verbose"
42//usage: "\n -vv Show changed labels"
43//usage: "\n -F Force reset of context to match file_context"
44//usage: "\n for customizable files, or the user section,"
45//usage: "\n if it has changed"
46
7#include "libbb.h" 47#include "libbb.h"
8#if ENABLE_FEATURE_SETFILES_CHECK_OPTION 48#if ENABLE_FEATURE_SETFILES_CHECK_OPTION
9#include <sepol/sepol.h> 49#include <sepol/sepol.h>
diff --git a/selinux/setsebool.c b/selinux/setsebool.c
index a8cc00407..ec682e5c5 100644
--- a/selinux/setsebool.c
+++ b/selinux/setsebool.c
@@ -8,6 +8,11 @@
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10 10
11//usage:#define setsebool_trivial_usage
12//usage: "boolean value"
13//usage:#define setsebool_full_usage "\n\n"
14//usage: "Change boolean setting"
15
11#include "libbb.h" 16#include "libbb.h"
12 17
13int setsebool_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 18int setsebool_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index db32065fb..3992081ca 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -17,6 +17,14 @@
17 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 17 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
18 */ 18 */
19 19
20//usage:#define klogd_trivial_usage
21//usage: "[-c N] [-n]"
22//usage:#define klogd_full_usage "\n\n"
23//usage: "Kernel logger\n"
24//usage: "\nOptions:"
25//usage: "\n -c N Only messages with level < N are printed to console"
26//usage: "\n -n Run in foreground"
27
20#include "libbb.h" 28#include "libbb.h"
21#include <syslog.h> 29#include <syslog.h>
22 30
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index 120f6a718..0fabd97ca 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -7,6 +7,18 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define logger_trivial_usage
11//usage: "[OPTIONS] [MESSAGE]"
12//usage:#define logger_full_usage "\n\n"
13//usage: "Write MESSAGE (or stdin) to syslog\n"
14//usage: "\nOptions:"
15//usage: "\n -s Log to stderr as well as the system log"
16//usage: "\n -t TAG Log using the specified tag (defaults to user name)"
17//usage: "\n -p PRIO Priority (numeric or facility.level pair)"
18//usage:
19//usage:#define logger_example_usage
20//usage: "$ logger \"hello\"\n"
21
10/* 22/*
11 * Done in syslogd_and_logger.c: 23 * Done in syslogd_and_logger.c:
12#include "libbb.h" 24#include "libbb.h"
diff --git a/sysklogd/logread.c b/sysklogd/logread.c
index 52c97aa77..ae0b2194b 100644
--- a/sysklogd/logread.c
+++ b/sysklogd/logread.c
@@ -9,6 +9,13 @@
9 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 9 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
10 */ 10 */
11 11
12//usage:#define logread_trivial_usage
13//usage: "[-f]"
14//usage:#define logread_full_usage "\n\n"
15//usage: "Show messages in syslogd's circular buffer\n"
16//usage: "\nOptions:"
17//usage: "\n -f Output data as log grows"
18
12#include "libbb.h" 19#include "libbb.h"
13#include <sys/ipc.h> 20#include <sys/ipc.h>
14#include <sys/sem.h> 21#include <sys/sem.h>
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index f179dc5ac..7ddd3e4c3 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -13,6 +13,33 @@
13 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 13 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
14 */ 14 */
15 15
16//usage:#define syslogd_trivial_usage
17//usage: "[OPTIONS]"
18//usage:#define syslogd_full_usage "\n\n"
19//usage: "System logging utility.\n"
20//usage: "This version of syslogd ignores /etc/syslog.conf\n"
21//usage: "\nOptions:"
22//usage: "\n -n Run in foreground"
23//usage: "\n -O FILE Log to given file (default:/var/log/messages)"
24//usage: "\n -l N Set local log level"
25//usage: "\n -S Smaller logging output"
26//usage: IF_FEATURE_ROTATE_LOGFILE(
27//usage: "\n -s SIZE Max size (KB) before rotate (default:200KB, 0=off)"
28//usage: "\n -b N N rotated logs to keep (default:1, max=99, 0=purge)")
29//usage: IF_FEATURE_REMOTE_LOG(
30//usage: "\n -R HOST[:PORT] Log to IP or hostname on PORT (default PORT=514/UDP)"
31//usage: "\n -L Log locally and via network (default is network only if -R)")
32//usage: IF_FEATURE_SYSLOGD_DUP(
33//usage: "\n -D Drop duplicates")
34//usage: IF_FEATURE_IPC_SYSLOG(
35//usage: "\n -C[size(KiB)] Log to shared mem buffer (read it using logread)")
36/* NB: -Csize shouldn't have space (because size is optional) */
37/* //usage: "\n -m MIN Minutes between MARK lines (default:20, 0=off)" */
38//usage:
39//usage:#define syslogd_example_usage
40//usage: "$ syslogd -R masterlog:514\n"
41//usage: "$ syslogd -R 192.168.1.1:601\n"
42
16/* 43/*
17 * Done in syslogd_and_logger.c: 44 * Done in syslogd_and_logger.c:
18#include "libbb.h" 45#include "libbb.h"
diff --git a/util-linux/acpid.c b/util-linux/acpid.c
index ce4c98ebe..c9eed2a7f 100644
--- a/util-linux/acpid.c
+++ b/util-linux/acpid.c
@@ -6,6 +6,30 @@
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9
10//usage:#define acpid_trivial_usage
11//usage: "[-d] [-c CONFDIR] [-l LOGFILE] [-a ACTIONFILE] [-M MAPFILE] [-e PROC_EVENT_FILE] [-p PIDFILE]"
12//usage:#define acpid_full_usage "\n\n"
13//usage: "Listen to ACPI events and spawn specific helpers on event arrival\n"
14//usage: "\nOptions:"
15//usage: "\n -c DIR Config directory [/etc/acpi]"
16//usage: "\n -d Don't daemonize, (implies -f)"
17//usage: "\n -e FILE /proc event file [/proc/acpi/event]"
18//usage: "\n -f Run in foreground"
19//usage: "\n -l FILE Log file [/var/log/acpid.log]"
20//usage: "\n -p FILE Pid file [/var/run/acpid.pid]"
21//usage: "\n -a FILE Action file [/etc/acpid.conf]"
22//usage: "\n -M FILE Map file [/etc/acpi.map]"
23//usage: IF_FEATURE_ACPID_COMPAT(
24//usage: "\n\nAccept and ignore compatibility options -g -m -s -S -v"
25//usage: )
26//usage:
27//usage:#define acpid_example_usage
28//usage: "Without -e option, acpid uses all /dev/input/event* files\n"
29//usage: "# acpid\n"
30//usage: "# acpid -l /var/log/my-acpi-log\n"
31//usage: "# acpid -e /proc/acpi/event\n"
32
9#include "libbb.h" 33#include "libbb.h"
10#include <syslog.h> 34#include <syslog.h>
11#include <linux/input.h> 35#include <linux/input.h>
diff --git a/util-linux/blkid.c b/util-linux/blkid.c
index fe88fb31d..c30360c65 100644
--- a/util-linux/blkid.c
+++ b/util-linux/blkid.c
@@ -7,6 +7,11 @@
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define blkid_trivial_usage
11//usage: ""
12//usage:#define blkid_full_usage "\n\n"
13//usage: "Print UUIDs of all filesystems"
14
10#include "libbb.h" 15#include "libbb.h"
11#include "volume_id.h" 16#include "volume_id.h"
12 17
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index 6e43a22f5..412bf024b 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -8,6 +8,16 @@
8 * 8 *
9 * Licensed under GPLv2, see file LICENSE in this source tree. 9 * Licensed under GPLv2, see file LICENSE in this source tree.
10 */ 10 */
11
12//usage:#define dmesg_trivial_usage
13//usage: "[-c] [-n LEVEL] [-s SIZE]"
14//usage:#define dmesg_full_usage "\n\n"
15//usage: "Print or control the kernel ring buffer\n"
16//usage: "\nOptions:"
17//usage: "\n -c Clear ring buffer after printing"
18//usage: "\n -n LEVEL Set console logging level"
19//usage: "\n -s SIZE Buffer size"
20
11#include <sys/klog.h> 21#include <sys/klog.h>
12#include "libbb.h" 22#include "libbb.h"
13 23
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 77cc1fc12..75d41b882 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -12,6 +12,21 @@
12 * Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be) 12 * Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
13 */ 13 */
14 14
15//usage:#define fbset_trivial_usage
16//usage: "[OPTIONS] [MODE]"
17//usage:#define fbset_full_usage "\n\n"
18//usage: "Show and modify frame buffer settings"
19//usage:
20//usage:#define fbset_example_usage
21//usage: "$ fbset\n"
22//usage: "mode \"1024x768-76\"\n"
23//usage: " # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz\n"
24//usage: " geometry 1024 768 1024 768 16\n"
25//usage: " timings 12714 128 32 16 4 128 4\n"
26//usage: " accel false\n"
27//usage: " rgba 5/11,6/5,5/0,0/0\n"
28//usage: "endmode\n"
29
15#include "libbb.h" 30#include "libbb.h"
16 31
17#define DEFAULTFBDEV FB_0 32#define DEFAULTFBDEV FB_0
diff --git a/util-linux/fdformat.c b/util-linux/fdformat.c
index 57e9c26f8..bf7098e71 100644
--- a/util-linux/fdformat.c
+++ b/util-linux/fdformat.c
@@ -5,6 +5,13 @@
5 * Licensed under GPLv2, see file LICENSE in this source tree. 5 * Licensed under GPLv2, see file LICENSE in this source tree.
6 */ 6 */
7 7
8//usage:#define fdformat_trivial_usage
9//usage: "[-n] DEVICE"
10//usage:#define fdformat_full_usage "\n\n"
11//usage: "Format floppy disk\n"
12//usage: "\nOptions:"
13//usage: "\n -n Don't verify after format"
14
8#include "libbb.h" 15#include "libbb.h"
9 16
10 17
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index 0b93c22cc..da03e683e 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -7,6 +7,28 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* Looks like someone forgot to add this to config system */
11//usage:#ifndef ENABLE_FEATURE_FDISK_BLKSIZE
12//usage:# define ENABLE_FEATURE_FDISK_BLKSIZE 0
13//usage:# define IF_FEATURE_FDISK_BLKSIZE(a)
14//usage:#endif
15//usage:
16//usage:#define fdisk_trivial_usage
17//usage: "[-ul" IF_FEATURE_FDISK_BLKSIZE("s") "] "
18//usage: "[-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK"
19//usage:#define fdisk_full_usage "\n\n"
20//usage: "Change partition table\n"
21//usage: "\nOptions:"
22//usage: "\n -u Start and End are in sectors (instead of cylinders)"
23//usage: "\n -l Show partition table for each DISK, then exit"
24//usage: IF_FEATURE_FDISK_BLKSIZE(
25//usage: "\n -s Show partition sizes in kb for each DISK, then exit"
26//usage: )
27//usage: "\n -b 2048 (for certain MO disks) use 2048-byte sectors"
28//usage: "\n -C CYLINDERS Set number of cylinders/heads/sectors"
29//usage: "\n -H HEADS"
30//usage: "\n -S SECTORS"
31
10#ifndef _LARGEFILE64_SOURCE 32#ifndef _LARGEFILE64_SOURCE
11/* For lseek64 */ 33/* For lseek64 */
12# define _LARGEFILE64_SOURCE 34# define _LARGEFILE64_SOURCE
diff --git a/util-linux/findfs.c b/util-linux/findfs.c
index e1ec41f1b..49e8979ac 100644
--- a/util-linux/findfs.c
+++ b/util-linux/findfs.c
@@ -8,6 +8,14 @@
8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11//usage:#define findfs_trivial_usage
12//usage: "LABEL=label or UUID=uuid"
13//usage:#define findfs_full_usage "\n\n"
14//usage: "Find a filesystem device based on a label or UUID"
15//usage:
16//usage:#define findfs_example_usage
17//usage: "$ findfs LABEL=MyDevice"
18
11#include "libbb.h" 19#include "libbb.h"
12#include "volume_id.h" 20#include "volume_id.h"
13 21
diff --git a/util-linux/flock.c b/util-linux/flock.c
index 77fe1f809..8fecb54d4 100644
--- a/util-linux/flock.c
+++ b/util-linux/flock.c
@@ -3,6 +3,17 @@
3 * 3 *
4 * This is free software, licensed under the GNU General Public License v2. 4 * This is free software, licensed under the GNU General Public License v2.
5 */ 5 */
6
7//usage:#define flock_trivial_usage
8//usage: "[-sxun] FD|{FILE [-c] PROG ARGS}"
9//usage:#define flock_full_usage "\n\n"
10//usage: "[Un]lock file descriptor, or lock FILE, run PROG\n"
11//usage: "\nOptions:"
12//usage: "\n -s Shared lock"
13//usage: "\n -x Exclusive lock (default)"
14//usage: "\n -u Unlock FD"
15//usage: "\n -n Fail rather than wait"
16
6#include <sys/file.h> 17#include <sys/file.h>
7#include "libbb.h" 18#include "libbb.h"
8 19
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c
index 7ad443086..a89ae1a39 100644
--- a/util-linux/freeramdisk.c
+++ b/util-linux/freeramdisk.c
@@ -8,6 +8,20 @@
8 * 8 *
9 * Licensed under GPLv2, see file LICENSE in this source tree. 9 * Licensed under GPLv2, see file LICENSE in this source tree.
10 */ 10 */
11
12//usage:#define freeramdisk_trivial_usage
13//usage: "DEVICE"
14//usage:#define freeramdisk_full_usage "\n\n"
15//usage: "Free all memory used by the specified ramdisk"
16//usage:
17//usage:#define freeramdisk_example_usage
18//usage: "$ freeramdisk /dev/ram2\n"
19//usage:
20//usage:#define fdflush_trivial_usage
21//usage: "DEVICE"
22//usage:#define fdflush_full_usage "\n\n"
23//usage: "Force floppy disk drive to detect disk change"
24
11#include <sys/mount.h> 25#include <sys/mount.h>
12#include "libbb.h" 26#include "libbb.h"
13 27
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index e02e05fa4..b53c97248 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -87,6 +87,19 @@
87 * enforced (but it's not much fun on a character device :-). 87 * enforced (but it's not much fun on a character device :-).
88 */ 88 */
89 89
90//usage:#define fsck_minix_trivial_usage
91//usage: "[-larvsmf] BLOCKDEV"
92//usage:#define fsck_minix_full_usage "\n\n"
93//usage: "Check MINIX filesystem\n"
94//usage: "\nOptions:"
95//usage: "\n -l List all filenames"
96//usage: "\n -r Perform interactive repairs"
97//usage: "\n -a Perform automatic repairs"
98//usage: "\n -v Verbose"
99//usage: "\n -s Output superblock information"
100//usage: "\n -m Show \"mode not cleared\" warnings"
101//usage: "\n -f Force file system check"
102
90#include <mntent.h> 103#include <mntent.h>
91#include "libbb.h" 104#include "libbb.h"
92#include "minix.h" 105#include "minix.h"
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index 7c498538f..10e1dc49b 100644
--- a/util-linux/getopt.c
+++ b/util-linux/getopt.c
@@ -31,6 +31,54 @@
31 * 31 *
32 */ 32 */
33 33
34//usage:#define getopt_trivial_usage
35//usage: "[OPTIONS]"
36//usage:#define getopt_full_usage "\n\n"
37//usage: "Options:"
38//usage: IF_LONG_OPTS(
39//usage: "\n -a,--alternative Allow long options starting with single -"
40//usage: "\n -l,--longoptions=longopts Long options to be recognized"
41//usage: "\n -n,--name=progname The name under which errors are reported"
42//usage: "\n -o,--options=optstring Short options to be recognized"
43//usage: "\n -q,--quiet Disable error reporting by getopt(3)"
44//usage: "\n -Q,--quiet-output No normal output"
45//usage: "\n -s,--shell=shell Set shell quoting conventions"
46//usage: "\n -T,--test Test for getopt(1) version"
47//usage: "\n -u,--unquoted Don't quote the output"
48//usage: )
49//usage: IF_NOT_LONG_OPTS(
50//usage: "\n -a Allow long options starting with single -"
51//usage: "\n -l longopts Long options to be recognized"
52//usage: "\n -n progname The name under which errors are reported"
53//usage: "\n -o optstring Short options to be recognized"
54//usage: "\n -q Disable error reporting by getopt(3)"
55//usage: "\n -Q No normal output"
56//usage: "\n -s shell Set shell quoting conventions"
57//usage: "\n -T Test for getopt(1) version"
58//usage: "\n -u Don't quote the output"
59//usage: )
60//usage:
61//usage:#define getopt_example_usage
62//usage: "$ cat getopt.test\n"
63//usage: "#!/bin/sh\n"
64//usage: "GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \\\n"
65//usage: " -n 'example.busybox' -- \"$@\"`\n"
66//usage: "if [ $? != 0 ]; then exit 1; fi\n"
67//usage: "eval set -- \"$GETOPT\"\n"
68//usage: "while true; do\n"
69//usage: " case $1 in\n"
70//usage: " -a|--a-long) echo \"Option a\"; shift;;\n"
71//usage: " -b|--b-long) echo \"Option b, argument '$2'\"; shift 2;;\n"
72//usage: " -c|--c-long)\n"
73//usage: " case \"$2\" in\n"
74//usage: " \"\") echo \"Option c, no argument\"; shift 2;;\n"
75//usage: " *) echo \"Option c, argument '$2'\"; shift 2;;\n"
76//usage: " esac;;\n"
77//usage: " --) shift; break;;\n"
78//usage: " *) echo \"Internal error!\"; exit 1;;\n"
79//usage: " esac\n"
80//usage: "done\n"
81
34#include <getopt.h> 82#include <getopt.h>
35#include "libbb.h" 83#include "libbb.h"
36 84
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c
index a38fe05e7..1f5d57d74 100644
--- a/util-linux/hexdump.c
+++ b/util-linux/hexdump.c
@@ -9,6 +9,30 @@
9 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 9 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
10 */ 10 */
11 11
12//usage:#define hexdump_trivial_usage
13//usage: "[-bcCdefnosvx" IF_FEATURE_HEXDUMP_REVERSE("R") "] [FILE]..."
14//usage:#define hexdump_full_usage "\n\n"
15//usage: "Display FILEs (or stdin) in a user specified format\n"
16//usage: "\nOptions:"
17//usage: "\n -b One-byte octal display"
18//usage: "\n -c One-byte character display"
19//usage: "\n -C Canonical hex+ASCII, 16 bytes per line"
20//usage: "\n -d Two-byte decimal display"
21//usage: "\n -e FORMAT_STRING"
22//usage: "\n -f FORMAT_FILE"
23//usage: "\n -n LENGTH Interpret only LENGTH bytes of input"
24//usage: "\n -o Two-byte octal display"
25//usage: "\n -s OFFSET Skip OFFSET bytes"
26//usage: "\n -v Display all input data"
27//usage: "\n -x Two-byte hexadecimal display"
28//usage: IF_FEATURE_HEXDUMP_REVERSE(
29//usage: "\n -R Reverse of 'hexdump -Cv'")
30//usage:
31//usage:#define hd_trivial_usage
32//usage: "FILE..."
33//usage:#define hd_full_usage "\n\n"
34//usage: "hd is an alias for hexdump -C"
35
12#include "libbb.h" 36#include "libbb.h"
13#include "dump.h" 37#include "dump.h"
14 38
diff --git a/util-linux/ipcrm.c b/util-linux/ipcrm.c
index e597ed637..bdd019f6f 100644
--- a/util-linux/ipcrm.c
+++ b/util-linux/ipcrm.c
@@ -8,6 +8,16 @@
8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11//usage:#define ipcrm_trivial_usage
12//usage: "[-MQS key] [-mqs id]"
13//usage:#define ipcrm_full_usage "\n\n"
14//usage: "Upper-case options MQS remove an object by shmkey value.\n"
15//usage: "Lower-case options remove an object by shmid value.\n"
16//usage: "\nOptions:"
17//usage: "\n -mM Remove memory segment after last detach"
18//usage: "\n -qQ Remove message queue"
19//usage: "\n -sS Remove semaphore"
20
11#include "libbb.h" 21#include "libbb.h"
12 22
13/* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */ 23/* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */
diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c
index 14df65280..33035c62e 100644
--- a/util-linux/ipcs.c
+++ b/util-linux/ipcs.c
@@ -8,6 +8,22 @@
8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11//usage:#define ipcs_trivial_usage
12//usage: "[[-smq] -i shmid] | [[-asmq] [-tcplu]]"
13//usage:#define ipcs_full_usage "\n\n"
14//usage: " -i Show specific resource"
15//usage: "\nResource specification:"
16//usage: "\n -m Shared memory segments"
17//usage: "\n -q Message queues"
18//usage: "\n -s Semaphore arrays"
19//usage: "\n -a All (default)"
20//usage: "\nOutput format:"
21//usage: "\n -t Time"
22//usage: "\n -c Creator"
23//usage: "\n -p Pid"
24//usage: "\n -l Limits"
25//usage: "\n -u Summary"
26
11/* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */ 27/* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */
12/* X/OPEN tells us to use <sys/{types,ipc,msg}.h> for msgctl() */ 28/* X/OPEN tells us to use <sys/{types,ipc,msg}.h> for msgctl() */
13/* X/OPEN tells us to use <sys/{types,ipc,shm}.h> for shmctl() */ 29/* X/OPEN tells us to use <sys/{types,ipc,shm}.h> for shmctl() */
diff --git a/util-linux/losetup.c b/util-linux/losetup.c
index 776f784f5..7e11e292d 100644
--- a/util-linux/losetup.c
+++ b/util-linux/losetup.c
@@ -7,6 +7,24 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define losetup_trivial_usage
11//usage: "[-o OFS] LOOPDEV FILE - associate loop devices\n"
12//usage: " losetup -d LOOPDEV - disassociate\n"
13//usage: " losetup [-f] - show"
14//usage:#define losetup_full_usage "\n\n"
15//usage: "Options:"
16//usage: "\n -o OFS Start OFS bytes into FILE"
17//usage: "\n -f Show first free loop device"
18//usage:
19//usage:#define losetup_notes_usage
20//usage: "No arguments will display all current associations.\n"
21//usage: "One argument (losetup /dev/loop1) will display the current association\n"
22//usage: "(if any), or disassociate it (with -d). The display shows the offset\n"
23//usage: "and filename of the file the loop device is currently bound to.\n\n"
24//usage: "Two arguments (losetup /dev/loop1 file.img) create a new association,\n"
25//usage: "with an optional offset (-o 12345). Encryption is not yet supported.\n"
26//usage: "losetup -f will show the first loop free loop device\n\n"
27
10#include "libbb.h" 28#include "libbb.h"
11 29
12int losetup_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 30int losetup_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/util-linux/lspci.c b/util-linux/lspci.c
index 46e93b04d..f59aec8a5 100644
--- a/util-linux/lspci.c
+++ b/util-linux/lspci.c
@@ -6,6 +6,15 @@
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9
10//usage:#define lspci_trivial_usage
11//usage: "[-mk]"
12//usage:#define lspci_full_usage "\n\n"
13//usage: "List all PCI devices"
14//usage: "\n"
15//usage: "\n -m Parseable output"
16//usage: "\n -k Show driver"
17
9#include "libbb.h" 18#include "libbb.h"
10 19
11enum { 20enum {
diff --git a/util-linux/lsusb.c b/util-linux/lsusb.c
index 6f9b54daa..540f21ec6 100644
--- a/util-linux/lsusb.c
+++ b/util-linux/lsusb.c
@@ -6,6 +6,10 @@
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9
10//usage:#define lsusb_trivial_usage NOUSAGE_STR
11//usage:#define lsusb_full_usage ""
12
9#include "libbb.h" 13#include "libbb.h"
10 14
11static int FAST_FUNC fileAction( 15static int FAST_FUNC fileAction(
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index a970f91f2..2f225ac0b 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -7,6 +7,41 @@
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10
11//usage:#define mdev_trivial_usage
12//usage: "[-s]"
13//usage:#define mdev_full_usage "\n\n"
14//usage: " -s Scan /sys and populate /dev during system boot\n"
15//usage: "\n"
16//usage: "It can be run by kernel as a hotplug helper. To activate it:\n"
17//usage: " echo /sbin/mdev > /proc/sys/kernel/hotplug\n"
18//usage: IF_FEATURE_MDEV_CONF(
19//usage: "It uses /etc/mdev.conf with lines\n"
20//usage: "[-]DEVNAME UID:GID PERM"
21//usage: IF_FEATURE_MDEV_RENAME(" [>|=PATH]")
22//usage: IF_FEATURE_MDEV_EXEC(" [@|$|*PROG]")
23//usage: )
24//usage:
25//usage:#define mdev_notes_usage ""
26//usage: IF_FEATURE_MDEV_CONFIG(
27//usage: "The mdev config file contains lines that look like:\n"
28//usage: " hd[a-z][0-9]* 0:3 660\n\n"
29//usage: "That's device name (with regex match), uid:gid, and permissions.\n\n"
30//usage: IF_FEATURE_MDEV_EXEC(
31//usage: "Optionally, that can be followed (on the same line) by a special character\n"
32//usage: "and a command line to run after creating/before deleting the corresponding\n"
33//usage: "device(s). The environment variable $MDEV indicates the active device node\n"
34//usage: "(which is useful if it's a regex match). For example:\n\n"
35//usage: " hdc root:cdrom 660 *ln -s $MDEV cdrom\n\n"
36//usage: "The special characters are @ (run after creating), $ (run before deleting),\n"
37//usage: "and * (run both after creating and before deleting). The commands run in\n"
38//usage: "the /dev directory, and use system() which calls /bin/sh.\n\n"
39//usage: )
40//usage: "Config file parsing stops on the first matching line. If no config\n"
41//usage: "entry is matched, devices are created with default 0:0 660. (Make\n"
42//usage: "the last line match .* to override this.)\n\n"
43//usage: )
44
10#include "libbb.h" 45#include "libbb.h"
11#include "xregex.h" 46#include "xregex.h"
12 47
diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c
index 871ec835e..f6ccc9c9e 100644
--- a/util-linux/mkfs_ext2.c
+++ b/util-linux/mkfs_ext2.c
@@ -7,6 +7,45 @@
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10
11//usage:#define mkfs_ext2_trivial_usage
12//usage: "[-Fn] "
13/* //usage: "[-c|-l filename] " */
14//usage: "[-b BLK_SIZE] "
15/* //usage: "[-f fragment-size] [-g blocks-per-group] " */
16//usage: "[-i INODE_RATIO] [-I INODE_SIZE] "
17/* //usage: "[-j] [-J journal-options] [-N number-of-inodes] " */
18//usage: "[-m RESERVED_PERCENT] "
19/* //usage: "[-o creator-os] [-O feature[,...]] [-q] " */
20/* //usage: "[r fs-revision-level] [-E extended-options] [-v] [-F] " */
21//usage: "[-L LABEL] "
22/* //usage: "[-M last-mounted-directory] [-S] [-T filesystem-type] " */
23//usage: "BLOCKDEV [KBYTES]"
24//usage:#define mkfs_ext2_full_usage "\n\n"
25//usage: " -b BLK_SIZE Block size, bytes"
26/* //usage: "\n -c Check device for bad blocks" */
27/* //usage: "\n -E opts Set extended options" */
28/* //usage: "\n -f size Fragment size in bytes" */
29//usage: "\n -F Force"
30/* //usage: "\n -g N Number of blocks in a block group" */
31//usage: "\n -i RATIO Max number of files is filesystem_size / RATIO"
32//usage: "\n -I BYTES Inode size (min 128)"
33/* //usage: "\n -j Create a journal (ext3)" */
34/* //usage: "\n -J opts Set journal options (size/device)" */
35/* //usage: "\n -l file Read bad blocks list from file" */
36//usage: "\n -L LBL Volume label"
37//usage: "\n -m PERCENT Percent of blocks to reserve for admin"
38/* //usage: "\n -M dir Set last mounted directory" */
39//usage: "\n -n Dry run"
40/* //usage: "\n -N N Number of inodes to create" */
41/* //usage: "\n -o os Set the 'creator os' field" */
42/* //usage: "\n -O features Dir_index/filetype/has_journal/journal_dev/sparse_super" */
43/* //usage: "\n -q Quiet" */
44/* //usage: "\n -r rev Set filesystem revision" */
45/* //usage: "\n -S Write superblock and group descriptors only" */
46/* //usage: "\n -T fs-type Set usage type (news/largefile/largefile4)" */
47/* //usage: "\n -v Verbose" */
48
10#include "libbb.h" 49#include "libbb.h"
11#include <linux/fs.h> 50#include <linux/fs.h>
12#include <linux/ext2_fs.h> 51#include <linux/ext2_fs.h>
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index 95499ba17..a8bc4b80d 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -63,6 +63,17 @@
63 * removed getopt based parser and added a hand rolled one. 63 * removed getopt based parser and added a hand rolled one.
64 */ 64 */
65 65
66//usage:#define mkfs_minix_trivial_usage
67//usage: "[-c | -l FILE] [-nXX] [-iXX] BLOCKDEV [KBYTES]"
68//usage:#define mkfs_minix_full_usage "\n\n"
69//usage: "Make a MINIX filesystem\n"
70//usage: "\nOptions:"
71//usage: "\n -c Check device for bad blocks"
72//usage: "\n -n [14|30] Maximum length of filenames"
73//usage: "\n -i INODES Number of inodes for the filesystem"
74//usage: "\n -l FILE Read bad blocks list from FILE"
75//usage: "\n -v Make version 2 filesystem"
76
66#include "libbb.h" 77#include "libbb.h"
67#include <mntent.h> 78#include <mntent.h>
68 79
diff --git a/util-linux/mkfs_reiser.c b/util-linux/mkfs_reiser.c
index 00ce8f1d1..463ae1e2a 100644
--- a/util-linux/mkfs_reiser.c
+++ b/util-linux/mkfs_reiser.c
@@ -6,6 +6,15 @@
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9
10//usage:#define mkfs_reiser_trivial_usage
11//usage: "[-f] [-l LABEL] BLOCKDEV [4K-BLOCKS]"
12//usage:#define mkfs_reiser_full_usage "\n\n"
13//usage: "Make a ReiserFS V3 filesystem\n"
14//usage: "\nOptions:"
15//usage: "\n -f Force"
16//usage: "\n -l LBL Volume label"
17
9#include "libbb.h" 18#include "libbb.h"
10#include <linux/fs.h> 19#include <linux/fs.h>
11 20
diff --git a/util-linux/mkfs_vfat.c b/util-linux/mkfs_vfat.c
index bb5b59c66..e83ae7510 100644
--- a/util-linux/mkfs_vfat.c
+++ b/util-linux/mkfs_vfat.c
@@ -7,6 +7,23 @@
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10
11//usage:#define mkfs_vfat_trivial_usage
12//usage: "[-v] [-n LABEL] BLOCKDEV [KBYTES]"
13/* Accepted but ignored:
14 "[-c] [-C] [-I] [-l bad-block-file] [-b backup-boot-sector] "
15 "[-m boot-msg-file] [-i volume-id] "
16 "[-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs] "
17 "[-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors] "
18*/
19//usage:#define mkfs_vfat_full_usage "\n\n"
20//usage: "Make a FAT32 filesystem\n"
21//usage: "\nOptions:"
22/* //usage: "\n -c Check device for bad blocks" */
23//usage: "\n -v Verbose"
24/* //usage: "\n -I Allow to use entire disk device (e.g. /dev/hda)" */
25//usage: "\n -n LBL Volume label"
26
10#include "libbb.h" 27#include "libbb.h"
11 28
12#include <linux/hdreg.h> /* HDIO_GETGEO */ 29#include <linux/hdreg.h> /* HDIO_GETGEO */
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c
index 2e9662b2b..ef6932c6c 100644
--- a/util-linux/mkswap.c
+++ b/util-linux/mkswap.c
@@ -5,6 +5,14 @@
5 * 5 *
6 * Licensed under GPLv2, see file LICENSE in this source tree. 6 * Licensed under GPLv2, see file LICENSE in this source tree.
7 */ 7 */
8
9//usage:#define mkswap_trivial_usage
10//usage: "[-L LBL] BLOCKDEV [KBYTES]"
11//usage:#define mkswap_full_usage "\n\n"
12//usage: "Prepare BLOCKDEV to be used as swap partition\n"
13//usage: "\nOptions:"
14//usage: "\n -L LBL Label"
15
8#include "libbb.h" 16#include "libbb.h"
9 17
10#if ENABLE_SELINUX 18#if ENABLE_SELINUX
diff --git a/util-linux/more.c b/util-linux/more.c
index 7160b8b00..efceb71ec 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -14,6 +14,14 @@
14 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 14 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
15 */ 15 */
16 16
17//usage:#define more_trivial_usage
18//usage: "[FILE]..."
19//usage:#define more_full_usage "\n\n"
20//usage: "View FILE (or stdin) one screenful at a time"
21//usage:
22//usage:#define more_example_usage
23//usage: "$ dmesg | more\n"
24
17#include "libbb.h" 25#include "libbb.h"
18 26
19/* Support for FEATURE_USE_TERMIOS */ 27/* Support for FEATURE_USE_TERMIOS */
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 722d0be92..3e2ba1fab 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -16,6 +16,66 @@
16// singlemount() can loop through /etc/filesystems for fstype detection. 16// singlemount() can loop through /etc/filesystems for fstype detection.
17// mount_it_now() does the actual mount. 17// mount_it_now() does the actual mount.
18// 18//
19
20//usage:#define mount_trivial_usage
21//usage: "[OPTIONS] [-o OPTS] DEVICE NODE"
22//usage:#define mount_full_usage "\n\n"
23//usage: "Mount a filesystem. Filesystem autodetection requires /proc.\n"
24//usage: "\nOptions:"
25//usage: "\n -a Mount all filesystems in fstab"
26//usage: IF_FEATURE_MOUNT_FAKE(
27//usage: IF_FEATURE_MTAB_SUPPORT(
28//usage: "\n -f Update /etc/mtab, but don't mount"
29//usage: )
30//usage: IF_NOT_FEATURE_MTAB_SUPPORT(
31//usage: "\n -f Dry run"
32//usage: )
33//usage: )
34//usage: IF_FEATURE_MOUNT_HELPERS(
35//usage: "\n -i Don't run mount helper"
36//usage: )
37//usage: IF_FEATURE_MTAB_SUPPORT(
38//usage: "\n -n Don't update /etc/mtab"
39//usage: )
40//usage: "\n -r Read-only mount"
41//usage: "\n -w Read-write mount (default)"
42//usage: "\n -t FSTYPE Filesystem type"
43//usage: "\n -O OPT Mount only filesystems with option OPT (-a only)"
44//usage: "\n-o OPT:"
45//usage: IF_FEATURE_MOUNT_LOOP(
46//usage: "\n loop Ignored (loop devices are autodetected)"
47//usage: )
48//usage: IF_FEATURE_MOUNT_FLAGS(
49//usage: "\n [a]sync Writes are [a]synchronous"
50//usage: "\n [no]atime Disable/enable updates to inode access times"
51//usage: "\n [no]diratime Disable/enable atime updates to directories"
52//usage: "\n [no]relatime Disable/enable atime updates relative to modification time"
53//usage: "\n [no]dev (Dis)allow use of special device files"
54//usage: "\n [no]exec (Dis)allow use of executable files"
55//usage: "\n [no]suid (Dis)allow set-user-id-root programs"
56//usage: "\n [r]shared Convert [recursively] to a shared subtree"
57//usage: "\n [r]slave Convert [recursively] to a slave subtree"
58//usage: "\n [r]private Convert [recursively] to a private subtree"
59//usage: "\n [un]bindable Make mount point [un]able to be bind mounted"
60//usage: "\n [r]bind Bind a file or directory [recursively] to another location"
61//usage: "\n move Relocate an existing mount point"
62//usage: )
63//usage: "\n remount Remount a mounted filesystem, changing flags"
64//usage: "\n ro/rw Same as -r/-w"
65//usage: "\n"
66//usage: "\nThere are filesystem-specific -o flags."
67//usage:
68//usage:#define mount_example_usage
69//usage: "$ mount\n"
70//usage: "/dev/hda3 on / type minix (rw)\n"
71//usage: "proc on /proc type proc (rw)\n"
72//usage: "devpts on /dev/pts type devpts (rw)\n"
73//usage: "$ mount /dev/fd0 /mnt -t msdos -o ro\n"
74//usage: "$ mount /tmp/diskimage /opt -t ext2 -o loop\n"
75//usage: "$ mount cd_image.iso mydir\n"
76//usage:#define mount_notes_usage
77//usage: "Returns 0 for success, number of failed mounts for -a, or errno for one mount."
78
19#include <mntent.h> 79#include <mntent.h>
20#include <syslog.h> 80#include <syslog.h>
21#include <sys/mount.h> 81#include <sys/mount.h>
diff --git a/util-linux/pivot_root.c b/util-linux/pivot_root.c
index ac52a7aed..83f01fabd 100644
--- a/util-linux/pivot_root.c
+++ b/util-linux/pivot_root.c
@@ -8,6 +8,13 @@
8 * 8 *
9 * Licensed under GPLv2, see file LICENSE in this source tree. 9 * Licensed under GPLv2, see file LICENSE in this source tree.
10 */ 10 */
11
12//usage:#define pivot_root_trivial_usage
13//usage: "NEW_ROOT PUT_OLD"
14//usage:#define pivot_root_full_usage "\n\n"
15//usage: "Move the current root file system to PUT_OLD and make NEW_ROOT\n"
16//usage: "the new root file system"
17
11#include "libbb.h" 18#include "libbb.h"
12 19
13extern int pivot_root(const char * new_root,const char * put_old); 20extern int pivot_root(const char * new_root,const char * put_old);
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index 2c3de74bc..628df0da7 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -8,6 +8,14 @@
8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9*/ 9*/
10 10
11//usage:#define rdate_trivial_usage
12//usage: "[-sp] HOST"
13//usage:#define rdate_full_usage "\n\n"
14//usage: "Get and possibly set the system date and time from a remote HOST\n"
15//usage: "\nOptions:"
16//usage: "\n -s Set the system date and time (default)"
17//usage: "\n -p Print the date and time"
18
11#include "libbb.h" 19#include "libbb.h"
12 20
13enum { RFC_868_BIAS = 2208988800UL }; 21enum { RFC_868_BIAS = 2208988800UL };
diff --git a/util-linux/rdev.c b/util-linux/rdev.c
index 2fbb4d377..1212f841e 100644
--- a/util-linux/rdev.c
+++ b/util-linux/rdev.c
@@ -9,6 +9,15 @@
9 * 9 *
10 */ 10 */
11 11
12//usage:#define rdev_trivial_usage
13//usage: ""
14//usage:#define rdev_full_usage "\n\n"
15//usage: "Print the device node associated with the filesystem mounted at '/'"
16//usage:
17//usage:#define rdev_example_usage
18//usage: "$ rdev\n"
19//usage: "/dev/mtdblock9 /\n"
20
12#include "libbb.h" 21#include "libbb.h"
13 22
14int rdev_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 23int rdev_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c
index f8a6e0cd0..7b7aa7c9f 100644
--- a/util-linux/readprofile.c
+++ b/util-linux/readprofile.c
@@ -32,6 +32,21 @@
32 * Paul Mundt <lethal@linux-sh.org>. 32 * Paul Mundt <lethal@linux-sh.org>.
33 */ 33 */
34 34
35//usage:#define readprofile_trivial_usage
36//usage: "[OPTIONS]"
37//usage:#define readprofile_full_usage "\n\n"
38//usage: "Options:"
39//usage: "\n -m mapfile (Default: /boot/System.map)"
40//usage: "\n -p profile (Default: /proc/profile)"
41//usage: "\n -M NUM Set the profiling multiplier to NUM"
42//usage: "\n -i Print only info about the sampling step"
43//usage: "\n -v Verbose"
44//usage: "\n -a Print all symbols, even if count is 0"
45//usage: "\n -b Print individual histogram-bin counts"
46//usage: "\n -s Print individual counters within functions"
47//usage: "\n -r Reset all the counters (root only)"
48//usage: "\n -n Disable byte order auto-detection"
49
35#include "libbb.h" 50#include "libbb.h"
36#include <sys/utsname.h> 51#include <sys/utsname.h>
37 52
diff --git a/util-linux/rtcwake.c b/util-linux/rtcwake.c
index 06ed7eafc..735a29822 100644
--- a/util-linux/rtcwake.c
+++ b/util-linux/rtcwake.c
@@ -23,6 +23,29 @@
23 * That flag should not be needed on systems with adjtime support. 23 * That flag should not be needed on systems with adjtime support.
24 */ 24 */
25 25
26//usage:#define rtcwake_trivial_usage
27//usage: "[-a | -l | -u] [-d DEV] [-m MODE] [-s SEC | -t TIME]"
28//usage:#define rtcwake_full_usage "\n\n"
29//usage: "Enter a system sleep state until specified wakeup time\n"
30//usage: IF_LONG_OPTS(
31//usage: "\n -a,--auto Read clock mode from adjtime"
32//usage: "\n -l,--local Clock is set to local time"
33//usage: "\n -u,--utc Clock is set to UTC time"
34//usage: "\n -d,--device=DEV Specify the RTC device"
35//usage: "\n -m,--mode=MODE Set the sleep state (default: standby)"
36//usage: "\n -s,--seconds=SEC Set the timeout in SEC seconds from now"
37//usage: "\n -t,--time=TIME Set the timeout to TIME seconds from epoch"
38//usage: )
39//usage: IF_NOT_LONG_OPTS(
40//usage: "\n -a Read clock mode from adjtime"
41//usage: "\n -l Clock is set to local time"
42//usage: "\n -u Clock is set to UTC time"
43//usage: "\n -d DEV Specify the RTC device"
44//usage: "\n -m MODE Set the sleep state (default: standby)"
45//usage: "\n -s SEC Set the timeout in SEC seconds from now"
46//usage: "\n -t TIME Set the timeout to TIME seconds from epoch"
47//usage: )
48
26#include "libbb.h" 49#include "libbb.h"
27#include "rtc_.h" 50#include "rtc_.h"
28 51
diff --git a/util-linux/script.c b/util-linux/script.c
index 47efc4526..26f16ebf5 100644
--- a/util-linux/script.c
+++ b/util-linux/script.c
@@ -10,6 +10,19 @@
10 * 10 *
11 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 11 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
12 */ 12 */
13
14//usage:#define script_trivial_usage
15//usage: "[-afq" IF_SCRIPTREPLAY("t") "] [-c PROG] [OUTFILE]"
16//usage:#define script_full_usage "\n\n"
17//usage: "Options:"
18//usage: "\n -a Append output"
19//usage: "\n -c PROG Run PROG, not shell"
20//usage: "\n -f Flush output after each write"
21//usage: "\n -q Quiet"
22//usage: IF_SCRIPTREPLAY(
23//usage: "\n -t Send timing to stderr"
24//usage: )
25
13#include "libbb.h" 26#include "libbb.h"
14 27
15int script_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 28int script_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/util-linux/scriptreplay.c b/util-linux/scriptreplay.c
index 6eaba43fa..382f56d9a 100644
--- a/util-linux/scriptreplay.c
+++ b/util-linux/scriptreplay.c
@@ -7,6 +7,12 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 * 8 *
9 */ 9 */
10
11//usage:#define scriptreplay_trivial_usage
12//usage: "timingfile [typescript [divisor]]"
13//usage:#define scriptreplay_full_usage "\n\n"
14//usage: "Play back typescripts, using timing information"
15
10#include "libbb.h" 16#include "libbb.h"
11 17
12int scriptreplay_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 18int scriptreplay_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/util-linux/setarch.c b/util-linux/setarch.c
index 7d5dc247c..7b9421af1 100644
--- a/util-linux/setarch.c
+++ b/util-linux/setarch.c
@@ -5,7 +5,20 @@
5 * Copyright 2002 Andi Kleen, SuSE Labs. 5 * Copyright 2002 Andi Kleen, SuSE Labs.
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8*/ 8 */
9
10//usage:#define setarch_trivial_usage
11//usage: "personality PROG ARGS"
12//usage:#define setarch_full_usage "\n\n"
13//usage: "Personality may be:\n"
14//usage: " linux32 Set 32bit uname emulation\n"
15//usage: " linux64 Set 64bit uname emulation"
16//usage:
17//usage:#define linux32_trivial_usage NOUSAGE_STR
18//usage:#define linux32_full_usage ""
19//usage:
20//usage:#define linux64_trivial_usage NOUSAGE_STR
21//usage:#define linux64_full_usage ""
9 22
10#include <sys/personality.h> 23#include <sys/personality.h>
11 24
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index e2c060f30..b7cf69833 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -7,6 +7,23 @@
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define swapon_trivial_usage
11//usage: "[-a]" IF_FEATURE_SWAPON_PRI(" [-p PRI]") " [DEVICE]"
12//usage:#define swapon_full_usage "\n\n"
13//usage: "Start swapping on DEVICE\n"
14//usage: "\nOptions:"
15//usage: "\n -a Start swapping on all swap devices"
16//usage: IF_FEATURE_SWAPON_PRI(
17//usage: "\n -p PRI Set swap device priority"
18//usage: )
19//usage:
20//usage:#define swapoff_trivial_usage
21//usage: "[-a] [DEVICE]"
22//usage:#define swapoff_full_usage "\n\n"
23//usage: "Stop swapping on DEVICE\n"
24//usage: "\nOptions:"
25//usage: "\n -a Stop swapping on all swap devices"
26
10#include "libbb.h" 27#include "libbb.h"
11#include <mntent.h> 28#include <mntent.h>
12#include <sys/swap.h> 29#include <sys/swap.h>
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c
index d471437fd..7794de18d 100644
--- a/util-linux/switch_root.c
+++ b/util-linux/switch_root.c
@@ -5,6 +5,16 @@
5 * 5 *
6 * Licensed under GPLv2, see file LICENSE in this source tree. 6 * Licensed under GPLv2, see file LICENSE in this source tree.
7 */ 7 */
8
9//usage:#define switch_root_trivial_usage
10//usage: "[-c /dev/console] NEW_ROOT NEW_INIT [ARGS]"
11//usage:#define switch_root_full_usage "\n\n"
12//usage: "Free initramfs and switch to another root fs:\n"
13//usage: "chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /,\n"
14//usage: "execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint.\n"
15//usage: "\nOptions:"
16//usage: "\n -c DEV Reopen stdio to DEV after switch"
17
8#include <sys/vfs.h> 18#include <sys/vfs.h>
9#include <sys/mount.h> 19#include <sys/mount.h>
10#include "libbb.h" 20#include "libbb.h"
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 5597d9eba..1e576ca4e 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -7,6 +7,28 @@
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10
11//usage:#define umount_trivial_usage
12//usage: "[OPTIONS] FILESYSTEM|DIRECTORY"
13//usage:#define umount_full_usage "\n\n"
14//usage: "Unmount file systems\n"
15//usage: "\nOptions:"
16//usage: IF_FEATURE_UMOUNT_ALL(
17//usage: "\n -a Unmount all file systems" IF_FEATURE_MTAB_SUPPORT(" in /etc/mtab")
18//usage: )
19//usage: IF_FEATURE_MTAB_SUPPORT(
20//usage: "\n -n Don't erase /etc/mtab entries"
21//usage: )
22//usage: "\n -r Try to remount devices as read-only if mount is busy"
23//usage: "\n -l Lazy umount (detach filesystem)"
24//usage: "\n -f Force umount (i.e., unreachable NFS server)"
25//usage: IF_FEATURE_MOUNT_LOOP(
26//usage: "\n -d Free loop device if it has been used"
27//usage: )
28//usage:
29//usage:#define umount_example_usage
30//usage: "$ umount /dev/hdc1\n"
31
10#include <mntent.h> 32#include <mntent.h>
11#include <sys/mount.h> 33#include <sys/mount.h>
12#include "libbb.h" 34#include "libbb.h"