command

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(cmd *exec.Cmd)

Option is the function signature for customizing the internal *exec.Cmd.

func Stderr added in v0.5.0

func Stderr(writer io.Writer) Option

Stderr sets the internal *exec.Cmd's Stderr field.

func Stdin

func Stdin(r io.Reader) Option

Stdin sets the internal *exec.Cmd's Stdin field.

func Stdout

func Stdout(writer io.Writer) Option

Stdout sets the internal *exec.Cmd's Stdout field.

type Service

type Service struct{}

Service exists for mockability.

func New

func New() Service

New returns a Service.

func (Service) InteractiveRun added in v1.1.0

func (s Service) InteractiveRun(name string, args []string) error

InteractiveRun runs the input command that starts a child process.

func (Service) Run

func (s Service) Run(name string, args []string, options ...Option) error

Run runs the input command with input args with Stdout and Stderr defaulted to os.Stderr. Input options will override these defaults.

Jump to

Keyboard shortcuts

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