diff options
author | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-05-12 19:41:47 +0000 |
---|---|---|
committer | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-05-12 19:41:47 +0000 |
commit | 3a7ad24d94bc8ca3a532664af56e7d6a5bedc073 (patch) | |
tree | 37ef0fb8b142a4925b866c7caa5207b71b4ecae6 /procps | |
parent | 22aaf5064548757d7cd32cd4b7d96c78852cdd0c (diff) | |
download | busybox-w32-3a7ad24d94bc8ca3a532664af56e7d6a5bedc073.tar.gz busybox-w32-3a7ad24d94bc8ca3a532664af56e7d6a5bedc073.tar.bz2 busybox-w32-3a7ad24d94bc8ca3a532664af56e7d6a5bedc073.zip |
Lots of updates. Finished implementing BB_FEATURE_TRIVIAL_HELP
which lets you compile out most of the "--help" output, saving
up to 17k.
Renamed mnc to nc.
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@532 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'procps')
-rw-r--r-- | procps/free.c | 8 | ||||
-rw-r--r-- | procps/kill.c | 18 | ||||
-rw-r--r-- | procps/ps.c | 12 |
3 files changed, 30 insertions, 8 deletions
diff --git a/procps/free.c b/procps/free.c index 39594dbe5..e6f130ea9 100644 --- a/procps/free.c +++ b/procps/free.c | |||
@@ -37,6 +37,14 @@ extern int free_main(int argc, char **argv) | |||
37 | info.sharedram/=DIVISOR; | 37 | info.sharedram/=DIVISOR; |
38 | info.bufferram/=DIVISOR; | 38 | info.bufferram/=DIVISOR; |
39 | 39 | ||
40 | if (argc > 1 && **(argv + 1) == '-') { | ||
41 | usage("free\n" | ||
42 | #ifndef BB_FEATURE_TRIVIAL_HELP | ||
43 | "\nDisplays the amount of free and used system memory\n" | ||
44 | #endif | ||
45 | ); | ||
46 | } | ||
47 | |||
40 | 48 | ||
41 | printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free", | 49 | printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free", |
42 | "shared", "buffers"); | 50 | "shared", "buffers"); |
diff --git a/procps/kill.c b/procps/kill.c index 93f02eab4..0487f6a66 100644 --- a/procps/kill.c +++ b/procps/kill.c | |||
@@ -32,16 +32,22 @@ | |||
32 | #include <unistd.h> | 32 | #include <unistd.h> |
33 | 33 | ||
34 | static const char *kill_usage = | 34 | static const char *kill_usage = |
35 | "kill [-signal] process-id [process-id ...]\n\n" | 35 | "kill [-signal] process-id [process-id ...]\n" |
36 | "Send a signal (default is SIGTERM) to the specified process(es).\n\n" | 36 | #ifndef BB_FEATURE_TRIVIAL_HELP |
37 | "Options:\n" "\t-l\tList all signal names and numbers.\n\n"; | 37 | "\nSend a signal (default is SIGTERM) to the specified process(es).\n\n" |
38 | "Options:\n" "\t-l\tList all signal names and numbers.\n\n" | ||
39 | #endif | ||
40 | ; | ||
38 | 41 | ||
39 | #ifdef BB_KILLALL | 42 | #ifdef BB_KILLALL |
40 | static const char *killall_usage = | 43 | static const char *killall_usage = |
41 | "killall [-signal] process-name [process-name ...]\n\n" | 44 | "killall [-signal] process-name [process-name ...]\n" |
42 | "Send a signal (default is SIGTERM) to the specified process(es).\n\n" | 45 | #ifndef BB_FEATURE_TRIVIAL_HELP |
43 | "Options:\n" "\t-l\tList all signal names and numbers.\n\n"; | 46 | "\nSend a signal (default is SIGTERM) to the specified process(es).\n\n" |
47 | "Options:\n" "\t-l\tList all signal names and numbers.\n\n" | ||
48 | #endif | ||
44 | #endif | 49 | #endif |
50 | ; | ||
45 | 51 | ||
46 | #define KILL 0 | 52 | #define KILL 0 |
47 | #define KILLALL 1 | 53 | #define KILLALL 1 |
diff --git a/procps/ps.c b/procps/ps.c index f8cf33b25..0842a22c2 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -36,6 +36,9 @@ | |||
36 | #include <fcntl.h> | 36 | #include <fcntl.h> |
37 | #include <ctype.h> | 37 | #include <ctype.h> |
38 | #include <sys/ioctl.h> | 38 | #include <sys/ioctl.h> |
39 | #define BB_DECLARE_EXTERN | ||
40 | #define bb_need_help | ||
41 | #include "messages.c" | ||
39 | 42 | ||
40 | 43 | ||
41 | #if ! defined BB_FEATURE_USE_DEVPS_PATCH | 44 | #if ! defined BB_FEATURE_USE_DEVPS_PATCH |
@@ -128,8 +131,13 @@ extern int ps_main(int argc, char **argv) | |||
128 | 131 | ||
129 | 132 | ||
130 | 133 | ||
131 | if (argc > 1 && strcmp(argv[1], "--help") == 0) { | 134 | if (argc > 1 && strcmp(argv[1], dash_dash_help) == 0) { |
132 | usage ("ps\n\nReport process status\n\nThis version of ps accepts no options.\n"); | 135 | usage ("ps\n" |
136 | #ifndef BB_FEATURE_TRIVIAL_HELP | ||
137 | "\nReport process status\n" | ||
138 | "\nThis version of ps accepts no options.\n" | ||
139 | #endif | ||
140 | ); | ||
133 | } | 141 | } |
134 | 142 | ||
135 | dir = opendir("/proc"); | 143 | dir = opendir("/proc"); |