[Crash] World CLI validation (#4728)

* [Crash] World CLI validation

* Clean
This commit is contained in:
Chris Miles 2025-03-01 17:52:51 -06:00 committed by GitHub
parent acb7584e26
commit 23c4aa241b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -76,7 +76,7 @@ void PathManager::LoadPaths()
constexpr int path_width = 0; constexpr int path_width = 0;
constexpr int break_length = 70; constexpr int break_length = 70;
std::cout << std::endl; LogInfo("Loading server paths");
LogInfo("{}", Strings::Repeat("-", break_length)); LogInfo("{}", Strings::Repeat("-", break_length));
for (const auto& [name, in_path] : paths) { for (const auto& [name, in_path] : paths) {
if (!in_path.empty()) { if (!in_path.empty()) {

View File

@ -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; return false;
} }