mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-26 22:52:34 +02:00
Improve --help and friends
More clear "variable" names, better explanation if no programmer is selected etc. Corresponding to flashrom svn r1624. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
parent
e7a39bfc92
commit
b226cb1662
@ -33,58 +33,42 @@
|
|||||||
|
|
||||||
static void cli_classic_usage(const char *name)
|
static void cli_classic_usage(const char *name)
|
||||||
{
|
{
|
||||||
printf("Usage: flashrom [-h|-R|-L|"
|
printf("Please note that the command line interface for flashrom has changed between\n"
|
||||||
|
"0.9.5 and 0.9.6 and will change again before flashrom 1.0.\n\n");
|
||||||
|
|
||||||
|
printf("Usage: %s [-h|-R|-L|"
|
||||||
#if CONFIG_PRINT_WIKI == 1
|
#if CONFIG_PRINT_WIKI == 1
|
||||||
"-z|"
|
"-z|"
|
||||||
#endif
|
#endif
|
||||||
"-p <programmername>[:<parameters>]\n"
|
"-p <programmername>[:<parameters>] [-c <chipname>]\n"
|
||||||
" [-E|-r <file>|-w <file>|-v <file>] [-c <chipname>]\n"
|
"[-E|(-r|-w|-v) <file>] [-l <layoutfile> [-i <imagename>]...] [-n] [-f]]\n"
|
||||||
" [-l <file> [-i <image>]] [-n] [-f]]\n"
|
"[-V[V[V]]] [-o <logfile>]\n\n", name);
|
||||||
" [-V[V[V]]] [-o <logfile>]\n\n");
|
|
||||||
|
|
||||||
printf("Please note that the command line interface for flashrom has "
|
printf(" -h | --help print this help text\n"
|
||||||
"changed between\n"
|
" -R | --version print version (release)\n"
|
||||||
"0.9.5 and 0.9.6 and will change again before flashrom 1.0.\n"
|
" -r | --read <file> read flash and save to <file>\n"
|
||||||
"Do not use flashrom in scripts or other automated tools "
|
" -w | --write <file> write <file> to flash\n"
|
||||||
"without checking\n"
|
" -v | --verify <file> verify flash against <file>\n"
|
||||||
"that your flashrom version won't interpret options in a "
|
" -E | --erase erase flash memory\n"
|
||||||
"different way.\n\n");
|
" -V | --verbose more verbose output\n"
|
||||||
|
" -c | --chip <chipname> probe only for specified flash chip\n"
|
||||||
printf(" -h | --help print this help text\n"
|
" -f | --force force specific operations (see man page)\n"
|
||||||
" -R | --version print version (release)\n"
|
" -n | --noverify don't auto-verify\n"
|
||||||
" -r | --read <file> read flash and save to "
|
" -l | --layout <layoutfile> read ROM layout from <layoutfile>\n"
|
||||||
"<file>\n"
|
" -i | --image <name> only flash image <name> from flash layout\n"
|
||||||
" -w | --write <file> write <file> to flash\n"
|
" -o | --output <logfile> log output to <logfile>\n"
|
||||||
" -v | --verify <file> verify flash against "
|
" -L | --list-supported print supported devices\n"
|
||||||
"<file>\n"
|
|
||||||
" -E | --erase erase flash device\n"
|
|
||||||
" -V | --verbose more verbose output\n"
|
|
||||||
" -c | --chip <chipname> probe only for specified "
|
|
||||||
"flash chip\n"
|
|
||||||
" -f | --force force specific operations "
|
|
||||||
"(see man page)\n"
|
|
||||||
" -n | --noverify don't auto-verify\n"
|
|
||||||
" -l | --layout <file> read ROM layout from "
|
|
||||||
"<file>\n"
|
|
||||||
" -i | --image <name> only flash image <name> "
|
|
||||||
"from flash layout\n"
|
|
||||||
" -o | --output <name> log to file <name>\n"
|
|
||||||
" -L | --list-supported print supported devices\n"
|
|
||||||
#if CONFIG_PRINT_WIKI == 1
|
#if CONFIG_PRINT_WIKI == 1
|
||||||
" -z | --list-supported-wiki print supported devices "
|
" -z | --list-supported-wiki print supported devices in wiki syntax\n"
|
||||||
"in wiki syntax\n"
|
|
||||||
#endif
|
#endif
|
||||||
" -p | --programmer <name>[:<param>] specify the programmer "
|
" -p | --programmer <name>[:<param>] specify the programmer device. One of\n");
|
||||||
"device\n");
|
list_programmers_linebreak(4, 80, 0);
|
||||||
|
printf(".\n\nYou can specify one of -h, -R, -L, "
|
||||||
list_programmers_linebreak(37, 80, 1);
|
|
||||||
printf("\nYou can specify one of -h, -R, -L, "
|
|
||||||
#if CONFIG_PRINT_WIKI == 1
|
#if CONFIG_PRINT_WIKI == 1
|
||||||
"-z, "
|
"-z, "
|
||||||
#endif
|
#endif
|
||||||
"-E, -r, -w, -v or no operation.\n"
|
"-E, -r, -w, -v or no operation.\n"
|
||||||
"If no operation is specified, flashrom will only probe for "
|
"If no operation is specified, flashrom will only probe for flash chips.\n");
|
||||||
"flash chips.\n\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cli_classic_abort_usage(void)
|
static void cli_classic_abort_usage(void)
|
||||||
@ -296,6 +280,7 @@ int main(int argc, char *argv[])
|
|||||||
fprintf(stderr, "Error: Unknown programmer \"%s\". Valid choices are:\n",
|
fprintf(stderr, "Error: Unknown programmer \"%s\". Valid choices are:\n",
|
||||||
optarg);
|
optarg);
|
||||||
list_programmers_linebreak(0, 80, 0);
|
list_programmers_linebreak(0, 80, 0);
|
||||||
|
msg_ginfo(".\n");
|
||||||
cli_classic_abort_usage();
|
cli_classic_abort_usage();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -407,8 +392,13 @@ int main(int argc, char *argv[])
|
|||||||
programmer_table[CONFIG_DEFAULT_PROGRAMMER].name);
|
programmer_table[CONFIG_DEFAULT_PROGRAMMER].name);
|
||||||
} else {
|
} else {
|
||||||
msg_perr("Please select a programmer with the --programmer parameter.\n"
|
msg_perr("Please select a programmer with the --programmer parameter.\n"
|
||||||
|
"Previously this was not necessary because there was a default set.\n"
|
||||||
|
#if CONFIG_INTERNAL == 1
|
||||||
|
"To choose the mainboard of this computer use 'internal'. "
|
||||||
|
#endif
|
||||||
"Valid choices are:\n");
|
"Valid choices are:\n");
|
||||||
list_programmers_linebreak(0, 80, 0);
|
list_programmers_linebreak(0, 80, 0);
|
||||||
|
msg_ginfo(".\n");
|
||||||
ret = 1;
|
ret = 1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -1461,7 +1461,6 @@ void list_programmers_linebreak(int startcol, int cols, int paren)
|
|||||||
} else {
|
} else {
|
||||||
if (paren)
|
if (paren)
|
||||||
msg_ginfo(")");
|
msg_ginfo(")");
|
||||||
msg_ginfo("\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1
print.c
1
print.c
@ -440,6 +440,7 @@ int print_supported(void)
|
|||||||
|
|
||||||
msg_ginfo("\nSupported programmers:\n");
|
msg_ginfo("\nSupported programmers:\n");
|
||||||
list_programmers_linebreak(0, 80, 0);
|
list_programmers_linebreak(0, 80, 0);
|
||||||
|
msg_ginfo("\n");
|
||||||
#if CONFIG_INTERNAL == 1
|
#if CONFIG_INTERNAL == 1
|
||||||
msg_ginfo("\nSupported devices for the %s programmer:\n\n",
|
msg_ginfo("\nSupported devices for the %s programmer:\n\n",
|
||||||
programmer_table[PROGRAMMER_INTERNAL].name);
|
programmer_table[PROGRAMMER_INTERNAL].name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user