command

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: Apache-2.0 Imports: 3 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 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) 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