Skip to content

Commit

Permalink
[chip-tool][interactive] Add quit as an alias for quit() (#36283)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored Oct 29, 2024
1 parent 3d80093 commit ee71833
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions examples/chip-tool/commands/interactive/InteractiveCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
#include <string>
#include <vector>

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 {

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ee71833

Please sign in to comment.