Documentation
¶
Index ¶
- func Exec(binary string, args []string, env []string) error
- func Launch(args []string, env []string, exe func(string, []string, []string) error) error
- func Spawn(binary string, args []string, env []string) error
- type Commanding
- func (c *Commanding) Args(args ...string) *Commanding
- func (c *Commanding) Env(env ...string) *Commanding
- func (c *Commanding) EnvMap(env map[string]interface{}) *Commanding
- func (c Commanding) Execute() error
- func (c *Commanding) Inherit(from int) *Commanding
- func (c *Commanding) LookPath(name string) (*Commanding, error)
- func (c *Commanding) String() string
- type Executor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Commanding ¶
type Commanding struct {
Cmd *exec.Cmd
Prefix string
Binary string
// contains filtered or unexported fields
}
func New ¶
func New(prefix string) *Commanding
func (*Commanding) Args ¶
func (c *Commanding) Args(args ...string) *Commanding
Append args to the command arguments.
func (*Commanding) Env ¶
func (c *Commanding) Env(env ...string) *Commanding
Append env to the command environment.
func (*Commanding) EnvMap ¶
func (c *Commanding) EnvMap(env map[string]interface{}) *Commanding
Append the map to the command environment as key=value for each key/value pair, quoting value.
func (Commanding) Execute ¶
func (c Commanding) Execute() error
Exec the command. To execute a specific binary without first calling c.LookPath, just set c.Binary
func (*Commanding) Inherit ¶
func (c *Commanding) Inherit(from int) *Commanding
Append os.Args[from:] to the command arguments.
func (*Commanding) LookPath ¶
func (c *Commanding) LookPath(name string) (*Commanding, error)
Looks up the prefix+name in the PATH. If found, assigns c.Binary. To execute a specific binary without first calling c.LookPath, just set c.Binary
func (*Commanding) String ¶
func (c *Commanding) String() string
Reproduce a command line string that reflects a usable command line.
Click to show internal directories.
Click to hide internal directories.