aboutsummaryrefslogtreecommitdiff
path: root/ps.c
diff options
context:
space:
mode:
Diffstat (limited to 'ps.c')
-rw-r--r--ps.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/ps.c b/ps.c
index b070e3984..74e79f5f8 100644
--- a/ps.c
+++ b/ps.c
@@ -114,6 +114,13 @@ static void parse_proc_status(char *S, proc_t * P)
114 114
115} 115}
116 116
117const 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
118extern int ps_main(int argc, char **argv) 125extern 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);