From 9e6f6cfb2d55ed2c13bb3936de40ffa73e00a152 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Wed, 9 Mar 2016 17:56:49 +1000 Subject: [PATCH] Allow "?" to be used as a synonym for "help" --- libraries/Terminal/Shell.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/Terminal/Shell.cpp b/libraries/Terminal/Shell.cpp index 2393b835..bcfb4ae6 100644 --- a/libraries/Terminal/Shell.cpp +++ b/libraries/Terminal/Shell.cpp @@ -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 */ @@ -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: ";