X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=disassembler%2Fargs.c;h=89db70663668eed70b8c423ee22858e6b78e9532;hb=6c31b6389e3e1d944799847700e62dfde7754663;hp=45a39b0266fbf8774f762ce84521060eff6f3041;hpb=818c430fb65cc84d9fa2b1ef3808fa57ac5692f6;p=b43-tools.git diff --git a/disassembler/args.c b/disassembler/args.c index 45a39b0..89db706 100644 --- a/disassembler/args.c +++ b/disassembler/args.c @@ -22,13 +22,12 @@ #include -int _debug; - struct cmdline_args cmdargs = { - .arch = 5, - .informat = FMT_B43, - .print_addresses = 0, - .unknown_decode = 0, + .debug = 0, + .arch = 5, + .informat = FMT_B43, + .print_addresses = 0, + .unknown_decode = 0, }; #define ARG_MATCH 0 @@ -103,7 +102,7 @@ static void usage(FILE *fd, int argc, char **argv) fprintf(fd, " -a|--arch ARCH The architecture type of the input file (5 or 15)\n"); fprintf(fd, " -f|--format FMT Input file format. FMT must be one of:\n"); fprintf(fd, " raw-le32, raw-be32, b43\n"); - fprintf(fd, " --paddr Print the code addresses\n"); + fprintf(fd, " -p|--paddr Print the code addresses\n"); fprintf(fd, " -u|--unkdec Decode operands of unknown instructions\n"); fprintf(fd, " -d|--debug Print verbose debugging info\n"); fprintf(fd, " Repeat for more verbose debugging\n"); @@ -134,12 +133,12 @@ int parse_args(int argc, char **argv) fprintf(stderr, "Invalid -f|--format\n"); return -1; } - } else if ((res = cmp_arg(argv, &i, "--paddr", NULL, NULL)) == ARG_MATCH) { + } else if ((res = cmp_arg(argv, &i, "--paddr", "-p", NULL)) == ARG_MATCH) { cmdargs.print_addresses = 1; } else if ((res = cmp_arg(argv, &i, "--unkdec", "-u", NULL)) == ARG_MATCH) { cmdargs.unknown_decode = 1; } else if ((res = cmp_arg(argv, &i, "--debug", "-d", NULL)) == ARG_MATCH) { - _debug++; + cmdargs.debug++; } else if ((res = cmp_arg(argv, &i, "--arch", "-a", ¶m)) == ARG_MATCH) { unsigned long arch; char *tail;