From fac793b9c939e676a8893561b2ecf4e9c3152a20 Mon Sep 17 00:00:00 2001 From: dongwlin Date: Sat, 9 Dec 2023 15:50:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20help=20=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/cli/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/cli/main.cpp b/source/cli/main.cpp index 3b88380..640f49c 100644 --- a/source/cli/main.cpp +++ b/source/cli/main.cpp @@ -8,6 +8,11 @@ int main(int argc, char** argv) return 1; } + if (flags["help"]) { + print_help(); + return 0; + } + MaaToolKitInit(); print_help(); @@ -165,8 +170,8 @@ int main(int argc, char** argv) bool parse_param(int argc, char** argv, std::unordered_map& options, std::unordered_map& flags) { - std::unordered_set allowed_param = { "control", "device", "tasks", "init" }; - std::unordered_set flags_key = { "init" }; + std::unordered_set allowed_param = { "control", "device", "tasks", "init", "help" }; + std::unordered_set flags_key = { "init", "help" }; for (auto& key : flags_key) { flags[key] = false; } @@ -222,6 +227,9 @@ Usage: MAABH3_CLI [option] --device [config] Specify the device config --tasks [config] Specify the tasks config +Flags: + --help Display this help message + Modify ./config/tasks/default.json to configure tasks. Welcome to come and create a GUI for us! :)