mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Make certain commands fail if passed excess arguments
This commit is contained in:
@@ -3385,6 +3385,10 @@ int main(int arg_count, char const **arg_ptr) {
|
|||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
} else if (command == "version") {
|
} else if (command == "version") {
|
||||||
|
if (args.count != 2) {
|
||||||
|
usage(args[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
build_context.command_kind = Command_version;
|
build_context.command_kind = Command_version;
|
||||||
gb_printf("%.*s version %.*s", LIT(args[0]), LIT(ODIN_VERSION));
|
gb_printf("%.*s version %.*s", LIT(args[0]), LIT(ODIN_VERSION));
|
||||||
|
|
||||||
@@ -3399,6 +3403,10 @@ int main(int arg_count, char const **arg_ptr) {
|
|||||||
gb_printf("\n");
|
gb_printf("\n");
|
||||||
return 0;
|
return 0;
|
||||||
} else if (command == "report") {
|
} else if (command == "report") {
|
||||||
|
if (args.count != 2) {
|
||||||
|
usage(args[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
build_context.command_kind = Command_bug_report;
|
build_context.command_kind = Command_bug_report;
|
||||||
print_bug_report_help();
|
print_bug_report_help();
|
||||||
return 0;
|
return 0;
|
||||||
@@ -3423,6 +3431,10 @@ int main(int arg_count, char const **arg_ptr) {
|
|||||||
}
|
}
|
||||||
init_filename = args[3];
|
init_filename = args[3];
|
||||||
} else if (command == "root") {
|
} else if (command == "root") {
|
||||||
|
if (args.count != 2) {
|
||||||
|
usage(args[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
gb_printf("%.*s", LIT(odin_root_dir()));
|
gb_printf("%.*s", LIT(odin_root_dir()));
|
||||||
return 0;
|
return 0;
|
||||||
} else if (command == "clear-cache") {
|
} else if (command == "clear-cache") {
|
||||||
|
|||||||
Reference in New Issue
Block a user