1
0
Fork 0
forked from len0rd/rockbox

hwstub: small fixes to argument processing and usage()

Change-Id: I3daa5e0c3fa2e7eab6a3d75b4c8aa66254d72f3c
This commit is contained in:
Amaury Pouly 2017-01-17 11:58:56 +01:00
parent 9851849ae6
commit f4091be1d3
2 changed files with 6 additions and 5 deletions

View file

@ -106,10 +106,11 @@ bool could_be_rockbox(unsigned char *buffer, size_t size)
void usage(void) void usage(void)
{ {
printf("usage: hwstub::load [options] <addr> <file>\n"); printf("usage: hwstub_load [options] <addr> <file>\n");
printf("options:\n"); printf("options:\n");
printf(" --help/-? Display this help\n"); printf(" --help/-? Display this help\n");
printf(" --quiet/-q Quiet output\n"); printf(" --quiet/-q Quiet output\n");
printf(" --verbose/-v Verbose output\n");
printf(" --type/-t <t> Override file type\n"); printf(" --type/-t <t> Override file type\n");
printf(" --dev/-d <uri> Device URI (see below)\n"); printf(" --dev/-d <uri> Device URI (see below)\n");
printf(" --verbose/-v Display debug output\n"); printf(" --verbose/-v Display debug output\n");
@ -140,7 +141,7 @@ int main(int argc, char **argv)
{ {
static struct option long_options[] = static struct option long_options[] =
{ {
{"help", no_argument, 0, '?'}, {"help", no_argument, 0, 'h'},
{"quiet", no_argument, 0, 'q'}, {"quiet", no_argument, 0, 'q'},
{"type", required_argument, 0, 't'}, {"type", required_argument, 0, 't'},
{"dev", required_argument, 0, 'd'}, {"dev", required_argument, 0, 'd'},
@ -150,7 +151,7 @@ int main(int argc, char **argv)
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
int c = getopt_long(argc, argv, "?qt:d:elv", long_options, NULL); int c = getopt_long(argc, argv, "hqt:d:elv", long_options, NULL);
if(c == -1) if(c == -1)
break; break;
switch(c) switch(c)
@ -160,7 +161,7 @@ int main(int argc, char **argv)
case 'q': case 'q':
quiet = true; quiet = true;
break; break;
case '?': case 'h':
usage(); usage();
break; break;
case 't': case 't':

View file

@ -1299,7 +1299,7 @@ void usage(void)
printf("shell, compiled with hwstub protocol %d.%d\n", printf("shell, compiled with hwstub protocol %d.%d\n",
HWSTUB_VERSION_MAJOR, HWSTUB_VERSION_MINOR); HWSTUB_VERSION_MAJOR, HWSTUB_VERSION_MINOR);
printf("\n"); printf("\n");
printf("usage: shell [options] <soc desc files>\n"); printf("usage: hwstub_shell [options] <soc desc files>\n");
printf("options:\n"); printf("options:\n");
printf(" --help/-? Display this help\n"); printf(" --help/-? Display this help\n");
printf(" --quiet/-q Quiet non-command messages\n"); printf(" --quiet/-q Quiet non-command messages\n");