Skip to content

Commit ee71833

Browse files
authored
[chip-tool][interactive] Add quit as an alias for quit() (project-chip#36283)
1 parent 3d80093 commit ee71833

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

examples/chip-tool/commands/interactive/InteractiveCommands.cpp

+9-8
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@
2525
#include <string>
2626
#include <vector>
2727

28-
constexpr char kInteractiveModePrompt[] = ">>> ";
29-
constexpr char kInteractiveModeHistoryFileName[] = "chip_tool_history";
30-
constexpr char kInteractiveModeStopCommand[] = "quit()";
31-
constexpr char kCategoryError[] = "Error";
32-
constexpr char kCategoryProgress[] = "Info";
33-
constexpr char kCategoryDetail[] = "Debug";
34-
constexpr char kCategoryAutomation[] = "Automation";
28+
constexpr char kInteractiveModePrompt[] = ">>> ";
29+
constexpr char kInteractiveModeHistoryFileName[] = "chip_tool_history";
30+
constexpr char kInteractiveModeStopCommand[] = "quit()";
31+
constexpr char kInteractiveModeStopAlternateCommand[] = "quit";
32+
constexpr char kCategoryError[] = "Error";
33+
constexpr char kCategoryProgress[] = "Info";
34+
constexpr char kCategoryDetail[] = "Debug";
35+
constexpr char kCategoryAutomation[] = "Automation";
3536

3637
namespace {
3738

@@ -387,7 +388,7 @@ CHIP_ERROR InteractiveStartCommand::RunCommand()
387388

388389
bool InteractiveCommand::ParseCommand(char * command, int * status)
389390
{
390-
if (strcmp(command, kInteractiveModeStopCommand) == 0)
391+
if (strcmp(command, kInteractiveModeStopCommand) == 0 || strcmp(command, kInteractiveModeStopAlternateCommand) == 0)
391392
{
392393
// If scheduling the cleanup fails, there is not much we can do.
393394
// But if something went wrong while the application is leaving it could be because things have

0 commit comments

Comments
 (0)