A block command is one that consists of multiple input lines between some sort of start and end indicator.
A block command is one that consists of multiple input lines between
some sort of start and end indicator. Mixing this trait into a command
handler changes the behavior of the command reader when it see the
command. Instead of calling moreInputNeeded() to determine when to
stop reading, the command reader just keeps reading until it sees a
line matching the EndCommand regular expression.
Mapped commands.
Actions returned by handlers.
Trait for an object (or class) that handles a single command.
Trait for an object (or class) that handles a single command. All logic for a given command is embodied in a single object that mixes in this trait.
Base class for command interpreters.
Base class for command interpreters.
CommandInterpreter is the base class of any command interpreter. This
class and the CommandHandler trait provide a simple framework for
writing line-oriented command-interpreters. This framework is
conceptually similar to the Python cmd module and its Cmd class,
though the implementation differs substantially in places.
For reading input from the console, CommandInterpreter will use of
any of the readline libraries supported by the grizzled.readline
package. All of those libraries support a persistent command history,
and most support command completion and command editing.
A command line consists of an initial command name, followed by a list
of arguments to that command. The CommandInterpreter class's
command reader automatically separates the command and the remaining
arguments, via the splitCommandAndArgs() method. Parsing the
arguments is left to the actual command implementation. The rules for how
the command is split from the remainder of the input line are outlined
in the documentation for the splitCommandAndArgs() method.
The handler trait for a hidden command.
The handler trait for a hidden command. Hidden commands don't show up in the help or the history.
Simple history command handler.
Simple history command handler.
A simple "history" (alias: "h") handler that displays the history to standard output. This history handler supports the following usage:
history [n]
Where n is the number of (most recent) history entries to show. If absent, n defaults to the size of the history buffer.
This handler is not installed by default. It is provided as a convenience, for command interpreters to use if desired.
Mixed in to indicate no completions are available.
Simple "redo command" handler.
Simple "redo command" handler.
A simple "redo" command handler that supports re-issuing a numbered command from the history or the last command with a given prefix. For example, it supports the following syntaxes:
Input: !10, ! 10, or r 10
Meaning: Repeat the 10th command in the history.
Input: `!ec`, `! ec`, or `r ec`
Meaning: Repeat the most recent command whose name begins with "ec"
Input: `!!`, `! !`, `r`
Meaning: Repeat the last command.
This handler is ''not'' installed by default. It is provided as a
convenience, for command interpreters to use if desired.
Miscellaneous useful utility functions.
Classes and objects to aid in the construction of line-oriented command interpreters. This package is very similar, in concept, to the Python
cmdmodule (though its implementation differs quite a bit).