From 3200145d0175c018b5cf98631501e4b88e664d7e Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Sat, 17 Jun 2023 18:19:55 -0500 Subject: [PATCH] [CLI] Console menu validation fixes (#3413) --- common/cli/eqemu_command_handler.cpp | 2 +- world/cli/database_dump.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/cli/eqemu_command_handler.cpp b/common/cli/eqemu_command_handler.cpp index 1059ea2cf..b69711b54 100644 --- a/common/cli/eqemu_command_handler.cpp +++ b/common/cli/eqemu_command_handler.cpp @@ -77,7 +77,7 @@ namespace EQEmuCommand { index++; } - if (!arguments_filled || argc == 2 || cmd[{"-h", "--help"}]) { + if (!arguments_filled || (argc == 2 && !cmd[{"-h", "--help"}]) || (argc == 3 && cmd[{"-h", "--help"}])) { std::string arguments_string; for (auto &arg : arguments) { arguments_string += " " + arg; diff --git a/world/cli/database_dump.cpp b/world/cli/database_dump.cpp index bce0b37b0..18bd661c0 100644 --- a/world/cli/database_dump.cpp +++ b/world/cli/database_dump.cpp @@ -23,12 +23,12 @@ void WorldserverCLI::DatabaseDump(int argc, char **argv, argh::parser &cmd, std: "--compress" }; + EQEmuCommand::ValidateCmdInput(arguments, options, cmd, argc, argv); + if (cmd[{"-h", "--help"}]) { return; } - EQEmuCommand::ValidateCmdInput(arguments, options, cmd, argc, argv); - auto s = new DatabaseDumpService(); bool dump_all = cmd[{"-a", "--all"}];