From 07c6f8993da04ba253be90cc78a01975996639d5 Mon Sep 17 00:00:00 2001 From: proddy Date: Wed, 10 Jul 2024 12:53:30 +0200 Subject: [PATCH] show help when command not found --- lib/uuid-console/src/commands.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/uuid-console/src/commands.cpp b/lib/uuid-console/src/commands.cpp index a76eb09d5..7e4d97108 100644 --- a/lib/uuid-console/src/commands.cpp +++ b/lib/uuid-console/src/commands.cpp @@ -119,7 +119,7 @@ Commands::Execution Commands::execute_command(Shell & shell, CommandLine && comm result.error = nullptr; if (commands.exact.empty()) { - result.error = "Command not found"; + result.error = "Command not found. Try 'help' for a list of commands."; } else if (commands.exact.count(longest->first) == 1) { auto & command = longest->second; std::vector arguments; @@ -130,7 +130,7 @@ Commands::Execution Commands::execute_command(Shell & shell, CommandLine && comm command_line.reset(); if (commands.partial.upper_bound(longest->first) != commands.partial.end() && !arguments.empty()) { - result.error = "Command not found"; + result.error = "Command not found. Try 'help' for a list of commands."; } else if (arguments.size() < command->minimum_arguments()) { result.error = "Not enough arguments for command"; } else if (arguments.size() > command->maximum_arguments()) {