mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-12-27 18:30:14 +00:00
Reject unknown long-named command line options in dis.
This commit is contained in:
parent
e4853e8508
commit
8e5479335f
@ -85,15 +85,21 @@ int main(int argc, char** argv) {
|
|||||||
} break;
|
} break;
|
||||||
case '-': {
|
case '-': {
|
||||||
// Long options
|
// Long options
|
||||||
if (0 == strcmp(argv[argi], "--no-color")) allow_color = false;
|
if (0 == strcmp(argv[argi], "--no-color")) {
|
||||||
if (0 == strcmp(argv[argi], "--no-indent")) allow_indent = false;
|
allow_color = false;
|
||||||
if (0 == strcmp(argv[argi], "--offsets")) show_byte_offsets = true;
|
} else if (0 == strcmp(argv[argi], "--no-indent")) {
|
||||||
if (0 == strcmp(argv[argi], "--help")) {
|
allow_indent = false;
|
||||||
|
} else if (0 == strcmp(argv[argi], "--offsets")) {
|
||||||
|
show_byte_offsets = true;
|
||||||
|
} else if (0 == strcmp(argv[argi], "--help")) {
|
||||||
print_usage(argv[0]);
|
print_usage(argv[0]);
|
||||||
return 0;
|
return 0;
|
||||||
|
} else {
|
||||||
|
print_usage(argv[0]);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 0:
|
case 0: {
|
||||||
// Setting a filename of "-" to indicate stdin.
|
// Setting a filename of "-" to indicate stdin.
|
||||||
if (!inFile) {
|
if (!inFile) {
|
||||||
inFile = argv[argi];
|
inFile = argv[argi];
|
||||||
@ -101,7 +107,7 @@ int main(int argc, char** argv) {
|
|||||||
fprintf(stderr, "error: More than one input file specified\n");
|
fprintf(stderr, "error: More than one input file specified\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
break;
|
} break;
|
||||||
default:
|
default:
|
||||||
print_usage(argv[0]);
|
print_usage(argv[0]);
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user