aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-11-25 14:04:17 +0000
committergingerBill <bill@gingerbill.org>2024-11-25 14:04:17 +0000
commitf213b8e5cfa5220614282d6fe0495e158c2a6e04 (patch)
tree0ccb1f414170acf55776189e451bd3c7e5389268 /src/main.cpp
parent1a0a6c485d49d9025816e054483387c80731dbbe (diff)
Allow for `odin help build` etc
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 8a5339000..4815f6bb4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2175,13 +2175,19 @@ gb_internal void remove_temp_files(lbGenerator *gen) {
}
-gb_internal void print_show_help(String const arg0, String const &command, String optional_flag = {}) {
+gb_internal void print_show_help(String const arg0, String command, String optional_flag = {}) {
+ if (command == "help" && optional_flag.len != 0 && optional_flag[0] != '-') {
+ command = optional_flag;
+ optional_flag = {};
+ }
+
print_usage_line(0, "%.*s is a tool for managing Odin source code.", LIT(arg0));
print_usage_line(0, "Usage:");
print_usage_line(1, "%.*s %.*s [arguments]", LIT(arg0), LIT(command));
print_usage_line(0, "");
defer (print_usage_line(0, ""));
+
if (command == "build") {
print_usage_line(1, "build Compiles directory of .odin files as an executable.");
print_usage_line(2, "One must contain the program's entry point, all must be in the same package.");