Documentation
¶
Index ¶
- type Cmd
- func (sh Cmd) CombinedOut() (string, error)
- func (sh *Cmd) CustomCmdFlags(flags string)
- func (sh *Cmd) CustomPSFlags(flags string)
- func (sh *Cmd) CustomStd(Stdin, Stdout, Stderr bool)
- func (sh *Cmd) HideCmdWindow(set bool)
- func (sh Cmd) Out() (string, error)
- func (sh Cmd) Run() error
- func (sh *Cmd) RunWithPS(set bool)
- func (sh *Cmd) RunWithoutCmd(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)
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
}
func InitCmd ¶ added in v1.3.0
Initializes a new instance of the command, already setting the command to run
func (Cmd) CombinedOut ¶ added in v1.3.0
Execute the command with all parameters already set, something like "exec.Command([formatted command]).CombinedOutput()" and return its error and string output, as well as executing with output to stdin,stdout and stderr.
func (*Cmd) CustomCmdFlags ¶ added in v1.3.0
It sets the customized cmd flags, its syntax when executed would be something like this "cmd.exe [flags] /c command".
func (*Cmd) CustomPSFlags ¶ added in v1.3.0
It sets the customized powershell flags, its syntax when executed would be something like this "powershell.exe [flags] /c command".
func (*Cmd) HideCmdWindow ¶ added in v1.3.0
Hides the cmd/powershell window that appears when executing a command in go.
func (Cmd) Out ¶ added in v1.3.0
Execute the command with all the parameters already set, something like "exec.Command([formatted command]).Output()" and return its string and error output
func (Cmd) Run ¶ added in v1.3.0
Execute the command with all the parameters already set, something like "exec.Command([formatted command]).Run()" and return its error output
func (*Cmd) RunWithPS ¶ added in v1.3.0
Run the command using "powershell.exe [parameters] /c command" instead of "cmd.exe [parameters] /c command"
func (*Cmd) RunWithoutCmd ¶ added in v1.3.0
Execute the command directly, it is useful if you want to execute a binary, this mode does not have access to the path so you will have to put the full path of the binary or use something relative to execute it.
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.