Put getopt_usage where it belongs and added *_usage entries in busybox.[ch]
This commit is contained in:
parent
69229a6c92
commit
6050618096
@ -110,7 +110,7 @@ const struct BB_applet applets[] = {
|
|||||||
{"fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage},
|
{"fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage},
|
||||||
#endif
|
#endif
|
||||||
#ifdef BB_GETOPT
|
#ifdef BB_GETOPT
|
||||||
{"getopt", getopt_main, _BB_DIR_BIN},
|
{"getopt", getopt_main, _BB_DIR_BIN, getopt_usage},
|
||||||
#endif
|
#endif
|
||||||
#ifdef BB_GREP
|
#ifdef BB_GREP
|
||||||
{"grep", grep_main, _BB_DIR_BIN, grep_usage},
|
{"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},
|
{"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage},
|
||||||
#endif
|
#endif
|
||||||
#ifdef BB_RENICE
|
#ifdef BB_RENICE
|
||||||
{"renice", renice_main, _BB_DIR_USR_BIN},
|
{"renice", renice_main, _BB_DIR_USR_BIN, renice_usage},
|
||||||
#endif
|
#endif
|
||||||
#ifdef BB_RESET
|
#ifdef BB_RESET
|
||||||
{"reset", reset_main, _BB_DIR_USR_BIN, reset_usage},
|
{"reset", reset_main, _BB_DIR_USR_BIN, reset_usage},
|
||||||
|
@ -375,6 +375,24 @@ const char fsck_minix_usage[] =
|
|||||||
;
|
;
|
||||||
#endif
|
#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
|
#if defined BB_GREP
|
||||||
const char grep_usage[] =
|
const char grep_usage[] =
|
||||||
"grep [-ihHnqvs] pattern [files...]\n"
|
"grep [-ihHnqvs] pattern [files...]\n"
|
||||||
@ -1472,3 +1490,4 @@ const char yes_usage[] =
|
|||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ const struct BB_applet applets[] = {
|
|||||||
{"fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage},
|
{"fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage},
|
||||||
#endif
|
#endif
|
||||||
#ifdef BB_GETOPT
|
#ifdef BB_GETOPT
|
||||||
{"getopt", getopt_main, _BB_DIR_BIN},
|
{"getopt", getopt_main, _BB_DIR_BIN, getopt_usage},
|
||||||
#endif
|
#endif
|
||||||
#ifdef BB_GREP
|
#ifdef BB_GREP
|
||||||
{"grep", grep_main, _BB_DIR_BIN, grep_usage},
|
{"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},
|
{"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage},
|
||||||
#endif
|
#endif
|
||||||
#ifdef BB_RENICE
|
#ifdef BB_RENICE
|
||||||
{"renice", renice_main, _BB_DIR_USR_BIN},
|
{"renice", renice_main, _BB_DIR_USR_BIN, renice_usage},
|
||||||
#endif
|
#endif
|
||||||
#ifdef BB_RESET
|
#ifdef BB_RESET
|
||||||
{"reset", reset_main, _BB_DIR_USR_BIN, reset_usage},
|
{"reset", reset_main, _BB_DIR_USR_BIN, reset_usage},
|
||||||
|
@ -257,6 +257,7 @@ extern const char find_usage[];
|
|||||||
extern const char free_usage[];
|
extern const char free_usage[];
|
||||||
extern const char freeramdisk_usage[];
|
extern const char freeramdisk_usage[];
|
||||||
extern const char fsck_minix_usage[];
|
extern const char fsck_minix_usage[];
|
||||||
|
extern const char getopt_usage[];
|
||||||
extern const char grep_usage[];
|
extern const char grep_usage[];
|
||||||
extern const char gunzip_usage[];
|
extern const char gunzip_usage[];
|
||||||
extern const char gzip_usage[];
|
extern const char gzip_usage[];
|
||||||
|
16
getopt.c
16
getopt.c
@ -306,22 +306,6 @@ static struct option longopts[]=
|
|||||||
/* Stop scanning as soon as a non-option argument is found! */
|
/* Stop scanning as soon as a non-option argument is found! */
|
||||||
static const char *shortopts="+ao:l:n:qQs:Tu";
|
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[])
|
int getopt_main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -257,6 +257,7 @@ extern const char find_usage[];
|
|||||||
extern const char free_usage[];
|
extern const char free_usage[];
|
||||||
extern const char freeramdisk_usage[];
|
extern const char freeramdisk_usage[];
|
||||||
extern const char fsck_minix_usage[];
|
extern const char fsck_minix_usage[];
|
||||||
|
extern const char getopt_usage[];
|
||||||
extern const char grep_usage[];
|
extern const char grep_usage[];
|
||||||
extern const char gunzip_usage[];
|
extern const char gunzip_usage[];
|
||||||
extern const char gzip_usage[];
|
extern const char gzip_usage[];
|
||||||
|
19
usage.c
19
usage.c
@ -375,6 +375,24 @@ const char fsck_minix_usage[] =
|
|||||||
;
|
;
|
||||||
#endif
|
#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
|
#if defined BB_GREP
|
||||||
const char grep_usage[] =
|
const char grep_usage[] =
|
||||||
"grep [-ihHnqvs] pattern [files...]\n"
|
"grep [-ihHnqvs] pattern [files...]\n"
|
||||||
@ -1472,3 +1490,4 @@ const char yes_usage[] =
|
|||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -306,22 +306,6 @@ static struct option longopts[]=
|
|||||||
/* Stop scanning as soon as a non-option argument is found! */
|
/* Stop scanning as soon as a non-option argument is found! */
|
||||||
static const char *shortopts="+ao:l:n:qQs:Tu";
|
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[])
|
int getopt_main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user