Documentation
¶
Index ¶
- type Arguments
- type BasicScanner
- type Context
- func (ctx *Context) GetAllVars() (all Arguments)
- func (ctx *Context) GetScope(scope Scope) Arguments
- func (ctx *Context) GetVar(k string) (string, bool)
- func (ctx *Context) GetVarNames() (names []string)
- func (ctx *Context) PopScope()
- func (ctx *Context) PushScope(vars map[string]string, args []string)
- func (ctx *Context) ReadBlock(body, next, cont string) ([]string, []string, error)
- func (ctx *Context) ReadLine(prompt, cont string) (line string, err error)
- func (ctx *Context) ResetTerminal()
- func (ctx *Context) RestoreMode(m liner.ModeApplier)
- func (ctx *Context) ScanBlock(block []string) BasicScanner
- func (ctx *Context) ScanLiner() BasicScanner
- func (ctx *Context) ScanReader(r io.Reader) BasicScanner
- func (ctx *Context) SetScanner(curr BasicScanner) (prev BasicScanner)
- func (ctx *Context) SetVar(k string, v interface{}, scope Scope)
- func (ctx *Context) SetWordCompleter(...)
- func (ctx *Context) ShiftArgs(n int)
- func (ctx *Context) StartLiner(history string)
- func (ctx *Context) StopLiner()
- func (ctx *Context) TerminalMode() (liner.ModeApplier, error)
- func (ctx *Context) UnsetVar(k string, scope Scope)
- func (ctx *Context) UpdateHistory(line string)
- func (ctx *Context) UpdateVar(k string, scope Scope, update func(string) interface{}) string
- type Dict
- type List
- type ScanLiner
- type ScanLines
- type ScanReader
- type Scope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicScanner ¶
A basic scanner interface
type Context ¶
func NewContext ¶
func NewContext() *Context
func (*Context) GetAllVars ¶
GetAllVars return a copy of all variables available at the current scope
func (*Context) GetVarNames ¶
GetAllVars return a copy of all variables available at the current scope
func (*Context) PopScope ¶
func (ctx *Context) PopScope()
PopScope removes the current scope, restoring the previous one
func (*Context) ResetTerminal ¶
func (ctx *Context) ResetTerminal()
func (*Context) RestoreMode ¶
func (ctx *Context) RestoreMode(m liner.ModeApplier)
func (*Context) ScanBlock ¶
func (ctx *Context) ScanBlock(block []string) BasicScanner
ScanBlock sets the current scanner to a block scanner
func (*Context) ScanLiner ¶
func (ctx *Context) ScanLiner() BasicScanner
ScanLiner sets the current scanner to a "liner" scanner
func (*Context) ScanReader ¶
func (ctx *Context) ScanReader(r io.Reader) BasicScanner
ScanReader sets the current scanner to an io.Reader scanner
func (*Context) SetScanner ¶
func (ctx *Context) SetScanner(curr BasicScanner) (prev BasicScanner)
SetScanner sets the current scanner and return the previos one
func (*Context) SetWordCompleter ¶
func (*Context) StartLiner ¶
func (*Context) TerminalMode ¶
func (ctx *Context) TerminalMode() (liner.ModeApplier, error)
func (*Context) UpdateHistory ¶
type ScanLiner ¶
type ScanLiner struct {
// contains filtered or unexported fields
}
An implementation of basicScanner that works with "liner"
type ScanLines ¶
type ScanLines struct {
// contains filtered or unexported fields
}
An implementation of basicScanner that works on a list of lines
type ScanReader ¶
type ScanReader struct {
// contains filtered or unexported fields
}
An implementation of basicScanner that works with an io.Reader (wrapped in a bufio.Scanner)
func (*ScanReader) Err ¶
func (s *ScanReader) Err() error
func (*ScanReader) Scan ¶
func (s *ScanReader) Scan(prompt string) bool
func (*ScanReader) Text ¶
func (s *ScanReader) Text() string