Commit ed036a72ddcb1b30f86ebd7fb82eaf793417a5b1
authorBrian Henning <lotharyx@gmail.com>
Tue, 11 Oct 2016 20:19:15 +0000 (16:19 -0400)
committerBrian Henning <lotharyx@gmail.com>
Tue, 11 Oct 2016 20:19:15 +0000 (16:19 -0400)
simavr/sim/run_avr.c

index 57fa05e89f8395c8401722f344b1de9570c52834..8d5d5bfd98210710988c98d74f9c062f56dc47bb 100644 (file)
@@ -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)