Documentation
¶
Index ¶
- Variables
- func ErrExit()
- func Path(parts ...string) string
- func PathTemplate(parts ...string) func(...interface{}) string
- func Quote(arg string) string
- func QuoteValues(arg ...string) []string
- func SetDefaultShell(shell string)
- type Command
- func (c *Command) ErrFn() func(...interface{}) error
- func (c *Command) OutputFn() func(...interface{}) (string, error)
- func (c *Command) Pipe(cmd ...interface{}) *Command
- func (c *Command) ProcFn() func(...interface{}) *Process
- func (c *Command) Run() *Process
- func (c *Command) RunInteractive() *Process
- func (c *Command) ToString() string
- type Process
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Available shell list ShellList = map[string][]string{ "zsh": {"/bin/zsh", "-o", "errexit", "-o", "pipefail", "-c"}, "bash": {"/bin/bash", "-o", "errexit", "-o", "pipefail", "-c"}, "termux-bash": {"/data/data/com.termux/files/usr/bin/bash", "-o", "errexit", "-o", "pipefail", "-c"}, "sh": {"/bin/sh", "-o", "errexit", "-c"}, } // Shell for command invocation Shell = []string{"/data/data/com.termux/files/usr/bin/bash", "-o", "errexit", "-c"} // Specifies if panic is thrown if command fails Panic = true // Error func hook if command fails ErrorFunc = func(c *Command, p *Process) {} // Verbose func hook before command is executed VerboseFunc = func(c *Command) {} // Trace command for each executed Trace = false // Trae output prefix TracePrefix = "+" )
View Source
var Tee io.Writer
Functions ¶
func PathTemplate ¶
func QuoteValues ¶
Quote multiple shell arguments as string list
func SetDefaultShell ¶
func SetDefaultShell(shell string)
Sets the default shell (eg. "sh" or "bash") for command execution and usage in ShellCommandBuilder
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func (*Command) RunInteractive ¶
Run command in interactive mode
Click to show internal directories.
Click to hide internal directories.