Documentation
¶
Index ¶
- type Cmd
- func (sh Cmd) CombinedOut() (string, error)
- func (sh *Cmd) CustomShell(Shell_Name, Exec_Arg string)
- func (sh *Cmd) CustomStd(Stdin, Stdout, Stderr bool)
- func (sh Cmd) GetExec() *exec.Cmd
- func (sh Cmd) Out() (string, error)
- func (sh *Cmd) Run() error
- func (sh *Cmd) RunWithShell(set bool)
- func (sh Cmd) SetAndCombinedOut(command string) (string, error)
- func (sh Cmd) SetAndOut(command string) (string, error)
- func (sh Cmd) SetAndRun(command string) error
- func (sh Cmd) SetAndStart(command string) error
- func (sh *Cmd) SetInput(input string)
- func (sh *Cmd) SetPath(path string)
- func (sh Cmd) Start() error
- func (sh *Cmd) Stderr(set bool)
- func (sh *Cmd) Stdin(set bool)
- func (sh *Cmd) Stdout(set bool)
- func (sh *Cmd) UseBashShell(set bool)
- type SudoCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
global struct
func (Cmd) CombinedOut ¶ added in v1.3.0
It is the same as run, but returns one more string value (the output of the command)
func (*Cmd) CustomShell ¶ added in v1.3.0
Set a custom shell to exec the command
func (*Cmd) CustomStd ¶ added in v1.3.0
Set a custom stdin,stdout or stderr. Default std is all in false
func (Cmd) GetExec ¶ added in v1.3.0
Returns the exec.Cmd structure with all parameters already configured
func (Cmd) Out ¶ added in v1.3.0
It is the same as run, but skips the Std setting and returns an error value and the output as a string, i.e. exec.Command(<command>).Output()
func (*Cmd) Run ¶ added in v1.3.0
Executes normally the command with the parameters set, with the classic exec.Command(<command>).Run()
func (*Cmd) RunWithShell ¶ added in v1.3.0
If the value is true use exec.Command([shell],[arg],input) instead of exec.Command(input[0],input[1:]...)
func (Cmd) SetAndCombinedOut ¶ added in v1.3.0
It is the same as cmd := command.Cmd("<command>"); cmd.CombinedOut() but in a single argument, what it does is to put an internal input (the one provided) and execute it directly without affecting the main structure.
func (Cmd) SetAndOut ¶ added in v1.3.0
It is the same as cmd := command.Cmd("<command>"); cmd.Out() but in a single argument, what it does is to put an internal input (the one provided) and execute it directly without affecting the main structure.
func (Cmd) SetAndRun ¶ added in v1.3.0
It is the same as cmd := command.Cmd("<command>"); cmd.Run() but in a single argument, what it does is to put an internal input (the one provided) and execute it directly without affecting the main structure.
func (Cmd) SetAndStart ¶ added in v1.3.0
It is the same as cmd := command.Cmd("<command>"); cmd.Start() but in a single argument, what it does is to put an internal input (the one provided) and execute it directly without affecting the main structure.
func (Cmd) Start ¶ added in v1.3.0
Run the command in a new goroutine, just like cmd.Run(), but using exec.Command(<cmd>).Start()
func (*Cmd) UseBashShell ¶ added in v1.3.0
type SudoCmd ¶ added in v1.3.0
type SudoCmd struct {
Cmd
// contains filtered or unexported fields
}
func (SudoCmd) CombinedOut ¶ added in v1.3.0
func (*SudoCmd) SetSudoPasswd ¶ added in v1.3.0
Sudo parameters