Skip to content

Commit

Permalink
Allow "?" to be used as a synonym for "help"
Browse files Browse the repository at this point in the history
  • Loading branch information
rweather committed Mar 9, 2016
1 parent 25aeeb0 commit 9e6f6cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libraries/Terminal/Shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,10 @@ void Shell::end()

/** @cond */

// Standard command names for use with executeBuiltin().
// Standard builtin command names.
static char const builtin_cmd_exit[] PROGMEM = "exit";
static char const builtin_cmd_help[] PROGMEM = "help";
static char const builtin_cmd_help_alt[] PROGMEM = "?";

/** @endcond */

Expand Down Expand Up @@ -518,7 +519,8 @@ void Shell::execute()
if (argc > 0) {
if (!execute(argc, argv)) {
// Could not find a matching command, try the builtin "help".
if (!strcmp_P(argv[0], builtin_cmd_help)) {
if (!strcmp_P(argv[0], builtin_cmd_help) ||
!strcmp_P(argv[0], builtin_cmd_help_alt)) {
help();
} else {
static char const unknown_cmd[] PROGMEM = "Unknown command: ";
Expand Down

0 comments on commit 9e6f6cf

Please sign in to comment.