From ed036a72ddcb1b30f86ebd7fb82eaf793417a5b1 Mon Sep 17 00:00:00 2001 From: Brian Henning Date: Tue, 11 Oct 2016 16:19:15 -0400 Subject: [PATCH] Removed core list from default usage message; added "--list-cores" command-line flag to list cores --- simavr/sim/run_avr.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) -- 2.39.5