From f213b8e5cfa5220614282d6fe0495e158c2a6e04 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 25 Nov 2024 14:04:17 +0000 Subject: Allow for `odin help build` etc --- src/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') 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."); -- cgit v1.2.3