From ee7183385396382663b6bd8bff66ba85dbb74b11 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 29 Oct 2024 18:02:46 +0100 Subject: [PATCH] [chip-tool][interactive] Add quit as an alias for quit() (#36283) --- .../interactive/InteractiveCommands.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp index 92861f7711d566..7c843cc900b07a 100644 --- a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp +++ b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp @@ -25,13 +25,14 @@ #include #include -constexpr char kInteractiveModePrompt[] = ">>> "; -constexpr char kInteractiveModeHistoryFileName[] = "chip_tool_history"; -constexpr char kInteractiveModeStopCommand[] = "quit()"; -constexpr char kCategoryError[] = "Error"; -constexpr char kCategoryProgress[] = "Info"; -constexpr char kCategoryDetail[] = "Debug"; -constexpr char kCategoryAutomation[] = "Automation"; +constexpr char kInteractiveModePrompt[] = ">>> "; +constexpr char kInteractiveModeHistoryFileName[] = "chip_tool_history"; +constexpr char kInteractiveModeStopCommand[] = "quit()"; +constexpr char kInteractiveModeStopAlternateCommand[] = "quit"; +constexpr char kCategoryError[] = "Error"; +constexpr char kCategoryProgress[] = "Info"; +constexpr char kCategoryDetail[] = "Debug"; +constexpr char kCategoryAutomation[] = "Automation"; namespace { @@ -387,7 +388,7 @@ CHIP_ERROR InteractiveStartCommand::RunCommand() bool InteractiveCommand::ParseCommand(char * command, int * status) { - if (strcmp(command, kInteractiveModeStopCommand) == 0) + if (strcmp(command, kInteractiveModeStopCommand) == 0 || strcmp(command, kInteractiveModeStopAlternateCommand) == 0) { // If scheduling the cleanup fails, there is not much we can do. // But if something went wrong while the application is leaving it could be because things have