Commit ca6cb63d authored by Zygmunt Krynicki's avatar Zygmunt Krynicki
Browse files

lm4flash.c: Add new main()

The new main function just handles argument processing and calls
flasher_flash()
parent 0885e9ac
......@@ -684,3 +684,31 @@ done:
return retval;
}
int main(int argc, char *argv[])
{
const char *serial = NULL;
const char *rom_name = NULL;
int do_verify = 0;
int opt;
while ((opt = getopt(argc, argv, "vs:")) != -1) {
switch (opt) {
case 'v':
do_verify = 1;
break;
case 's':
serial = optarg;
break;
default:
flasher_usage();
return EXIT_FAILURE;
}
}
if (optind >= argc) {
flasher_usage();
return EXIT_FAILURE;
} else
rom_name = argv[optind];
return flasher_flash(do_verify, serial, rom_name);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment