Skip to content

Commit

Permalink
feat: help 命令
Browse files Browse the repository at this point in the history
  • Loading branch information
dongwlin committed Dec 9, 2023
1 parent 3a04d01 commit fac793b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions source/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ int main(int argc, char** argv)
return 1;
}

if (flags["help"]) {
print_help();
return 0;
}

MaaToolKitInit();

print_help();
Expand Down Expand Up @@ -165,8 +170,8 @@ int main(int argc, char** argv)
bool parse_param(int argc, char** argv, std::unordered_map<std::string, std::string>& options,
std::unordered_map<std::string, bool>& flags)
{
std::unordered_set<std::string> allowed_param = { "control", "device", "tasks", "init" };
std::unordered_set<std::string> flags_key = { "init" };
std::unordered_set<std::string> allowed_param = { "control", "device", "tasks", "init", "help" };
std::unordered_set<std::string> flags_key = { "init", "help" };
for (auto& key : flags_key) {
flags[key] = false;
}
Expand Down Expand Up @@ -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! :)
Expand Down

0 comments on commit fac793b

Please sign in to comment.