Documentation ¶
Index ¶
- Variables
- func Message(format string, a ...interface{})
- func OurGetEnv(name string) (string, bool)
- func Parse(stream Stream, text string) ([][]*_Statement, error)
- func Quote(src string) string
- func ReplaceIgnoreCase(s, old, new string) string
- type AlreadyReportedError
- type ArgsHookT
- type BufStream
- type CloneCloser
- type Cmd
- func (cmd *Cmd) Arg(n int) string
- func (cmd *Cmd) Args() []string
- func (cmd *Cmd) Close()
- func (cmd *Cmd) DumpEnv() []string
- func (cmd *Cmd) FullPath() string
- func (cmd *Cmd) Getenv(key string) string
- func (cmd *Cmd) RawArg(n int) string
- func (cmd *Cmd) RawArgs() []string
- func (cmd *Cmd) SetArgs(s []string)
- func (cmd *Cmd) SetRawArgs(s []string)
- func (cmd *Cmd) Setenv(key, val string)
- func (cmd *Cmd) Spawnvp(ctx context.Context) (int, error)
- type CmdSeeker
- type CmdStreamFile
- type History
- type HookT
- type NulStream
- type Shell
- func (sh *Shell) Close()
- func (sh *Shell) Command() *Cmd
- func (sh *Shell) Err() io.Writer
- func (sh *Shell) ForEver(ctx context.Context, stream Stream) error
- func (sh *Shell) GetHistory() History
- func (sh *Shell) In() io.Reader
- func (sh *Shell) Interpret(ctx context.Context, text string) (errorlevel int, finalerr error)
- func (sh *Shell) Loop(ctx0 context.Context, stream Stream) (int, error)
- func (sh *Shell) Out() io.Writer
- func (sh *Shell) ReadCommand(ctx context.Context) (context.Context, string, error)
- func (sh *Shell) SetTag(tag CloneCloser)
- func (sh *Shell) Source(ctx context.Context, fname string) error
- func (sh *Shell) Spawnlp(ctx context.Context, args, rawargs []string) (int, error)
- func (sh *Shell) Spawnlpe(ctx context.Context, args, rawargs []string, env map[string]string) (int, error)
- func (sh *Shell) Tag() CloneCloser
- func (sh *Shell) Term() io.Writer
- type Stream
Constants ¶
This section is empty.
Variables ¶
View Source
var GlobUseSlash = false
View Source
var LastErrorLevel int
View Source
var LookCurdirOrder = nodos.LookCurdirFirst
View Source
var NoClobber = false
View Source
var OnCommandNotFound = func(ctx context.Context, cmd *Cmd, err error) error {
err = &_CommandNotFound{cmd.args[0], err}
return err
}
View Source
var PercentFunc = map[string]func() string{ "CD": func() string { wd, err := os.Getwd() if err == nil { return wd } return "" }, "ERRORLEVEL": func() string { return fmt.Sprintf("%d", LastErrorLevel) }, "DATE": func() string { s, err := nodos.TimeFormatOsLayout(time.Now()) if err != nil { return err.Error() } return s }, "TIME": func() string { return time.Now().Format("15:04:05.00") }, }
View Source
var PostExecHook func(context.Context, *Cmd)
View Source
var PreExecHook func(context.Context, *Cmd)
View Source
var TildeExpansion = true
View Source
var UseSourceRunBatch = true
View Source
var WildCardExpansionAlways = false
Functions ¶
func ReplaceIgnoreCase ¶
ReplaceIgnoreCase works like strings.Replace but ignores cases.
Types ¶
type AlreadyReportedError ¶
type AlreadyReportedError struct {
Err error
}
func (AlreadyReportedError) Error ¶
func (AlreadyReportedError) Error() string
type ArgsHookT ¶
type ArgsHookT func(ctx context.Context, sh *Shell, args, rawargs []string) ([]string, []string, error)
func SetArgsHook ¶
type BufStream ¶
type BufStream struct {
// contains filtered or unexported fields
}
func (*BufStream) DisableHistory ¶
type CloneCloser ¶
type Cmd ¶
type Cmd struct { Shell UseShellExecute bool Closers []io.Closer OnBackExec func(int) OnBackDone func(int) // contains filtered or unexported fields }
func (*Cmd) SetRawArgs ¶
type CmdStreamFile ¶
func NewCmdStreamFile ¶
func NewCmdStreamFile(r io.Reader) *CmdStreamFile
func (*CmdStreamFile) DisableHistory ¶
func (*CmdStreamFile) DisableHistory(value bool) bool
type NulStream ¶
type NulStream struct{}
NulStream is the null implementation for the interface Stream.
func (*NulStream) DisableHistory ¶
DisableHistory do nothing.
type Shell ¶
type Shell struct { Stream History History LineHook func(context.Context, *Cmd) (int, bool, error) ArgsHook func(context.Context, *Shell, []string, []string) ([]string, []string, error) Stdio [3]*os.File Console io.Writer IsBackGround bool // contains filtered or unexported fields }
func (*Shell) GetHistory ¶
func (*Shell) ReadCommand ¶
ReadCommand reads completed one command from `stream`.
func (*Shell) SetTag ¶
func (sh *Shell) SetTag(tag CloneCloser)
func (*Shell) Tag ¶
func (sh *Shell) Tag() CloneCloser
Click to show internal directories.
Click to hide internal directories.