diff options
Diffstat (limited to 'procps')
-rw-r--r-- | procps/free.c | 16 | ||||
-rw-r--r-- | procps/ps.c | 19 |
2 files changed, 18 insertions, 17 deletions
diff --git a/procps/free.c b/procps/free.c index 997430b39..7c9d7f10a 100644 --- a/procps/free.c +++ b/procps/free.c | |||
@@ -25,6 +25,12 @@ | |||
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | 27 | ||
28 | const char free_usage[] = | ||
29 | "free\n" | ||
30 | #ifndef BB_FEATURE_TRIVIAL_HELP | ||
31 | "\nDisplays the amount of free and used system memory\n" | ||
32 | #endif | ||
33 | ; | ||
28 | 34 | ||
29 | extern int free_main(int argc, char **argv) | 35 | extern int free_main(int argc, char **argv) |
30 | { | 36 | { |
@@ -53,14 +59,8 @@ extern int free_main(int argc, char **argv) | |||
53 | info.sharedram*=info.mem_unit; | 59 | info.sharedram*=info.mem_unit; |
54 | info.bufferram*=info.mem_unit; | 60 | info.bufferram*=info.mem_unit; |
55 | } | 61 | } |
56 | if (argc > 1 && **(argv + 1) == '-') { | 62 | if (argc > 1 && **(argv + 1) == '-') |
57 | usage("free\n" | 63 | usage(free_usage); |
58 | #ifndef BB_FEATURE_TRIVIAL_HELP | ||
59 | "\nDisplays the amount of free and used system memory\n" | ||
60 | #endif | ||
61 | ); | ||
62 | } | ||
63 | |||
64 | 64 | ||
65 | printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free", | 65 | printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free", |
66 | "shared", "buffers"); | 66 | "shared", "buffers"); |
diff --git a/procps/ps.c b/procps/ps.c index b070e3984..74e79f5f8 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -114,6 +114,13 @@ static void parse_proc_status(char *S, proc_t * P) | |||
114 | 114 | ||
115 | } | 115 | } |
116 | 116 | ||
117 | const char ps_usage[] = | ||
118 | "ps\n" | ||
119 | #ifndef BB_FEATURE_TRIVIAL_HELP | ||
120 | "\nReport process status\n" | ||
121 | "\nThis version of ps accepts no options.\n" | ||
122 | #endif | ||
123 | ; | ||
117 | 124 | ||
118 | extern int ps_main(int argc, char **argv) | 125 | extern int ps_main(int argc, char **argv) |
119 | { | 126 | { |
@@ -134,14 +141,8 @@ extern int ps_main(int argc, char **argv) | |||
134 | 141 | ||
135 | 142 | ||
136 | 143 | ||
137 | if (argc > 1 && strcmp(argv[1], dash_dash_help) == 0) { | 144 | if (argc > 1 && strcmp(argv[1], dash_dash_help) == 0) |
138 | usage ("ps\n" | 145 | usage(ps_usage); |
139 | #ifndef BB_FEATURE_TRIVIAL_HELP | ||
140 | "\nReport process status\n" | ||
141 | "\nThis version of ps accepts no options.\n" | ||
142 | #endif | ||
143 | ); | ||
144 | } | ||
145 | 146 | ||
146 | dir = opendir("/proc"); | 147 | dir = opendir("/proc"); |
147 | if (!dir) | 148 | if (!dir) |
@@ -223,7 +224,7 @@ extern int ps_main(int argc, char **argv) | |||
223 | #endif | 224 | #endif |
224 | 225 | ||
225 | if (argc > 1 && **(argv + 1) == '-') | 226 | if (argc > 1 && **(argv + 1) == '-') |
226 | usage("ps-devps\n\nReport process status\n\nThis version of ps accepts no options.\n\n"); | 227 | usage(ps_usage); |
227 | 228 | ||
228 | /* open device */ | 229 | /* open device */ |
229 | fd = open(device, O_RDONLY); | 230 | fd = open(device, O_RDONLY); |