|
CLI v1.0.0
Custom cli console for creating commands executable at runtime
|
Console represents the customisable console. More...
#include <cli.hpp>
Classes | |
| class | Node |
Public Member Functions | |
| Node & | operator[] (const std::string &key) |
| Used to add a new command. | |
| void | Run () |
| Starts the custom console. | |
| void | Run (std::string filename) |
| Starts the custom console and executes commands from a file. | |
Public Attributes | ||
| bool | stop = false | |
| Manages if the main loop should stop. | ||
| struct { | ||
| bool newLineAutoComplete = true | ||
| Sets the style of autocomplete. More... | ||
| int histSize = 10 | ||
| Sets the size of history. More... | ||
| } | settings | |
| Console settings. | ||
Console represents the customisable console.
Console sets up raw mode for the console, manages settings, autocomplete when typing commands, and executing stored commands.
| Console::Node & cli::Console::operator[] | ( | const std::string & | key | ) |
Used to add a new command.
Can be chained togehter with Console::Node::operator[] to add more complex commands.
| key | Command name |
| void cli::Console::Run | ( | ) |
Starts the custom console.
Sets up raw mode for custom key functionality and begins the main loop.\

| void cli::Console::Run | ( | std::string | filename | ) |
Starts the custom console and executes commands from a file.
Like Run() but also executes commands from a file. Useful when a script file is wanted.

| int cli::Console::histSize = 10 |
Sets the size of history.
History can be accessed with Up/Down arrow keys.
| bool cli::Console::newLineAutoComplete = true |
Sets the style of autocomplete.
When true creates a new line when autocompleating Cisco-style. When false keeps the autocomplete in the same line like in a terminal.
| bool cli::Console::stop = false |
Manages if the main loop should stop.
Set to true if you want to stop the console from running.