cmdtools

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCmd

func RunCmd(command string, override ...*exechelper.Option) error

Types

type CmdOutput

type CmdOutput struct {
	Stdout    []byte
	Stderr    []byte
	ErrorCode int
}

func RunCmdAndGetOutput

func RunCmdAndGetOutput(command string, additional ...*exechelper.Option) (*CmdOutput, error)

The behavior of the func is similar to the one of golang http client. Getting error code from the command is not considered an error, only a generic error when we failed to get any error code. It's up to handling code to interpret the error code value. If you want to treat all non zero error code as errors, make a wrapper function

func RunCmdAndGetOutputNoErrCode

func RunCmdAndGetOutputNoErrCode(command string, additional ...*exechelper.Option) (*CmdOutput, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL