Skip to content

Commit

Permalink
Shell overview documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rweather committed Mar 11, 2016
1 parent c24e67c commit 6f03fa2
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions libraries/Terminal/Shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,58 @@
* \class Shell Shell.h <Shell.h>
* \brief Command-line shell access.
*
* This class provides a command-line shell via serial ports, TCP connections,
* or any other type of Stream.
*
* The following example is the minimal setup for a command-line shell
* on a serial port. The application calls begin() to set the underlying
* Stream, and periodically calls loop() to manage shell-related events.
*
* \code
* Shell shell;
*
* void setup() {
* Serial.begin(9600);
* shell.setPrompt("$ ");
* shell.begin(Serial);
* }
*
* void loop() {
* shell.loop();
* }
* \endcode
*
* Commands can be registered with the shell by the application to be
* invoked when the user types in the corresponding command. Each
* command is associated with a handler function:
*
* \code
* void cmdMotor(Shell &shell, int argc, const ShellArguments &argv)
* {
* ...
* }
*
* ShellCommand(motor, "Turn the motor on or off", cmdMotor);
* \endcode
*
* There are two standard commands built into Shell: "help" and "exit".
* The "help" command provides a list of all registered commands with
* the short help string from the ShellCommand() registration.
* The "exit" command logs the user out and returns to the login prompt,
* or stops the underlying connection in the case of TCP streams.
*
* The F1 key can be used as a synonym for "help" and CTRL-D can be used
* as a synonym for "exit".
*
* Shell provides some limited history editing for scrolling back through
* previous commands. The size of the history stack is provided in the
* second argument to begin():
*
* \code
* shell.begin(Serial, 5);
* \endcode
*
* \sa Terminal
*/

/**
Expand Down

0 comments on commit 6f03fa2

Please sign in to comment.