Do usage messages the same way all other apps fo them.
Skip printing of available options (can't do this easily). Based on a patch by Larry Doolittle. -Erik
This commit is contained in:
parent
fa4f146d7d
commit
733c4ad6eb
@ -474,6 +474,18 @@ false_usage_index
|
|||||||
DO_COMMA
|
DO_COMMA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined BB_FBSET
|
||||||
|
#if defined USAGE_ENUM
|
||||||
|
fbset_usage_index
|
||||||
|
#elif defined USAGE_MESSAGES
|
||||||
|
"fbset [options] [mode]"
|
||||||
|
#ifndef BB_FEATURE_TRIVIAL_HELP
|
||||||
|
"\n\nShows and modifies frame buffer device settings"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
DO_COMMA
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined BB_FDFLUSH
|
#if defined BB_FDFLUSH
|
||||||
#if defined USAGE_ENUM
|
#if defined USAGE_ENUM
|
||||||
fdflush_usage_index
|
fdflush_usage_index
|
||||||
|
26
fbset.c
26
fbset.c
@ -334,26 +334,6 @@ static void showmode(struct fb_var_screeninfo *v)
|
|||||||
printf("endmode\n\n");
|
printf("endmode\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fbset_usage(void)
|
|
||||||
{
|
|
||||||
#ifndef BB_FEATURE_TRIVIAL_HELP
|
|
||||||
int i;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef STANDALONE
|
|
||||||
fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n",
|
|
||||||
BB_VER, BB_BT);
|
|
||||||
#endif
|
|
||||||
fprintf(stderr, "Usage: fbset [options] [mode]\n");
|
|
||||||
#ifndef BB_FEATURE_TRIVIAL_HELP
|
|
||||||
fprintf(stderr, "\nShows and modifies frame buffer device settings\n\n");
|
|
||||||
fprintf(stderr, "The following options are recognized:\n");
|
|
||||||
for (i = 0; g_cmdoptions[i].name; i++)
|
|
||||||
fprintf(stderr, "\t%s\n", g_cmdoptions[i].name);
|
|
||||||
#endif
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef STANDALONE
|
#ifdef STANDALONE
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
#else
|
#else
|
||||||
@ -375,10 +355,10 @@ extern int fbset_main(int argc, char **argv)
|
|||||||
for (i = 0; g_cmdoptions[i].name; i++) {
|
for (i = 0; g_cmdoptions[i].name; i++) {
|
||||||
if (!strcmp(thisarg, g_cmdoptions[i].name)) {
|
if (!strcmp(thisarg, g_cmdoptions[i].name)) {
|
||||||
if (argc - 1 < g_cmdoptions[i].param_count)
|
if (argc - 1 < g_cmdoptions[i].param_count)
|
||||||
fbset_usage();
|
show_usage();
|
||||||
switch (g_cmdoptions[i].code) {
|
switch (g_cmdoptions[i].code) {
|
||||||
case CMD_HELP:
|
case CMD_HELP:
|
||||||
fbset_usage();
|
show_usage();
|
||||||
case CMD_FB:
|
case CMD_FB:
|
||||||
fbdev = argv[1];
|
fbdev = argv[1];
|
||||||
break;
|
break;
|
||||||
@ -423,7 +403,7 @@ extern int fbset_main(int argc, char **argv)
|
|||||||
mode = *argv;
|
mode = *argv;
|
||||||
g_options |= OPT_READMODE;
|
g_options |= OPT_READMODE;
|
||||||
} else {
|
} else {
|
||||||
fbset_usage();
|
show_usage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -474,6 +474,18 @@ false_usage_index
|
|||||||
DO_COMMA
|
DO_COMMA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined BB_FBSET
|
||||||
|
#if defined USAGE_ENUM
|
||||||
|
fbset_usage_index
|
||||||
|
#elif defined USAGE_MESSAGES
|
||||||
|
"fbset [options] [mode]"
|
||||||
|
#ifndef BB_FEATURE_TRIVIAL_HELP
|
||||||
|
"\n\nShows and modifies frame buffer device settings"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
DO_COMMA
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined BB_FDFLUSH
|
#if defined BB_FDFLUSH
|
||||||
#if defined USAGE_ENUM
|
#if defined USAGE_ENUM
|
||||||
fdflush_usage_index
|
fdflush_usage_index
|
||||||
|
12
usage.h
12
usage.h
@ -474,6 +474,18 @@ false_usage_index
|
|||||||
DO_COMMA
|
DO_COMMA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined BB_FBSET
|
||||||
|
#if defined USAGE_ENUM
|
||||||
|
fbset_usage_index
|
||||||
|
#elif defined USAGE_MESSAGES
|
||||||
|
"fbset [options] [mode]"
|
||||||
|
#ifndef BB_FEATURE_TRIVIAL_HELP
|
||||||
|
"\n\nShows and modifies frame buffer device settings"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
DO_COMMA
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined BB_FDFLUSH
|
#if defined BB_FDFLUSH
|
||||||
#if defined USAGE_ENUM
|
#if defined USAGE_ENUM
|
||||||
fdflush_usage_index
|
fdflush_usage_index
|
||||||
|
@ -334,26 +334,6 @@ static void showmode(struct fb_var_screeninfo *v)
|
|||||||
printf("endmode\n\n");
|
printf("endmode\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fbset_usage(void)
|
|
||||||
{
|
|
||||||
#ifndef BB_FEATURE_TRIVIAL_HELP
|
|
||||||
int i;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef STANDALONE
|
|
||||||
fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n",
|
|
||||||
BB_VER, BB_BT);
|
|
||||||
#endif
|
|
||||||
fprintf(stderr, "Usage: fbset [options] [mode]\n");
|
|
||||||
#ifndef BB_FEATURE_TRIVIAL_HELP
|
|
||||||
fprintf(stderr, "\nShows and modifies frame buffer device settings\n\n");
|
|
||||||
fprintf(stderr, "The following options are recognized:\n");
|
|
||||||
for (i = 0; g_cmdoptions[i].name; i++)
|
|
||||||
fprintf(stderr, "\t%s\n", g_cmdoptions[i].name);
|
|
||||||
#endif
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef STANDALONE
|
#ifdef STANDALONE
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
#else
|
#else
|
||||||
@ -375,10 +355,10 @@ extern int fbset_main(int argc, char **argv)
|
|||||||
for (i = 0; g_cmdoptions[i].name; i++) {
|
for (i = 0; g_cmdoptions[i].name; i++) {
|
||||||
if (!strcmp(thisarg, g_cmdoptions[i].name)) {
|
if (!strcmp(thisarg, g_cmdoptions[i].name)) {
|
||||||
if (argc - 1 < g_cmdoptions[i].param_count)
|
if (argc - 1 < g_cmdoptions[i].param_count)
|
||||||
fbset_usage();
|
show_usage();
|
||||||
switch (g_cmdoptions[i].code) {
|
switch (g_cmdoptions[i].code) {
|
||||||
case CMD_HELP:
|
case CMD_HELP:
|
||||||
fbset_usage();
|
show_usage();
|
||||||
case CMD_FB:
|
case CMD_FB:
|
||||||
fbdev = argv[1];
|
fbdev = argv[1];
|
||||||
break;
|
break;
|
||||||
@ -423,7 +403,7 @@ extern int fbset_main(int argc, char **argv)
|
|||||||
mode = *argv;
|
mode = *argv;
|
||||||
g_options |= OPT_READMODE;
|
g_options |= OPT_READMODE;
|
||||||
} else {
|
} else {
|
||||||
fbset_usage();
|
show_usage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user