From 23c4aa241bb7c4444ee277cf92580fa3eb58f41d Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Sat, 1 Mar 2025 17:52:51 -0600 Subject: [PATCH] [Crash] World CLI validation (#4728) * [Crash] World CLI validation * Clean --- common/path_manager.cpp | 2 +- world/world_boot.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/path_manager.cpp b/common/path_manager.cpp index b767b8003..6acdeac35 100644 --- a/common/path_manager.cpp +++ b/common/path_manager.cpp @@ -76,7 +76,7 @@ void PathManager::LoadPaths() constexpr int path_width = 0; constexpr int break_length = 70; - std::cout << std::endl; + LogInfo("Loading server paths"); LogInfo("{}", Strings::Repeat("-", break_length)); for (const auto& [name, in_path] : paths) { if (!in_path.empty()) { diff --git a/world/world_boot.cpp b/world/world_boot.cpp index 6bd9eed7a..537e3056d 100644 --- a/world/world_boot.cpp +++ b/world/world_boot.cpp @@ -101,6 +101,13 @@ bool WorldBoot::HandleCommandInput(int argc, char **argv) } } + // check if we ran a valid command, this whole CLI handler needs to be improved at a later time + std::string arg1 = argc >= 2 ? argv[1] : ""; + if (argc >= 2 && !Strings::Contains(arg1, ":")) { + std::cout << "Invalid command, use --help to see available commands" << std::endl; + return true; + } + return false; }