diff options
author | Pere Orga <gotrunks@gmail.com> | 2011-04-11 03:29:49 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-04-11 03:29:49 +0200 |
commit | 5bc8c005a8e15c43285bc595a8d404de67a482ac (patch) | |
tree | 98f2d35d1db26f4d8cba5f095ff63bf8e2e8d980 /procps | |
parent | 73ef15cf3894716c1393ed21dee6e6bb2cdbc90f (diff) | |
download | busybox-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>
Diffstat (limited to 'procps')
-rw-r--r-- | procps/free.c | 12 | ||||
-rw-r--r-- | procps/fuser.c | 11 | ||||
-rw-r--r-- | procps/kill.c | 39 | ||||
-rw-r--r-- | procps/pgrep.c | 29 | ||||
-rw-r--r-- | procps/pidof.c | 28 | ||||
-rw-r--r-- | procps/ps.c | 47 | ||||
-rw-r--r-- | procps/renice.c | 10 | ||||
-rw-r--r-- | procps/sysctl.c | 19 | ||||
-rw-r--r-- | procps/uptime.c | 9 | ||||
-rw-r--r-- | procps/watch.c | 14 |
10 files changed, 218 insertions, 0 deletions
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 | ||
14 | struct globals { | 26 | struct 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 | ||
12 | enum { | 40 | enum { |
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 | ||
16 | enum { | 35 | enum { |
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: |