|
FreeNOS
|
Builtin command for the Shell. More...
#include <ShellCommand.h>
Public Member Functions | |
| ShellCommand (const char *name, const Size minParams=0) | |
| Constructor. More... | |
| virtual | ~ShellCommand () |
| Destructor. More... | |
| const char * | getName () const |
| Get command name. More... | |
| const char * | getHelp () const |
| Get command help. More... | |
| Size | getMinimumParams () const |
| Get the minimum number of parameters required. More... | |
| virtual int | execute (const Size nparams, const char **params)=0 |
| Executes the command. More... | |
Protected Attributes | |
| const char * | m_name |
| Unique name of the command. More... | |
| const char * | m_help |
| Command help text. More... | |
| const Size | m_minParams |
| Minimum number of parameters required. More... | |
| ShellCommand::ShellCommand | ( | const char * | name, |
| const Size | minParams = 0 |
||
| ) |
Constructor.
| name | Unique name of the command. |
| minParams | Minimum number of parameters required by this command. |
Definition at line 20 of file ShellCommand.cpp.
|
virtual |
Destructor.
Definition at line 27 of file ShellCommand.cpp.
|
pure virtual |
Executes the command.
Implemented in HelpCommand, TimeCommand, WriteCommand, ChangeDirCommand, ExitCommand, and StdioCommand.
Referenced by Shell::executeInput().
| const char * ShellCommand::getHelp | ( | ) | const |
Get command help.
Definition at line 36 of file ShellCommand.cpp.
References m_help.
| Size ShellCommand::getMinimumParams | ( | ) | const |
Get the minimum number of parameters required.
Definition at line 41 of file ShellCommand.cpp.
References m_minParams.
Referenced by Shell::executeInput().
| const char * ShellCommand::getName | ( | ) | const |
Get command name.
Definition at line 31 of file ShellCommand.cpp.
References m_name.
Referenced by ChangeDirCommand::execute(), Shell::executeInput(), and Shell::registerCommand().
|
protected |
Command help text.
Definition at line 91 of file ShellCommand.h.
Referenced by ChangeDirCommand::ChangeDirCommand(), ExitCommand::ExitCommand(), getHelp(), HelpCommand::HelpCommand(), StdioCommand::StdioCommand(), TimeCommand::TimeCommand(), and WriteCommand::WriteCommand().
|
protected |
Minimum number of parameters required.
Definition at line 94 of file ShellCommand.h.
Referenced by getMinimumParams().
|
protected |
1.8.17