From: Brian Henning Date: Tue, 11 Oct 2016 20:19:15 +0000 (-0400) Subject: Removed core list from default usage message; added "--list-cores" command-line flag... X-Git-Tag: v1.4~11^2~2 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=ed036a72ddcb1b30f86ebd7fb82eaf793417a5b1;p=sx%2Fsimavr.git Removed core list from default usage message; added "--list-cores" command-line flag to list cores --- diff --git a/simavr/sim/run_avr.c b/simavr/sim/run_avr.c index 57fa05e..8d5d5bf 100644 --- a/simavr/sim/run_avr.c +++ b/simavr/sim/run_avr.c @@ -40,6 +40,12 @@ void display_usage(char * app) " -ff: Load next .hex file as flash\n" " -ee: Load next .hex file as eeprom\n" " -v: Raise verbosity level (can be passed more than once)\n" + " --list-cores: List all supported AVR cores\n"); + exit(1); +} + +void list_cores() { + printf( " Supported AVR cores:\n"); for (int i = 0; avr_kind[i]; i++) { printf(" "); @@ -78,7 +84,9 @@ int main(int argc, char *argv[]) display_usage(basename(argv[0])); for (int pi = 1; pi < argc; pi++) { - if (!strcmp(argv[pi], "-h") || !strcmp(argv[pi], "-help")) { + if (!strcmp(argv[pi], "--list-cores")) { + list_cores(); + } else if (!strcmp(argv[pi], "-h") || !strcmp(argv[pi], "-help")) { display_usage(basename(argv[0])); } else if (!strcmp(argv[pi], "-m") || !strcmp(argv[pi], "-mcu")) { if (pi < argc-1)