Documentation
¶
Overview ¶
Package shell implements a terminal console handler for user defined commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPrompt = "> "
DefaultPrompt represents the command prompt when none is set for the Interface instance.
Functions ¶
Types ¶
type Cmd ¶
type Cmd struct {
// Name is the command name.
Name string
// Args defines the number of command arguments, meant to be in the
// Pattern capturing brackets.
Args int
// Pattern defines the command syntax and arguments.
Pattern *regexp.Regexp
// Syntax defines the Help() command syntax field.
Syntax string
// Help defines the Help() command description field.
Help string
// Fn defines the command handler.
Fn CmdFn
}
Cmd represents a shell command.
type Interface ¶
type Interface struct {
// Prompt represents the command prompt
Prompt string
// Banner represents the welcome message
Banner string
// Log represents the interface log file
Log *os.File
// ReadWriter represents the terminal connection
ReadWriter io.ReadWriter
// Output represents the interface output
Output io.Writer
// Terminal represents the VT100 terminal output
Terminal *term.Terminal
// Console represents the UEFI Console
Console *uefi.Console
}
Interface represents a terminal interface.
Click to show internal directories.
Click to hide internal directories.