summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Whitley2000-10-19 22:28:06 +0000
committerMark Whitley2000-10-19 22:28:06 +0000
commit6050618096ab058d29264a6d6b604275b44121bb (patch)
tree5818d62ef16fefe16ea1b4e412ad06a50c87f599
parent69229a6c92a2d73bcee7c06eb79bd0a4f40d4e16 (diff)
downloadbusybox-6050618096ab058d29264a6d6b604275b44121bb.zip
busybox-6050618096ab058d29264a6d6b604275b44121bb.tar.gz
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 d25ddc1..21b8a11 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -110,7 +110,7 @@ const struct BB_applet applets[] = {
{"fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage},
#endif
#ifdef BB_GETOPT
- {"getopt", getopt_main, _BB_DIR_BIN},
+ {"getopt", getopt_main, _BB_DIR_BIN, getopt_usage},
#endif
#ifdef BB_GREP
{"grep", grep_main, _BB_DIR_BIN, grep_usage},
@@ -245,7 +245,7 @@ const struct BB_applet applets[] = {
{"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage},
#endif
#ifdef BB_RENICE
- {"renice", renice_main, _BB_DIR_USR_BIN},
+ {"renice", renice_main, _BB_DIR_USR_BIN, renice_usage},
#endif
#ifdef BB_RESET
{"reset", reset_main, _BB_DIR_USR_BIN, reset_usage},
diff --git a/applets/usage.c b/applets/usage.c
index 1132643..7e3ea81 100644
--- a/applets/usage.c
+++ b/applets/usage.c
@@ -375,6 +375,24 @@ const char fsck_minix_usage[] =
;
#endif
+#if defined BB_GETOPT
+const char getopt_usage[] =
+"getopt [OPTIONS]...\n"
+#ifndef BB_FEATURE_TRIVIAL_HELP
+"Parse command options\n"
+" -a, --alternative Allow long options starting with single -\n"
+" -l, --longoptions=longopts Long options to be recognized\n"
+" -n, --name=progname The name under which errors are reported\n"
+" -o, --options=optstring Short options to be recognized\n"
+" -q, --quiet Disable error reporting by getopt(3)\n"
+" -Q, --quiet-output No normal output\n"
+" -s, --shell=shell Set shell quoting conventions\n"
+" -T, --test Test for getopt(1) version\n"
+" -u, --unqote Do not quote the output\n"
+#endif
+;
+#endif
+
#if defined BB_GREP
const char grep_usage[] =
"grep [-ihHnqvs] pattern [files...]\n"
@@ -1472,3 +1490,4 @@ const char yes_usage[] =
#endif
;
#endif
+
diff --git a/busybox.c b/busybox.c
index d25ddc1..21b8a11 100644
--- a/busybox.c
+++ b/busybox.c
@@ -110,7 +110,7 @@ const struct BB_applet applets[] = {
{"fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage},
#endif
#ifdef BB_GETOPT
- {"getopt", getopt_main, _BB_DIR_BIN},
+ {"getopt", getopt_main, _BB_DIR_BIN, getopt_usage},
#endif
#ifdef BB_GREP
{"grep", grep_main, _BB_DIR_BIN, grep_usage},
@@ -245,7 +245,7 @@ const struct BB_applet applets[] = {
{"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage},
#endif
#ifdef BB_RENICE
- {"renice", renice_main, _BB_DIR_USR_BIN},
+ {"renice", renice_main, _BB_DIR_USR_BIN, renice_usage},
#endif
#ifdef BB_RESET
{"reset", reset_main, _BB_DIR_USR_BIN, reset_usage},
diff --git a/busybox.h b/busybox.h
index 84d0dda..7f4d55f 100644
--- a/busybox.h
+++ b/busybox.h
@@ -257,6 +257,7 @@ extern const char find_usage[];
extern const char free_usage[];
extern const char freeramdisk_usage[];
extern const char fsck_minix_usage[];
+extern const char getopt_usage[];
extern const char grep_usage[];
extern const char gunzip_usage[];
extern const char gzip_usage[];
diff --git a/getopt.c b/getopt.c
index 919ae6c..8c94bb4 100644
--- a/getopt.c
+++ b/getopt.c
@@ -306,22 +306,6 @@ static struct option longopts[]=
/* Stop scanning as soon as a non-option argument is found! */
static const char *shortopts="+ao:l:n:qQs:Tu";
-static const char getopt_usage[] =
-"getopt [OPTIONS]...\n"
-#ifndef BB_FEATURE_TRIVIAL_HELP
-"Parse command options\n"
-" -a, --alternative Allow long options starting with single -\n"
-" -l, --longoptions=longopts Long options to be recognized\n"
-" -n, --name=progname The name under which errors are reported\n"
-" -o, --options=optstring Short options to be recognized\n"
-" -q, --quiet Disable error reporting by getopt(3)\n"
-" -Q, --quiet-output No normal output\n"
-" -s, --shell=shell Set shell quoting conventions\n"
-" -T, --test Test for getopt(1) version\n"
-" -u, --unqote Do not quote the output\n"
-#endif
-;
-
int getopt_main(int argc, char *argv[])
{
diff --git a/include/busybox.h b/include/busybox.h
index 84d0dda..7f4d55f 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -257,6 +257,7 @@ extern const char find_usage[];
extern const char free_usage[];
extern const char freeramdisk_usage[];
extern const char fsck_minix_usage[];
+extern const char getopt_usage[];
extern const char grep_usage[];
extern const char gunzip_usage[];
extern const char gzip_usage[];
diff --git a/usage.c b/usage.c
index 1132643..7e3ea81 100644
--- a/usage.c
+++ b/usage.c
@@ -375,6 +375,24 @@ const char fsck_minix_usage[] =
;
#endif
+#if defined BB_GETOPT
+const char getopt_usage[] =
+"getopt [OPTIONS]...\n"
+#ifndef BB_FEATURE_TRIVIAL_HELP
+"Parse command options\n"
+" -a, --alternative Allow long options starting with single -\n"
+" -l, --longoptions=longopts Long options to be recognized\n"
+" -n, --name=progname The name under which errors are reported\n"
+" -o, --options=optstring Short options to be recognized\n"
+" -q, --quiet Disable error reporting by getopt(3)\n"
+" -Q, --quiet-output No normal output\n"
+" -s, --shell=shell Set shell quoting conventions\n"
+" -T, --test Test for getopt(1) version\n"
+" -u, --unqote Do not quote the output\n"
+#endif
+;
+#endif
+
#if defined BB_GREP
const char grep_usage[] =
"grep [-ihHnqvs] pattern [files...]\n"
@@ -1472,3 +1490,4 @@ const char yes_usage[] =
#endif
;
#endif
+
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index 919ae6c..8c94bb4 100644
--- a/util-linux/getopt.c
+++ b/util-linux/getopt.c
@@ -306,22 +306,6 @@ static struct option longopts[]=
/* Stop scanning as soon as a non-option argument is found! */
static const char *shortopts="+ao:l:n:qQs:Tu";
-static const char getopt_usage[] =
-"getopt [OPTIONS]...\n"
-#ifndef BB_FEATURE_TRIVIAL_HELP
-"Parse command options\n"
-" -a, --alternative Allow long options starting with single -\n"
-" -l, --longoptions=longopts Long options to be recognized\n"
-" -n, --name=progname The name under which errors are reported\n"
-" -o, --options=optstring Short options to be recognized\n"
-" -q, --quiet Disable error reporting by getopt(3)\n"
-" -Q, --quiet-output No normal output\n"
-" -s, --shell=shell Set shell quoting conventions\n"
-" -T, --test Test for getopt(1) version\n"
-" -u, --unqote Do not quote the output\n"
-#endif
-;
-
int getopt_main(int argc, char *argv[])
{