From 366b6c2660b088fec6ed8c6926398a366f74fd8c Mon Sep 17 00:00:00 2001 From: msquirogac Date: Mon, 25 May 2020 12:27:34 -0400 Subject: [PATCH] Update of the display_usage function. Some arguments changed name to make them more like the already existent ones. Some arguments were merged to one to reduce redundant code. Fix issue #375 --- simavr/sim/run_avr.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/simavr/sim/run_avr.c b/simavr/sim/run_avr.c index fd2cdc5..b4fda3f 100644 --- a/simavr/sim/run_avr.c +++ b/simavr/sim/run_avr.c @@ -47,7 +47,9 @@ display_usage( " [--gdb|-g []] Listen for gdb connection on (default 1234)\n" " [-ff <.hex file>] Load next .hex file as flash\n" " [-ee <.hex file>] Load next .hex file as eeprom\n" - " [--input|-i ] A .vcd file to use as input signals\n" + " [--input|-i ] A vcd file to use as input signals\n" + " [--output|-o ] A vcd file to save the traced signals\n" + " [--add-trace|-at ] Add signal to be traced\n" " [-v] Raise verbosity level\n" " (can be passed more than once)\n" " A .hex or an ELF file. ELF files are\n" @@ -122,14 +124,13 @@ main( display_usage(basename(argv[0])); } else if (!strcmp(argv[pi], "-t") || !strcmp(argv[pi], "--trace")) { trace++; - } else if (!strcmp(argv[pi], "--vcd-trace-name")) { + } else if (!strcmp(argv[pi], "-o") || !strcmp(argv[pi], "--output")) { if (pi + 1 >= argc) { fprintf(stderr, "%s: missing mandatory argument for %s.\n", argv[0], argv[pi]); exit(1); } - ++pi; - snprintf(f.tracename, sizeof(f.tracename), "%s", argv[pi]); - } else if (!strcmp(argv[pi], "--add-vcd-trace")) { + snprintf(f.tracename, sizeof(f.tracename), "%s", argv[++pi]); + } else if (!strcmp(argv[pi], "-at") || !strcmp(argv[pi], "--add-trace")) { if (pi + 1 >= argc) { fprintf(stderr, "%s: missing mandatory argument for %s.\n", argv[0], argv[pi]); exit(1); @@ -186,12 +187,6 @@ main( ); ++f.tracecount; - } else if (!strcmp(argv[pi], "--vcd-trace-file")) { - if (pi + 1 >= argc) { - fprintf(stderr, "%s: missing mandatory argument for %s.\n", argv[0], argv[pi]); - exit(1); - } - snprintf(f.tracename, sizeof(f.tracename), "%s", argv[++pi]); } else if (!strcmp(argv[pi], "-ti")) { if (pi < argc-1) trace_vectors[trace_vectors_count++] = atoi(argv[++pi]); -- 2.39.5