cmd

package
v1.0.40 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Output

func Output(cmd string, args ...string) (string, error)

func Quote added in v1.0.39

func Quote(s string) string

quote for shell print, don't use it to quote args passed to go cmd NOTE: this is for bash-like shells, not tested against PowerShell and CMD on windows

func Run

func Run(cmd string, args ...string) error

Types

type CmdBuilder

type CmdBuilder struct {
	// contains filtered or unexported fields
}

func Debug added in v1.0.37

func Debug() *CmdBuilder

func Dir

func Dir(dir string) *CmdBuilder

func Env

func Env(env []string) *CmdBuilder

func IgnoreError added in v1.0.40

func IgnoreError(b ...bool) *CmdBuilder

func New added in v1.0.8

func New() *CmdBuilder

func (*CmdBuilder) Debug added in v1.0.37

func (c *CmdBuilder) Debug() *CmdBuilder

func (*CmdBuilder) Dir

func (c *CmdBuilder) Dir(dir string) *CmdBuilder

func (*CmdBuilder) Env

func (c *CmdBuilder) Env(env []string) *CmdBuilder

func (*CmdBuilder) IgnoreError added in v1.0.40

func (c *CmdBuilder) IgnoreError(b ...bool) *CmdBuilder

func (*CmdBuilder) Output

func (c *CmdBuilder) Output(cmd string, args ...string) (string, error)

func (*CmdBuilder) Run

func (c *CmdBuilder) Run(cmd string, args ...string) error

func (*CmdBuilder) Stderr added in v1.0.8

func (c *CmdBuilder) Stderr(stderr io.Writer) *CmdBuilder

func (*CmdBuilder) Stdout added in v1.0.8

func (c *CmdBuilder) Stdout(stdout io.Writer) *CmdBuilder

Jump to

Keyboard shortcuts

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