aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2000-07-14 23:28:47 +0000
committerMatt Kraai <kraai@debian.org>2000-07-14 23:28:47 +0000
commit3bd8bd89ee9d0b65bf279e1ecad826a5f2f0a217 (patch)
tree6a217bf17e7c00e98a47f657015535f21b53cedd
parent464c5de00d3dfb5f01e866f703d95bbb2bb9443c (diff)
downloadbusybox-w32-3bd8bd89ee9d0b65bf279e1ecad826a5f2f0a217.tar.gz
busybox-w32-3bd8bd89ee9d0b65bf279e1ecad826a5f2f0a217.tar.bz2
busybox-w32-3bd8bd89ee9d0b65bf279e1ecad826a5f2f0a217.zip
Don't use strings directly in calls to usage(). This is in preparation
for their extraction to a separate file.
-rw-r--r--chvt.c15
-rw-r--r--console-tools/chvt.c15
-rw-r--r--console-tools/deallocvt.c16
-rw-r--r--coreutils/cut.c26
-rw-r--r--coreutils/dirname.c16
-rw-r--r--coreutils/length.c16
-rw-r--r--coreutils/rmdir.c16
-rw-r--r--coreutils/sync.c16
-rw-r--r--coreutils/test.c20
-rw-r--r--coreutils/yes.c16
-rw-r--r--cp_mv.c34
-rw-r--r--cut.c26
-rw-r--r--deallocvt.c16
-rw-r--r--dirname.c16
-rw-r--r--findutils/which.c15
-rw-r--r--free.c16
-rw-r--r--fsck_minix.c33
-rw-r--r--length.c16
-rw-r--r--miscutils/mktemp.c16
-rw-r--r--mkfs_minix.c32
-rw-r--r--mktemp.c16
-rw-r--r--procps/free.c16
-rw-r--r--procps/ps.c19
-rw-r--r--ps.c19
-rw-r--r--rmdir.c16
-rw-r--r--sync.c16
-rw-r--r--test.c20
-rw-r--r--util-linux/fsck_minix.c33
-rw-r--r--util-linux/mkfs_minix.c32
-rw-r--r--which.c15
-rw-r--r--yes.c16
31 files changed, 321 insertions, 289 deletions
diff --git a/chvt.c b/chvt.c
index c5c86b613..ab0e9218f 100644
--- a/chvt.c
+++ b/chvt.c
@@ -15,18 +15,19 @@
15#define VT_ACTIVATE 0x5606 /* make vt active */ 15#define VT_ACTIVATE 0x5606 /* make vt active */
16#define VT_WAITACTIVE 0x5607 /* wait for vt active */ 16#define VT_WAITACTIVE 0x5607 /* wait for vt active */
17 17
18const char chvt_usage[] =
19 "chvt N\n"
20#ifndef BB_FEATURE_TRIVIAL_HELP
21 "\nChanges the foreground virtual terminal to /dev/ttyN\n"
22#endif
23 ;
18 24
19int chvt_main(int argc, char **argv) 25int chvt_main(int argc, char **argv)
20{ 26{
21 int fd, num; 27 int fd, num;
22 28
23 if ((argc != 2) || (**(argv + 1) == '-')) { 29 if ((argc != 2) || (**(argv + 1) == '-'))
24 usage ("chvt N\n" 30 usage (chvt_usage);
25#ifndef BB_FEATURE_TRIVIAL_HELP
26 "\nChanges the foreground virtual terminal to /dev/ttyN\n"
27#endif
28 );
29 }
30 fd = get_console_fd("/dev/console"); 31 fd = get_console_fd("/dev/console");
31 num = atoi(argv[1]); 32 num = atoi(argv[1]);
32 if (ioctl(fd, VT_ACTIVATE, num)) { 33 if (ioctl(fd, VT_ACTIVATE, num)) {
diff --git a/console-tools/chvt.c b/console-tools/chvt.c
index c5c86b613..ab0e9218f 100644
--- a/console-tools/chvt.c
+++ b/console-tools/chvt.c
@@ -15,18 +15,19 @@
15#define VT_ACTIVATE 0x5606 /* make vt active */ 15#define VT_ACTIVATE 0x5606 /* make vt active */
16#define VT_WAITACTIVE 0x5607 /* wait for vt active */ 16#define VT_WAITACTIVE 0x5607 /* wait for vt active */
17 17
18const char chvt_usage[] =
19 "chvt N\n"
20#ifndef BB_FEATURE_TRIVIAL_HELP
21 "\nChanges the foreground virtual terminal to /dev/ttyN\n"
22#endif
23 ;
18 24
19int chvt_main(int argc, char **argv) 25int chvt_main(int argc, char **argv)
20{ 26{
21 int fd, num; 27 int fd, num;
22 28
23 if ((argc != 2) || (**(argv + 1) == '-')) { 29 if ((argc != 2) || (**(argv + 1) == '-'))
24 usage ("chvt N\n" 30 usage (chvt_usage);
25#ifndef BB_FEATURE_TRIVIAL_HELP
26 "\nChanges the foreground virtual terminal to /dev/ttyN\n"
27#endif
28 );
29 }
30 fd = get_console_fd("/dev/console"); 31 fd = get_console_fd("/dev/console");
31 num = atoi(argv[1]); 32 num = atoi(argv[1]);
32 if (ioctl(fd, VT_ACTIVATE, num)) { 33 if (ioctl(fd, VT_ACTIVATE, num)) {
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c
index 906f3a9fa..042de8649 100644
--- a/console-tools/deallocvt.c
+++ b/console-tools/deallocvt.c
@@ -13,19 +13,19 @@
13/* From <linux/vt.h> */ 13/* From <linux/vt.h> */
14#define VT_DISALLOCATE 0x5608 /* free memory associated to vt */ 14#define VT_DISALLOCATE 0x5608 /* free memory associated to vt */
15 15
16const char deallocvt_usage[] =
17 "deallocvt N\n"
18#ifndef BB_FEATURE_TRIVIAL_HELP
19 "\nDeallocate unused virtual terminal /dev/ttyN\n"
20#endif
21 ;
16 22
17int deallocvt_main(int argc, char *argv[]) 23int deallocvt_main(int argc, char *argv[])
18{ 24{
19 int fd, num, i; 25 int fd, num, i;
20 26
21 if ((argc != 2) || (**(argv + 1) == '-')) { 27 if ((argc != 2) || (**(argv + 1) == '-'))
22 usage 28 usage(deallocvt_usage);
23 ("deallocvt N\n"
24#ifndef BB_FEATURE_TRIVIAL_HELP
25 "\nDeallocate unused virtual terminal /dev/ttyN\n"
26#endif
27 );
28 }
29 29
30 fd = get_console_fd("/dev/console"); 30 fd = get_console_fd("/dev/console");
31 31
diff --git a/coreutils/cut.c b/coreutils/cut.c
index 783d526a5..08b4586a4 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -206,6 +206,19 @@ void cut()
206 } 206 }
207} 207}
208 208
209const char cut_usage[] =
210 "cut [OPTION]... [FILE]...\n"
211#ifndef BB_FEATURE_TRIVIAL_HELP
212 "\nPrints selected fields from each input FILE to standard output.\n\n"
213 "Options:\n"
214 "\t-b LIST\tOutput only bytes from LIST\n"
215 "\t-c LIST\tOutput only characters from LIST\n"
216 "\t-d CHAR\tUse CHAR instead of tab as the field delimiter\n"
217 "\t-s\tOnly output Lines if the include DELIM\n"
218 "\t-f N\tPrint only these fields\n"
219 "\t-n\tIgnored\n"
220#endif
221 ;
209 222
210int cut_main(int argc, char **argv) 223int cut_main(int argc, char **argv)
211{ 224{
@@ -213,18 +226,7 @@ int cut_main(int argc, char **argv)
213 int numberFilenames = 0; 226 int numberFilenames = 0;
214 227
215 if (argc == 1 || strcmp(argv[1], dash_dash_help)==0) 228 if (argc == 1 || strcmp(argv[1], dash_dash_help)==0)
216 usage( "cut [OPTION]... [FILE]...\n" 229 usage(cut_usage);
217#ifndef BB_FEATURE_TRIVIAL_HELP
218 "\nPrints selected fields from each input FILE to standard output.\n\n"
219 "Options:\n"
220 "\t-b LIST\tOutput only bytes from LIST\n"
221 "\t-c LIST\tOutput only characters from LIST\n"
222 "\t-d CHAR\tUse CHAR instead of tab as the field delimiter\n"
223 "\t-s\tOnly output Lines if the include DELIM\n"
224 "\t-f N\tPrint only these fields\n"
225 "\t-n\tIgnored\n"
226#endif
227 );
228 230
229 while (i < argc) { 231 while (i < argc) {
230 if (argv[i][0] == '-') { 232 if (argv[i][0] == '-') {
diff --git a/coreutils/dirname.c b/coreutils/dirname.c
index 847842eab..0b60ceb88 100644
--- a/coreutils/dirname.c
+++ b/coreutils/dirname.c
@@ -23,17 +23,19 @@
23#include "internal.h" 23#include "internal.h"
24#include <stdio.h> 24#include <stdio.h>
25 25
26const char dirname_usage[] =
27 "dirname [FILENAME ...]\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nStrips non-directory suffix from FILENAME\n"
30#endif
31 ;
32
26extern int dirname_main(int argc, char **argv) 33extern int dirname_main(int argc, char **argv)
27{ 34{
28 char* s; 35 char* s;
29 36
30 if ((argc < 2) || (**(argv + 1) == '-')) { 37 if ((argc < 2) || (**(argv + 1) == '-'))
31 usage("dirname [FILENAME ...]\n" 38 usage(dirname_usage);
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\nStrips non-directory suffix from FILENAME\n"
34#endif
35 );
36 }
37 argv++; 39 argv++;
38 40
39 s=*argv+strlen(*argv)-1; 41 s=*argv+strlen(*argv)-1;
diff --git a/coreutils/length.c b/coreutils/length.c
index c7df21611..82f50c159 100644
--- a/coreutils/length.c
+++ b/coreutils/length.c
@@ -4,15 +4,17 @@
4#include <string.h> 4#include <string.h>
5#include <stdio.h> 5#include <stdio.h>
6 6
7extern int length_main(int argc, char **argv) 7const char length_usage[] =
8{ 8 "length STRING\n"
9 if (argc != 2 || **(argv + 1) == '-') {
10 usage("length STRING\n"
11#ifndef BB_FEATURE_TRIVIAL_HELP 9#ifndef BB_FEATURE_TRIVIAL_HELP
12 "\nPrints out the length of the specified STRING.\n" 10 "\nPrints out the length of the specified STRING.\n"
13#endif 11#endif
14 ); 12 ;
15 } 13
14extern int length_main(int argc, char **argv)
15{
16 if (argc != 2 || **(argv + 1) == '-')
17 usage(length_usage);
16 printf("%lu\n", (long)strlen(argv[1])); 18 printf("%lu\n", (long)strlen(argv[1]));
17 return (TRUE); 19 return (TRUE);
18} 20}
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c
index 4edb9b6b3..3c3533fae 100644
--- a/coreutils/rmdir.c
+++ b/coreutils/rmdir.c
@@ -26,17 +26,17 @@
26#include <stdio.h> 26#include <stdio.h>
27#include <errno.h> 27#include <errno.h>
28 28
29const char rmdir_usage[] =
30 "rmdir [OPTION]... DIRECTORY...\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nRemove the DIRECTORY(ies), if they are empty.\n"
33#endif
34 ;
29 35
30extern int rmdir_main(int argc, char **argv) 36extern int rmdir_main(int argc, char **argv)
31{ 37{
32 if (argc == 1 || **(argv + 1) == '-') { 38 if (argc == 1 || **(argv + 1) == '-')
33 usage 39 usage(rmdir_usage);
34 ("rmdir [OPTION]... DIRECTORY...\n"
35#ifndef BB_FEATURE_TRIVIAL_HELP
36 "\nRemove the DIRECTORY(ies), if they are empty.\n"
37#endif
38 );
39 }
40 40
41 while (--argc > 0) { 41 while (--argc > 0) {
42 if (rmdir(*(++argv)) == -1) { 42 if (rmdir(*(++argv)) == -1) {
diff --git a/coreutils/sync.c b/coreutils/sync.c
index db35d72fa..f7c14b04c 100644
--- a/coreutils/sync.c
+++ b/coreutils/sync.c
@@ -24,14 +24,16 @@
24#include "internal.h" 24#include "internal.h"
25#include <stdio.h> 25#include <stdio.h>
26 26
27extern int sync_main(int argc, char **argv) 27const char sync_usage[] =
28{ 28 "sync\n"
29 if (argc > 1 && **(argv + 1) == '-') {
30 usage("sync\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP 29#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nWrite all buffered filesystem blocks to disk.\n" 30 "\nWrite all buffered filesystem blocks to disk.\n"
33#endif 31#endif
34 ); 32 ;
35 } 33
34extern int sync_main(int argc, char **argv)
35{
36 if (argc > 1 && **(argv + 1) == '-')
37 usage(sync_usage);
36 return(sync()); 38 return(sync());
37} 39}
diff --git a/coreutils/test.c b/coreutils/test.c
index 175cb5d05..bf1622cde 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -178,6 +178,15 @@ static int test_eaccess();
178static int is_a_group_member(); 178static int is_a_group_member();
179static void initialize_group_array(); 179static void initialize_group_array();
180 180
181const char test_usage[] =
182 "test EXPRESSION\n"
183 "or [ EXPRESSION ]\n"
184#ifndef BB_FEATURE_TRIVIAL_HELP
185 "\nChecks file types and compares values returning an exit\n"
186 "code determined by the value of EXPRESSION.\n"
187#endif
188 ;
189
181extern int 190extern int
182test_main(int argc, char** argv) 191test_main(int argc, char** argv)
183{ 192{
@@ -188,15 +197,8 @@ test_main(int argc, char** argv)
188 fatalError("missing ]\n"); 197 fatalError("missing ]\n");
189 argv[argc] = NULL; 198 argv[argc] = NULL;
190 } 199 }
191 if (strcmp(argv[1], dash_dash_help) == 0) { 200 if (strcmp(argv[1], dash_dash_help) == 0)
192 usage("test EXPRESSION\n" 201 usage(test_usage);
193 "or [ EXPRESSION ]\n"
194#ifndef BB_FEATURE_TRIVIAL_HELP
195 "\nChecks file types and compares values returning an exit\n"
196 "code determined by the value of EXPRESSION.\n"
197#endif
198 );
199 }
200 202
201 /* Implement special cases from POSIX.2, section 4.62.4 */ 203 /* Implement special cases from POSIX.2, section 4.62.4 */
202 switch (argc) { 204 switch (argc) {
diff --git a/coreutils/yes.c b/coreutils/yes.c
index 1718af4bb..0191bb003 100644
--- a/coreutils/yes.c
+++ b/coreutils/yes.c
@@ -23,17 +23,19 @@
23#include "internal.h" 23#include "internal.h"
24#include <stdio.h> 24#include <stdio.h>
25 25
26const char yes_usage[] =
27 "yes [OPTION]... [STRING]...\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nRepeatedly outputs a line with all specified STRING(s), or `y'.\n"
30#endif
31 ;
32
26extern int yes_main(int argc, char **argv) 33extern int yes_main(int argc, char **argv)
27{ 34{
28 int i; 35 int i;
29 36
30 if (argc >= 2 && *argv[1] == '-') { 37 if (argc >= 2 && *argv[1] == '-')
31 usage("yes [OPTION]... [STRING]...\n" 38 usage(yes_usage);
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\nRepeatedly outputs a line with all specified STRING(s), or `y'.\n"
34#endif
35 );
36 }
37 39
38 if (argc == 1) { 40 if (argc == 1) {
39 while (1) 41 while (1)
diff --git a/cp_mv.c b/cp_mv.c
index a0d677c45..72ba537c5 100644
--- a/cp_mv.c
+++ b/cp_mv.c
@@ -46,25 +46,33 @@
46#define is_cp 0 46#define is_cp 0
47#define is_mv 1 47#define is_mv 1
48static int dz_i; /* index into cp_mv_usage */ 48static int dz_i; /* index into cp_mv_usage */
49static const char *cp_mv_usage[] = /* .rodata */ 49
50{ 50const char cp_usage[] =
51 "cp [OPTION]... SOURCE DEST\n" 51 "cp [OPTION]... SOURCE DEST\n"
52 " or: cp [OPTION]... SOURCE... DIRECTORY\n" 52 " or: cp [OPTION]... SOURCE... DIRECTORY\n"
53#ifndef BB_FEATURE_TRIVIAL_HELP 53#ifndef BB_FEATURE_TRIVIAL_HELP
54 "\nCopies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n" 54 "\nCopies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n"
55 "\n" 55 "\n"
56 "\t-a\tSame as -dpR\n" 56 "\t-a\tSame as -dpR\n"
57 "\t-d\tPreserves links\n" 57 "\t-d\tPreserves links\n"
58 "\t-p\tPreserves file attributes if possible\n" 58 "\t-p\tPreserves file attributes if possible\n"
59 "\t-f\tforce (implied; ignored) - always set\n" 59 "\t-f\tforce (implied; ignored) - always set\n"
60 "\t-R\tCopies directories recursively\n" 60 "\t-R\tCopies directories recursively\n"
61#endif 61#endif
62 , 62 ;
63
64const char mv_usage[] =
63 "mv SOURCE DEST\n" 65 "mv SOURCE DEST\n"
64 " or: mv SOURCE... DIRECTORY\n" 66 " or: mv SOURCE... DIRECTORY\n"
65#ifndef BB_FEATURE_TRIVIAL_HELP 67#ifndef BB_FEATURE_TRIVIAL_HELP
66 "\nRename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n" 68 "\nRename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n"
67#endif 69#endif
70 ;
71
72static const char *cp_mv_usage[] = /* .rodata */
73{
74 cp_usage,
75 mv_usage
68}; 76};
69 77
70static int recursiveFlag; 78static int recursiveFlag;
diff --git a/cut.c b/cut.c
index 783d526a5..08b4586a4 100644
--- a/cut.c
+++ b/cut.c
@@ -206,6 +206,19 @@ void cut()
206 } 206 }
207} 207}
208 208
209const char cut_usage[] =
210 "cut [OPTION]... [FILE]...\n"
211#ifndef BB_FEATURE_TRIVIAL_HELP
212 "\nPrints selected fields from each input FILE to standard output.\n\n"
213 "Options:\n"
214 "\t-b LIST\tOutput only bytes from LIST\n"
215 "\t-c LIST\tOutput only characters from LIST\n"
216 "\t-d CHAR\tUse CHAR instead of tab as the field delimiter\n"
217 "\t-s\tOnly output Lines if the include DELIM\n"
218 "\t-f N\tPrint only these fields\n"
219 "\t-n\tIgnored\n"
220#endif
221 ;
209 222
210int cut_main(int argc, char **argv) 223int cut_main(int argc, char **argv)
211{ 224{
@@ -213,18 +226,7 @@ int cut_main(int argc, char **argv)
213 int numberFilenames = 0; 226 int numberFilenames = 0;
214 227
215 if (argc == 1 || strcmp(argv[1], dash_dash_help)==0) 228 if (argc == 1 || strcmp(argv[1], dash_dash_help)==0)
216 usage( "cut [OPTION]... [FILE]...\n" 229 usage(cut_usage);
217#ifndef BB_FEATURE_TRIVIAL_HELP
218 "\nPrints selected fields from each input FILE to standard output.\n\n"
219 "Options:\n"
220 "\t-b LIST\tOutput only bytes from LIST\n"
221 "\t-c LIST\tOutput only characters from LIST\n"
222 "\t-d CHAR\tUse CHAR instead of tab as the field delimiter\n"
223 "\t-s\tOnly output Lines if the include DELIM\n"
224 "\t-f N\tPrint only these fields\n"
225 "\t-n\tIgnored\n"
226#endif
227 );
228 230
229 while (i < argc) { 231 while (i < argc) {
230 if (argv[i][0] == '-') { 232 if (argv[i][0] == '-') {
diff --git a/deallocvt.c b/deallocvt.c
index 906f3a9fa..042de8649 100644
--- a/deallocvt.c
+++ b/deallocvt.c
@@ -13,19 +13,19 @@
13/* From <linux/vt.h> */ 13/* From <linux/vt.h> */
14#define VT_DISALLOCATE 0x5608 /* free memory associated to vt */ 14#define VT_DISALLOCATE 0x5608 /* free memory associated to vt */
15 15
16const char deallocvt_usage[] =
17 "deallocvt N\n"
18#ifndef BB_FEATURE_TRIVIAL_HELP
19 "\nDeallocate unused virtual terminal /dev/ttyN\n"
20#endif
21 ;
16 22
17int deallocvt_main(int argc, char *argv[]) 23int deallocvt_main(int argc, char *argv[])
18{ 24{
19 int fd, num, i; 25 int fd, num, i;
20 26
21 if ((argc != 2) || (**(argv + 1) == '-')) { 27 if ((argc != 2) || (**(argv + 1) == '-'))
22 usage 28 usage(deallocvt_usage);
23 ("deallocvt N\n"
24#ifndef BB_FEATURE_TRIVIAL_HELP
25 "\nDeallocate unused virtual terminal /dev/ttyN\n"
26#endif
27 );
28 }
29 29
30 fd = get_console_fd("/dev/console"); 30 fd = get_console_fd("/dev/console");
31 31
diff --git a/dirname.c b/dirname.c
index 847842eab..0b60ceb88 100644
--- a/dirname.c
+++ b/dirname.c
@@ -23,17 +23,19 @@
23#include "internal.h" 23#include "internal.h"
24#include <stdio.h> 24#include <stdio.h>
25 25
26const char dirname_usage[] =
27 "dirname [FILENAME ...]\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nStrips non-directory suffix from FILENAME\n"
30#endif
31 ;
32
26extern int dirname_main(int argc, char **argv) 33extern int dirname_main(int argc, char **argv)
27{ 34{
28 char* s; 35 char* s;
29 36
30 if ((argc < 2) || (**(argv + 1) == '-')) { 37 if ((argc < 2) || (**(argv + 1) == '-'))
31 usage("dirname [FILENAME ...]\n" 38 usage(dirname_usage);
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\nStrips non-directory suffix from FILENAME\n"
34#endif
35 );
36 }
37 argv++; 39 argv++;
38 40
39 s=*argv+strlen(*argv)-1; 41 s=*argv+strlen(*argv)-1;
diff --git a/findutils/which.c b/findutils/which.c
index 8d4422a78..186bfdad7 100644
--- a/findutils/which.c
+++ b/findutils/which.c
@@ -26,6 +26,12 @@
26#include <sys/stat.h> 26#include <sys/stat.h>
27#include <sys/param.h> 27#include <sys/param.h>
28 28
29const char which_usage[] =
30 "which [COMMAND ...]\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nLocates a COMMAND.\n"
33#endif
34 ;
29 35
30extern int which_main(int argc, char **argv) 36extern int which_main(int argc, char **argv)
31{ 37{
@@ -34,13 +40,8 @@ extern int which_main(int argc, char **argv)
34 struct stat filestat; 40 struct stat filestat;
35 int count = 0; 41 int count = 0;
36 42
37 if (argc <= 1 || **(argv + 1) == '-') { 43 if (argc <= 1 || **(argv + 1) == '-')
38 usage("which [COMMAND ...]\n" 44 usage(which_usage);
39#ifndef BB_FEATURE_TRIVIAL_HELP
40 "\nLocates a COMMAND.\n"
41#endif
42 );
43 }
44 argc--; 45 argc--;
45 46
46 path_list = getenv("PATH"); 47 path_list = getenv("PATH");
diff --git a/free.c b/free.c
index 997430b39..7c9d7f10a 100644
--- a/free.c
+++ b/free.c
@@ -25,6 +25,12 @@
25#include <stdio.h> 25#include <stdio.h>
26#include <errno.h> 26#include <errno.h>
27 27
28const 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
29extern int free_main(int argc, char **argv) 35extern 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/fsck_minix.c b/fsck_minix.c
index 74281a71e..ea27c236c 100644
--- a/fsck_minix.c
+++ b/fsck_minix.c
@@ -288,25 +288,24 @@ static void leave(int status)
288 exit(status); 288 exit(status);
289} 289}
290 290
291static void show_usage(void) 291const char fsck_minix_usage[] =
292{ 292 "Usage: fsck.minix [-larvsmf] /dev/name\n"
293 fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n",
294 BB_VER, BB_BT);
295 fprintf(stderr, "Usage: %s [-larvsmf] /dev/name\n", applet_name);
296#ifndef BB_FEATURE_TRIVIAL_HELP 293#ifndef BB_FEATURE_TRIVIAL_HELP
297 fprintf(stderr, 294 "\nPerforms a consistency check for MINIX filesystems.\n\n"
298 "\nPerforms a consistency check for MINIX filesystems.\n\n"); 295 "Options:\n"
299 fprintf(stderr, "Options:\n"); 296 "\t-l\tLists all filenames\n"
300 fprintf(stderr, "\t-l\tLists all filenames\n"); 297 "\t-r\tPerform interactive repairs\n"
301 fprintf(stderr, "\t-r\tPerform interactive repairs\n"); 298 "\t-a\tPerform automatic repairs\n"
302 fprintf(stderr, "\t-a\tPerform automatic repairs\n"); 299 "\t-v\tverbose\n"
303 fprintf(stderr, "\t-v\tverbose\n"); 300 "\t-s\tOutputs super-block information\n"
304 fprintf(stderr, "\t-s\tOutputs super-block information\n"); 301 "\t-m\tActivates MINIX-like \"mode not cleared\" warnings\n"
305 fprintf(stderr, 302 "\t-f\tForce file system check.\n\n"
306 "\t-m\tActivates MINIX-like \"mode not cleared\" warnings\n");
307 fprintf(stderr, "\t-f\tForce file system check.\n\n");
308#endif 303#endif
309 leave(16); 304 ;
305
306static void show_usage(void)
307{
308 usage(fsck_minix_usage);
310} 309}
311 310
312static void die(const char *str) 311static void die(const char *str)
diff --git a/length.c b/length.c
index c7df21611..82f50c159 100644
--- a/length.c
+++ b/length.c
@@ -4,15 +4,17 @@
4#include <string.h> 4#include <string.h>
5#include <stdio.h> 5#include <stdio.h>
6 6
7extern int length_main(int argc, char **argv) 7const char length_usage[] =
8{ 8 "length STRING\n"
9 if (argc != 2 || **(argv + 1) == '-') {
10 usage("length STRING\n"
11#ifndef BB_FEATURE_TRIVIAL_HELP 9#ifndef BB_FEATURE_TRIVIAL_HELP
12 "\nPrints out the length of the specified STRING.\n" 10 "\nPrints out the length of the specified STRING.\n"
13#endif 11#endif
14 ); 12 ;
15 } 13
14extern int length_main(int argc, char **argv)
15{
16 if (argc != 2 || **(argv + 1) == '-')
17 usage(length_usage);
16 printf("%lu\n", (long)strlen(argv[1])); 18 printf("%lu\n", (long)strlen(argv[1]));
17 return (TRUE); 19 return (TRUE);
18} 20}
diff --git a/miscutils/mktemp.c b/miscutils/mktemp.c
index 87792cb18..247d16d24 100644
--- a/miscutils/mktemp.c
+++ b/miscutils/mktemp.c
@@ -26,18 +26,20 @@
26#include <stdio.h> 26#include <stdio.h>
27#include <errno.h> 27#include <errno.h>
28 28
29const char mktemp_usage[] =
30 "mktemp [-q] TEMPLATE\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nCreates a temporary file with its name based on TEMPLATE.\n"
33 "TEMPLATE is any name with six `Xs' (i.e. /tmp/temp.XXXXXX).\n"
34#endif
35 ;
29 36
30extern int mktemp_main(int argc, char **argv) 37extern int mktemp_main(int argc, char **argv)
31{ 38{
32 if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q"))) 39 if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q")))
33 usage ("mktemp [-q] TEMPLATE\n" 40 usage(mktemp_usage);
34#ifndef BB_FEATURE_TRIVIAL_HELP
35 "\nCreates a temporary file with its name based on TEMPLATE.\n"
36 "TEMPLATE is any name with six `Xs' (i.e. /tmp/temp.XXXXXX).\n"
37#endif
38 );
39 if(mkstemp(argv[argc-1]) < 0) 41 if(mkstemp(argv[argc-1]) < 0)
40 exit(FALSE); 42 exit(FALSE);
41 (void) puts(argv[argc-1]); 43 (void) puts(argv[argc-1]);
42 return(TRUE); 44 return(TRUE);
43} 45}
diff --git a/mkfs_minix.c b/mkfs_minix.c
index e4dedaf82..9ae4b569c 100644
--- a/mkfs_minix.c
+++ b/mkfs_minix.c
@@ -267,27 +267,23 @@ static volatile void die(char *str)
267 exit(8); 267 exit(8);
268} 268}
269 269
270const char mkfs_minix_usage[] =
271 "mkfs.minix [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n"
272#ifndef BB_FEATURE_TRIVIAL_HELP
273 "\nMake a MINIX filesystem.\n\n"
274 "Options:\n"
275 "\t-c\t\tCheck the device for bad blocks\n"
276 "\t-n [14|30]\tSpecify the maximum length of filenames\n"
277 "\t-i INODES\tSpecify the number of inodes for the filesystem\n"
278 "\t-l FILENAME\tRead the bad blocks list from FILENAME\n"
279 "\t-v\t\tMake a Minix version 2 filesystem\n\n"
280#endif
281 ;
282
270static volatile void show_usage() __attribute__ ((noreturn)); 283static volatile void show_usage() __attribute__ ((noreturn));
271static volatile void show_usage() 284static volatile void show_usage()
272{ 285{
273 fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n", 286 usage(mkfs_minix_usage);
274 BB_VER, BB_BT);
275 fprintf(stderr,
276 "Usage: %s [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n",
277 applet_name);
278#ifndef BB_FEATURE_TRIVIAL_HELP
279 fprintf(stderr, "\nMake a MINIX filesystem.\n\n");
280 fprintf(stderr, "Options:\n");
281 fprintf(stderr, "\t-c\t\tCheck the device for bad blocks\n");
282 fprintf(stderr,
283 "\t-n [14|30]\tSpecify the maximum length of filenames\n");
284 fprintf(stderr,
285 "\t-i INODES\tSpecify the number of inodes for the filesystem\n");
286 fprintf(stderr,
287 "\t-l FILENAME\tRead the bad blocks list from FILENAME\n");
288 fprintf(stderr, "\t-v\t\tMake a Minix version 2 filesystem\n\n");
289#endif
290 exit(16);
291} 287}
292 288
293/* 289/*
diff --git a/mktemp.c b/mktemp.c
index 87792cb18..247d16d24 100644
--- a/mktemp.c
+++ b/mktemp.c
@@ -26,18 +26,20 @@
26#include <stdio.h> 26#include <stdio.h>
27#include <errno.h> 27#include <errno.h>
28 28
29const char mktemp_usage[] =
30 "mktemp [-q] TEMPLATE\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nCreates a temporary file with its name based on TEMPLATE.\n"
33 "TEMPLATE is any name with six `Xs' (i.e. /tmp/temp.XXXXXX).\n"
34#endif
35 ;
29 36
30extern int mktemp_main(int argc, char **argv) 37extern int mktemp_main(int argc, char **argv)
31{ 38{
32 if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q"))) 39 if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q")))
33 usage ("mktemp [-q] TEMPLATE\n" 40 usage(mktemp_usage);
34#ifndef BB_FEATURE_TRIVIAL_HELP
35 "\nCreates a temporary file with its name based on TEMPLATE.\n"
36 "TEMPLATE is any name with six `Xs' (i.e. /tmp/temp.XXXXXX).\n"
37#endif
38 );
39 if(mkstemp(argv[argc-1]) < 0) 41 if(mkstemp(argv[argc-1]) < 0)
40 exit(FALSE); 42 exit(FALSE);
41 (void) puts(argv[argc-1]); 43 (void) puts(argv[argc-1]);
42 return(TRUE); 44 return(TRUE);
43} 45}
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
28const 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
29extern int free_main(int argc, char **argv) 35extern 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
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);
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);
diff --git a/rmdir.c b/rmdir.c
index 4edb9b6b3..3c3533fae 100644
--- a/rmdir.c
+++ b/rmdir.c
@@ -26,17 +26,17 @@
26#include <stdio.h> 26#include <stdio.h>
27#include <errno.h> 27#include <errno.h>
28 28
29const char rmdir_usage[] =
30 "rmdir [OPTION]... DIRECTORY...\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nRemove the DIRECTORY(ies), if they are empty.\n"
33#endif
34 ;
29 35
30extern int rmdir_main(int argc, char **argv) 36extern int rmdir_main(int argc, char **argv)
31{ 37{
32 if (argc == 1 || **(argv + 1) == '-') { 38 if (argc == 1 || **(argv + 1) == '-')
33 usage 39 usage(rmdir_usage);
34 ("rmdir [OPTION]... DIRECTORY...\n"
35#ifndef BB_FEATURE_TRIVIAL_HELP
36 "\nRemove the DIRECTORY(ies), if they are empty.\n"
37#endif
38 );
39 }
40 40
41 while (--argc > 0) { 41 while (--argc > 0) {
42 if (rmdir(*(++argv)) == -1) { 42 if (rmdir(*(++argv)) == -1) {
diff --git a/sync.c b/sync.c
index db35d72fa..f7c14b04c 100644
--- a/sync.c
+++ b/sync.c
@@ -24,14 +24,16 @@
24#include "internal.h" 24#include "internal.h"
25#include <stdio.h> 25#include <stdio.h>
26 26
27extern int sync_main(int argc, char **argv) 27const char sync_usage[] =
28{ 28 "sync\n"
29 if (argc > 1 && **(argv + 1) == '-') {
30 usage("sync\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP 29#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nWrite all buffered filesystem blocks to disk.\n" 30 "\nWrite all buffered filesystem blocks to disk.\n"
33#endif 31#endif
34 ); 32 ;
35 } 33
34extern int sync_main(int argc, char **argv)
35{
36 if (argc > 1 && **(argv + 1) == '-')
37 usage(sync_usage);
36 return(sync()); 38 return(sync());
37} 39}
diff --git a/test.c b/test.c
index 175cb5d05..bf1622cde 100644
--- a/test.c
+++ b/test.c
@@ -178,6 +178,15 @@ static int test_eaccess();
178static int is_a_group_member(); 178static int is_a_group_member();
179static void initialize_group_array(); 179static void initialize_group_array();
180 180
181const char test_usage[] =
182 "test EXPRESSION\n"
183 "or [ EXPRESSION ]\n"
184#ifndef BB_FEATURE_TRIVIAL_HELP
185 "\nChecks file types and compares values returning an exit\n"
186 "code determined by the value of EXPRESSION.\n"
187#endif
188 ;
189
181extern int 190extern int
182test_main(int argc, char** argv) 191test_main(int argc, char** argv)
183{ 192{
@@ -188,15 +197,8 @@ test_main(int argc, char** argv)
188 fatalError("missing ]\n"); 197 fatalError("missing ]\n");
189 argv[argc] = NULL; 198 argv[argc] = NULL;
190 } 199 }
191 if (strcmp(argv[1], dash_dash_help) == 0) { 200 if (strcmp(argv[1], dash_dash_help) == 0)
192 usage("test EXPRESSION\n" 201 usage(test_usage);
193 "or [ EXPRESSION ]\n"
194#ifndef BB_FEATURE_TRIVIAL_HELP
195 "\nChecks file types and compares values returning an exit\n"
196 "code determined by the value of EXPRESSION.\n"
197#endif
198 );
199 }
200 202
201 /* Implement special cases from POSIX.2, section 4.62.4 */ 203 /* Implement special cases from POSIX.2, section 4.62.4 */
202 switch (argc) { 204 switch (argc) {
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index 74281a71e..ea27c236c 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -288,25 +288,24 @@ static void leave(int status)
288 exit(status); 288 exit(status);
289} 289}
290 290
291static void show_usage(void) 291const char fsck_minix_usage[] =
292{ 292 "Usage: fsck.minix [-larvsmf] /dev/name\n"
293 fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n",
294 BB_VER, BB_BT);
295 fprintf(stderr, "Usage: %s [-larvsmf] /dev/name\n", applet_name);
296#ifndef BB_FEATURE_TRIVIAL_HELP 293#ifndef BB_FEATURE_TRIVIAL_HELP
297 fprintf(stderr, 294 "\nPerforms a consistency check for MINIX filesystems.\n\n"
298 "\nPerforms a consistency check for MINIX filesystems.\n\n"); 295 "Options:\n"
299 fprintf(stderr, "Options:\n"); 296 "\t-l\tLists all filenames\n"
300 fprintf(stderr, "\t-l\tLists all filenames\n"); 297 "\t-r\tPerform interactive repairs\n"
301 fprintf(stderr, "\t-r\tPerform interactive repairs\n"); 298 "\t-a\tPerform automatic repairs\n"
302 fprintf(stderr, "\t-a\tPerform automatic repairs\n"); 299 "\t-v\tverbose\n"
303 fprintf(stderr, "\t-v\tverbose\n"); 300 "\t-s\tOutputs super-block information\n"
304 fprintf(stderr, "\t-s\tOutputs super-block information\n"); 301 "\t-m\tActivates MINIX-like \"mode not cleared\" warnings\n"
305 fprintf(stderr, 302 "\t-f\tForce file system check.\n\n"
306 "\t-m\tActivates MINIX-like \"mode not cleared\" warnings\n");
307 fprintf(stderr, "\t-f\tForce file system check.\n\n");
308#endif 303#endif
309 leave(16); 304 ;
305
306static void show_usage(void)
307{
308 usage(fsck_minix_usage);
310} 309}
311 310
312static void die(const char *str) 311static void die(const char *str)
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index e4dedaf82..9ae4b569c 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -267,27 +267,23 @@ static volatile void die(char *str)
267 exit(8); 267 exit(8);
268} 268}
269 269
270const char mkfs_minix_usage[] =
271 "mkfs.minix [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n"
272#ifndef BB_FEATURE_TRIVIAL_HELP
273 "\nMake a MINIX filesystem.\n\n"
274 "Options:\n"
275 "\t-c\t\tCheck the device for bad blocks\n"
276 "\t-n [14|30]\tSpecify the maximum length of filenames\n"
277 "\t-i INODES\tSpecify the number of inodes for the filesystem\n"
278 "\t-l FILENAME\tRead the bad blocks list from FILENAME\n"
279 "\t-v\t\tMake a Minix version 2 filesystem\n\n"
280#endif
281 ;
282
270static volatile void show_usage() __attribute__ ((noreturn)); 283static volatile void show_usage() __attribute__ ((noreturn));
271static volatile void show_usage() 284static volatile void show_usage()
272{ 285{
273 fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n", 286 usage(mkfs_minix_usage);
274 BB_VER, BB_BT);
275 fprintf(stderr,
276 "Usage: %s [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n",
277 applet_name);
278#ifndef BB_FEATURE_TRIVIAL_HELP
279 fprintf(stderr, "\nMake a MINIX filesystem.\n\n");
280 fprintf(stderr, "Options:\n");
281 fprintf(stderr, "\t-c\t\tCheck the device for bad blocks\n");
282 fprintf(stderr,
283 "\t-n [14|30]\tSpecify the maximum length of filenames\n");
284 fprintf(stderr,
285 "\t-i INODES\tSpecify the number of inodes for the filesystem\n");
286 fprintf(stderr,
287 "\t-l FILENAME\tRead the bad blocks list from FILENAME\n");
288 fprintf(stderr, "\t-v\t\tMake a Minix version 2 filesystem\n\n");
289#endif
290 exit(16);
291} 287}
292 288
293/* 289/*
diff --git a/which.c b/which.c
index 8d4422a78..186bfdad7 100644
--- a/which.c
+++ b/which.c
@@ -26,6 +26,12 @@
26#include <sys/stat.h> 26#include <sys/stat.h>
27#include <sys/param.h> 27#include <sys/param.h>
28 28
29const char which_usage[] =
30 "which [COMMAND ...]\n"
31#ifndef BB_FEATURE_TRIVIAL_HELP
32 "\nLocates a COMMAND.\n"
33#endif
34 ;
29 35
30extern int which_main(int argc, char **argv) 36extern int which_main(int argc, char **argv)
31{ 37{
@@ -34,13 +40,8 @@ extern int which_main(int argc, char **argv)
34 struct stat filestat; 40 struct stat filestat;
35 int count = 0; 41 int count = 0;
36 42
37 if (argc <= 1 || **(argv + 1) == '-') { 43 if (argc <= 1 || **(argv + 1) == '-')
38 usage("which [COMMAND ...]\n" 44 usage(which_usage);
39#ifndef BB_FEATURE_TRIVIAL_HELP
40 "\nLocates a COMMAND.\n"
41#endif
42 );
43 }
44 argc--; 45 argc--;
45 46
46 path_list = getenv("PATH"); 47 path_list = getenv("PATH");
diff --git a/yes.c b/yes.c
index 1718af4bb..0191bb003 100644
--- a/yes.c
+++ b/yes.c
@@ -23,17 +23,19 @@
23#include "internal.h" 23#include "internal.h"
24#include <stdio.h> 24#include <stdio.h>
25 25
26const char yes_usage[] =
27 "yes [OPTION]... [STRING]...\n"
28#ifndef BB_FEATURE_TRIVIAL_HELP
29 "\nRepeatedly outputs a line with all specified STRING(s), or `y'.\n"
30#endif
31 ;
32
26extern int yes_main(int argc, char **argv) 33extern int yes_main(int argc, char **argv)
27{ 34{
28 int i; 35 int i;
29 36
30 if (argc >= 2 && *argv[1] == '-') { 37 if (argc >= 2 && *argv[1] == '-')
31 usage("yes [OPTION]... [STRING]...\n" 38 usage(yes_usage);
32#ifndef BB_FEATURE_TRIVIAL_HELP
33 "\nRepeatedly outputs a line with all specified STRING(s), or `y'.\n"
34#endif
35 );
36 }
37 39
38 if (argc == 1) { 40 if (argc == 1) {
39 while (1) 41 while (1)