The name of the command.
The name of the command. This name, or any of the aliases (see below) will cause the command to be invoked.
The help for this command.
The help for this command. The help string is written as is to the screen. It is not wrapped, indented, or otherwise reformatted. It may be a single string or a multiline string.
Additional aliases for the command, if any.
Additional aliases for the command, if any.
Compares a prefix string to this command name and its aliases, to determine whether the prefix string could possibly be completed by the name or aliases.
Compares a prefix string to this command name and its aliases, to determine whether the prefix string could possibly be completed by the name or aliases. This method is obviously used to facilitate tab-completion. The default implementation of this method simply forces both strings to lower case before performing a substring comparison between them. Overridden definitions of this method can apply other matching criteria.
the prefix to compare
a list of the strings (name and/or aliases) that could be
completed by prefix
, or Nil
.
Perform completion on the command, returning the possible completions.
Perform completion on the command, returning the possible
completions. This method has the exact same interface and use as the
complete()
method in grizzled.readline.Completer
.
Please see that trait for full documentation.
the token being completed
the token context (i.e., list of parsed tokens, with cursor)
the current unparsed input line, which includes the token
Whether or not the command is hidden.
Whether or not the command is hidden. Hidden commands don't show up
in the help list or the history. Using the HiddenCommandHandler
trait saves a lot of work.
Compares a command name (that the user typed in, for instance) to this command's name.
Compares a command name (that the user typed in, for instance) to this command's name. The default implementation of this method simply forces both names to lower case before comparing them. Overridden definitions of this method can apply other matching criteria.
the candidate name to be compared with this one
true
if they match, false
if not
This method is called after a line is read that matches this command, to determine whether more lines need to be read to finish the command.
This method is called after a line is read that matches this command,
to determine whether more lines need to be read to finish the command.
The default implementation returns false
, meaning a single
input line suffices for the entire command. Implementing classes or
objects can override this method to ensure that the command has a
required terminating character (e.g., a ";"), doesn't end with a line
continuation character (e.g., "\"), or whatever the syntax requires.
the line read so far
Handle the command.
Handle the command. The first white space-delimited token in the command
string is guaranteed to match the name of this command, by the rules of
the matches()
method.
the remainder of the unparsed command line
KeepGoing
to tell the main loop to continue,
or Stop
to tell the main loop to be done.
Whether or not the command should be put in the history.
Whether or not the command should be put in the history.
Simple history command handler.
A simple "history" (alias: "h") handler that displays the history to standard output. This history handler supports the following usage:
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.