Documentation
¶
Index ¶
- type WinCmd
- func (sh WinCmd) CombinedOut() (string, error)
- func (sh *WinCmd) CustomCmdFlags(flags string)
- func (sh *WinCmd) CustomPSFlags(flags string)
- func (sh *WinCmd) CustomStd(Stdin, Stdout, Stderr bool)
- func (sh *WinCmd) HideCmdWindow(set bool)
- func (sh WinCmd) Out() (string, error)
- func (sh WinCmd) Run() error
- func (sh *WinCmd) RunWithPS(set bool)
- func (sh *WinCmd) RunWithoutCmd(set bool)
- func (sh WinCmd) SetAndCombinedOut(command string) (string, error)
- func (sh WinCmd) SetAndOut(command string) (string, error)
- func (sh WinCmd) SetAndRun(command string) error
- func (sh WinCmd) SetAndStart(command string) error
- func (sh *WinCmd) SetInput(input string)
- func (sh *WinCmd) SetPath(path string)
- func (sh WinCmd) Start() error
- func (sh *WinCmd) Stderr(set bool)
- func (sh *WinCmd) Stdin(set bool)
- func (sh *WinCmd) Stdout(set bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WinCmd ¶
type WinCmd struct {
// contains filtered or unexported fields
}
func (WinCmd) CombinedOut ¶
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 (*WinCmd) CustomCmdFlags ¶
It sets the customized cmd flags, its syntax when executed would be something like this "cmd.exe [flags] /c command".
func (*WinCmd) CustomPSFlags ¶
It sets the customized powershell flags, its syntax when executed would be something like this "powershell.exe [flags] /c command".
func (*WinCmd) HideCmdWindow ¶
Hides the cmd/powershell window that appears when executing a command in go.
func (WinCmd) Out ¶
Execute the command with all the parameters already set, something like "exec.Command([formatted command]).Output()" and return its string and error output
func (WinCmd) Run ¶
Execute the command with all the parameters already set, something like "exec.Command([formatted command]).Run()" and return its error output
func (*WinCmd) RunWithPS ¶
Run the command using "powershell.exe [parameters] /c command" instead of "cmd.exe [parameters] /c command"
func (*WinCmd) RunWithoutCmd ¶
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 (WinCmd) SetAndCombinedOut ¶
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 (WinCmd) SetAndOut ¶
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 (WinCmd) SetAndRun ¶
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 (WinCmd) SetAndStart ¶
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.