diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-02-14 21:23:06 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-02-14 21:23:06 +0000 |
commit | 67991cf824f8df27e74c92d754fb507681c69ce6 (patch) | |
tree | a0b652f3dc794d1050c1a8de3afb014a621238fa /procps | |
parent | 68be2ab914e1e20fe666bbd22a89a18714be2789 (diff) | |
download | busybox-w32-67991cf824f8df27e74c92d754fb507681c69ce6.tar.gz busybox-w32-67991cf824f8df27e74c92d754fb507681c69ce6.tar.bz2 busybox-w32-67991cf824f8df27e74c92d754fb507681c69ce6.zip |
This patch, put together by Manuel Novoa III, is a merge of work
done by Evin Robertson (bug#1105) and work from Manuel to make
usage messages occupy less space and simplify how usage messages
are displayed.
Diffstat (limited to 'procps')
-rw-r--r-- | procps/free.c | 2 | ||||
-rw-r--r-- | procps/kill.c | 7 | ||||
-rw-r--r-- | procps/ps.c | 2 | ||||
-rw-r--r-- | procps/renice.c | 2 |
4 files changed, 5 insertions, 8 deletions
diff --git a/procps/free.c b/procps/free.c index 17dd38687..d287c03f5 100644 --- a/procps/free.c +++ b/procps/free.c | |||
@@ -46,7 +46,7 @@ extern int free_main(int argc, char **argv) | |||
46 | info.bufferram/=info.mem_unit; | 46 | info.bufferram/=info.mem_unit; |
47 | 47 | ||
48 | if (argc > 1 && **(argv + 1) == '-') | 48 | if (argc > 1 && **(argv + 1) == '-') |
49 | usage(free_usage); | 49 | show_usage(); |
50 | 50 | ||
51 | printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free", | 51 | printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free", |
52 | "shared", "buffers"); | 52 | "shared", "buffers"); |
diff --git a/procps/kill.c b/procps/kill.c index 00a4d5c40..bdd22b52d 100644 --- a/procps/kill.c +++ b/procps/kill.c | |||
@@ -124,22 +124,19 @@ const struct signal_name signames[] = { | |||
124 | extern int kill_main(int argc, char **argv) | 124 | extern int kill_main(int argc, char **argv) |
125 | { | 125 | { |
126 | int whichApp, sig = SIGTERM; | 126 | int whichApp, sig = SIGTERM; |
127 | const char *appUsage; | ||
128 | 127 | ||
129 | #ifdef BB_KILLALL | 128 | #ifdef BB_KILLALL |
130 | /* Figure out what we are trying to do here */ | 129 | /* Figure out what we are trying to do here */ |
131 | whichApp = (strcmp(applet_name, "killall") == 0)? KILLALL : KILL; | 130 | whichApp = (strcmp(applet_name, "killall") == 0)? KILLALL : KILL; |
132 | appUsage = (whichApp == KILLALL)? killall_usage : kill_usage; | ||
133 | #else | 131 | #else |
134 | whichApp = KILL; | 132 | whichApp = KILL; |
135 | appUsage = kill_usage; | ||
136 | #endif | 133 | #endif |
137 | 134 | ||
138 | argc--; | 135 | argc--; |
139 | argv++; | 136 | argv++; |
140 | /* Parse any options */ | 137 | /* Parse any options */ |
141 | if (argc < 1) | 138 | if (argc < 1) |
142 | usage(appUsage); | 139 | show_usage(); |
143 | 140 | ||
144 | while (argc > 0 && **argv == '-') { | 141 | while (argc > 0 && **argv == '-') { |
145 | while (*++(*argv)) { | 142 | while (*++(*argv)) { |
@@ -163,7 +160,7 @@ extern int kill_main(int argc, char **argv) | |||
163 | } | 160 | } |
164 | break; | 161 | break; |
165 | case '-': | 162 | case '-': |
166 | usage(appUsage); | 163 | show_usage(); |
167 | default: | 164 | default: |
168 | { | 165 | { |
169 | if (isdigit(**argv)) { | 166 | if (isdigit(**argv)) { |
diff --git a/procps/ps.c b/procps/ps.c index eabdef407..dd154af9d 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -207,7 +207,7 @@ extern int ps_main(int argc, char **argv) | |||
207 | #endif | 207 | #endif |
208 | 208 | ||
209 | if (argc > 1 && **(argv + 1) == '-') | 209 | if (argc > 1 && **(argv + 1) == '-') |
210 | usage(ps_usage); | 210 | show_usage(); |
211 | 211 | ||
212 | /* open device */ | 212 | /* open device */ |
213 | fd = open(device, O_RDONLY); | 213 | fd = open(device, O_RDONLY); |
diff --git a/procps/renice.c b/procps/renice.c index 9d85ba0d0..9180ebf81 100644 --- a/procps/renice.c +++ b/procps/renice.c | |||
@@ -32,7 +32,7 @@ extern int renice_main(int argc, char **argv) | |||
32 | { | 32 | { |
33 | int prio, status = EXIT_SUCCESS; | 33 | int prio, status = EXIT_SUCCESS; |
34 | 34 | ||
35 | if (argc < 3) usage(renice_usage); | 35 | if (argc < 3) show_usage(); |
36 | 36 | ||
37 | prio = atoi(*++argv); | 37 | prio = atoi(*++argv); |
38 | if (prio > 20) prio = 20; | 38 | if (prio > 20) prio = 20; |