aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Whitley <markw@lineo.com>2000-10-19 22:28:06 +0000
committerMark Whitley <markw@lineo.com>2000-10-19 22:28:06 +0000
commit6050618096ab058d29264a6d6b604275b44121bb (patch)
tree5818d62ef16fefe16ea1b4e412ad06a50c87f599
parent69229a6c92a2d73bcee7c06eb79bd0a4f40d4e16 (diff)
downloadbusybox-w32-6050618096ab058d29264a6d6b604275b44121bb.tar.gz
busybox-w32-6050618096ab058d29264a6d6b604275b44121bb.tar.bz2
busybox-w32-6050618096ab058d29264a6d6b604275b44121bb.zip
Put getopt_usage where it belongs and added *_usage entries in busybox.[ch]
-rw-r--r--applets/busybox.c4
-rw-r--r--applets/usage.c19
-rw-r--r--busybox.c4
-rw-r--r--busybox.h1
-rw-r--r--getopt.c16
-rw-r--r--include/busybox.h1
-rw-r--r--usage.c19
-rw-r--r--util-linux/getopt.c16
8 files changed, 44 insertions, 36 deletions
diff --git a/applets/busybox.c b/applets/busybox.c
index d25ddc185..21b8a110e 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -110,7 +110,7 @@ const struct BB_applet applets[] = {
110 {"fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage}, 110 {"fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage},
111#endif 111#endif
112#ifdef BB_GETOPT 112#ifdef BB_GETOPT
113 {"getopt", getopt_main, _BB_DIR_BIN}, 113 {"getopt", getopt_main, _BB_DIR_BIN, getopt_usage},
114#endif 114#endif
115#ifdef BB_GREP 115#ifdef BB_GREP
116 {"grep", grep_main, _BB_DIR_BIN, grep_usage}, 116 {"grep", grep_main, _BB_DIR_BIN, grep_usage},
@@ -245,7 +245,7 @@ const struct BB_applet applets[] = {
245 {"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage}, 245 {"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage},
246#endif 246#endif
247#ifdef BB_RENICE 247#ifdef BB_RENICE
248 {"renice", renice_main, _BB_DIR_USR_BIN}, 248 {"renice", renice_main, _BB_DIR_USR_BIN, renice_usage},
249#endif 249#endif
250#ifdef BB_RESET 250#ifdef BB_RESET
251 {"reset", reset_main, _BB_DIR_USR_BIN, reset_usage}, 251 {"reset", reset_main, _BB_DIR_USR_BIN, reset_usage},
diff --git a/applets/usage.c b/applets/usage.c
index 11326432c..7e3ea8191 100644
--- a/applets/usage.c
+++ b/applets/usage.c
@@ -375,6 +375,24 @@ const char fsck_minix_usage[] =
375 ; 375 ;
376#endif 376#endif
377 377
378#if defined BB_GETOPT
379const char getopt_usage[] =
380"getopt [OPTIONS]...\n"
381#ifndef BB_FEATURE_TRIVIAL_HELP
382"Parse command options\n"
383" -a, --alternative Allow long options starting with single -\n"
384" -l, --longoptions=longopts Long options to be recognized\n"
385" -n, --name=progname The name under which errors are reported\n"
386" -o, --options=optstring Short options to be recognized\n"
387" -q, --quiet Disable error reporting by getopt(3)\n"
388" -Q, --quiet-output No normal output\n"
389" -s, --shell=shell Set shell quoting conventions\n"
390" -T, --test Test for getopt(1) version\n"
391" -u, --unqote Do not quote the output\n"
392#endif
393;
394#endif
395
378#if defined BB_GREP 396#if defined BB_GREP
379const char grep_usage[] = 397const char grep_usage[] =
380 "grep [-ihHnqvs] pattern [files...]\n" 398 "grep [-ihHnqvs] pattern [files...]\n"
@@ -1472,3 +1490,4 @@ const char yes_usage[] =
1472#endif 1490#endif
1473 ; 1491 ;
1474#endif 1492#endif
1493
diff --git a/busybox.c b/busybox.c
index d25ddc185..21b8a110e 100644
--- a/busybox.c
+++ b/busybox.c
@@ -110,7 +110,7 @@ const struct BB_applet applets[] = {
110 {"fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage}, 110 {"fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage},
111#endif 111#endif
112#ifdef BB_GETOPT 112#ifdef BB_GETOPT
113 {"getopt", getopt_main, _BB_DIR_BIN}, 113 {"getopt", getopt_main, _BB_DIR_BIN, getopt_usage},
114#endif 114#endif
115#ifdef BB_GREP 115#ifdef BB_GREP
116 {"grep", grep_main, _BB_DIR_BIN, grep_usage}, 116 {"grep", grep_main, _BB_DIR_BIN, grep_usage},
@@ -245,7 +245,7 @@ const struct BB_applet applets[] = {
245 {"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage}, 245 {"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage},
246#endif 246#endif
247#ifdef BB_RENICE 247#ifdef BB_RENICE
248 {"renice", renice_main, _BB_DIR_USR_BIN}, 248 {"renice", renice_main, _BB_DIR_USR_BIN, renice_usage},
249#endif 249#endif
250#ifdef BB_RESET 250#ifdef BB_RESET
251 {"reset", reset_main, _BB_DIR_USR_BIN, reset_usage}, 251 {"reset", reset_main, _BB_DIR_USR_BIN, reset_usage},
diff --git a/busybox.h b/busybox.h
index 84d0ddad8..7f4d55f3d 100644
--- a/busybox.h
+++ b/busybox.h
@@ -257,6 +257,7 @@ extern const char find_usage[];
257extern const char free_usage[]; 257extern const char free_usage[];
258extern const char freeramdisk_usage[]; 258extern const char freeramdisk_usage[];
259extern const char fsck_minix_usage[]; 259extern const char fsck_minix_usage[];
260extern const char getopt_usage[];
260extern const char grep_usage[]; 261extern const char grep_usage[];
261extern const char gunzip_usage[]; 262extern const char gunzip_usage[];
262extern const char gzip_usage[]; 263extern const char gzip_usage[];
diff --git a/getopt.c b/getopt.c
index 919ae6c68..8c94bb4c1 100644
--- a/getopt.c
+++ b/getopt.c
@@ -306,22 +306,6 @@ static struct option longopts[]=
306/* Stop scanning as soon as a non-option argument is found! */ 306/* Stop scanning as soon as a non-option argument is found! */
307static const char *shortopts="+ao:l:n:qQs:Tu"; 307static const char *shortopts="+ao:l:n:qQs:Tu";
308 308
309static const char getopt_usage[] =
310"getopt [OPTIONS]...\n"
311#ifndef BB_FEATURE_TRIVIAL_HELP
312"Parse command options\n"
313" -a, --alternative Allow long options starting with single -\n"
314" -l, --longoptions=longopts Long options to be recognized\n"
315" -n, --name=progname The name under which errors are reported\n"
316" -o, --options=optstring Short options to be recognized\n"
317" -q, --quiet Disable error reporting by getopt(3)\n"
318" -Q, --quiet-output No normal output\n"
319" -s, --shell=shell Set shell quoting conventions\n"
320" -T, --test Test for getopt(1) version\n"
321" -u, --unqote Do not quote the output\n"
322#endif
323;
324
325 309
326int getopt_main(int argc, char *argv[]) 310int getopt_main(int argc, char *argv[])
327{ 311{
diff --git a/include/busybox.h b/include/busybox.h
index 84d0ddad8..7f4d55f3d 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -257,6 +257,7 @@ extern const char find_usage[];
257extern const char free_usage[]; 257extern const char free_usage[];
258extern const char freeramdisk_usage[]; 258extern const char freeramdisk_usage[];
259extern const char fsck_minix_usage[]; 259extern const char fsck_minix_usage[];
260extern const char getopt_usage[];
260extern const char grep_usage[]; 261extern const char grep_usage[];
261extern const char gunzip_usage[]; 262extern const char gunzip_usage[];
262extern const char gzip_usage[]; 263extern const char gzip_usage[];
diff --git a/usage.c b/usage.c
index 11326432c..7e3ea8191 100644
--- a/usage.c
+++ b/usage.c
@@ -375,6 +375,24 @@ const char fsck_minix_usage[] =
375 ; 375 ;
376#endif 376#endif
377 377
378#if defined BB_GETOPT
379const char getopt_usage[] =
380"getopt [OPTIONS]...\n"
381#ifndef BB_FEATURE_TRIVIAL_HELP
382"Parse command options\n"
383" -a, --alternative Allow long options starting with single -\n"
384" -l, --longoptions=longopts Long options to be recognized\n"
385" -n, --name=progname The name under which errors are reported\n"
386" -o, --options=optstring Short options to be recognized\n"
387" -q, --quiet Disable error reporting by getopt(3)\n"
388" -Q, --quiet-output No normal output\n"
389" -s, --shell=shell Set shell quoting conventions\n"
390" -T, --test Test for getopt(1) version\n"
391" -u, --unqote Do not quote the output\n"
392#endif
393;
394#endif
395
378#if defined BB_GREP 396#if defined BB_GREP
379const char grep_usage[] = 397const char grep_usage[] =
380 "grep [-ihHnqvs] pattern [files...]\n" 398 "grep [-ihHnqvs] pattern [files...]\n"
@@ -1472,3 +1490,4 @@ const char yes_usage[] =
1472#endif 1490#endif
1473 ; 1491 ;
1474#endif 1492#endif
1493
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index 919ae6c68..8c94bb4c1 100644
--- a/util-linux/getopt.c
+++ b/util-linux/getopt.c
@@ -306,22 +306,6 @@ static struct option longopts[]=
306/* Stop scanning as soon as a non-option argument is found! */ 306/* Stop scanning as soon as a non-option argument is found! */
307static const char *shortopts="+ao:l:n:qQs:Tu"; 307static const char *shortopts="+ao:l:n:qQs:Tu";
308 308
309static const char getopt_usage[] =
310"getopt [OPTIONS]...\n"
311#ifndef BB_FEATURE_TRIVIAL_HELP
312"Parse command options\n"
313" -a, --alternative Allow long options starting with single -\n"
314" -l, --longoptions=longopts Long options to be recognized\n"
315" -n, --name=progname The name under which errors are reported\n"
316" -o, --options=optstring Short options to be recognized\n"
317" -q, --quiet Disable error reporting by getopt(3)\n"
318" -Q, --quiet-output No normal output\n"
319" -s, --shell=shell Set shell quoting conventions\n"
320" -T, --test Test for getopt(1) version\n"
321" -u, --unqote Do not quote the output\n"
322#endif
323;
324
325 309
326int getopt_main(int argc, char *argv[]) 310int getopt_main(int argc, char *argv[])
327{ 311{