sh

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2019 License: MIT Imports: 11 Imported by: 5

Documentation

Index

Constants

View Source
const ErrUnexpectedNewLine exception.Class = "unexpected newline"

ErrUnexpectedNewLine is returned from scan.go when you just hit enter with nothing in the prompt

Variables

This section is empty.

Functions

func Cmd

func Cmd(command string, args ...string) (*exec.Cmd, error)

Cmd returns a new command with the fully qualified path of the executable.

func CmdParsed

func CmdParsed(statement string) (*exec.Cmd, error)

CmdParsed returns a command for a full comamnd statement.

func Exec

func Exec(command string, args ...string) error

Exec runs a command with a given list of arguments. It resolves the command name in your $PATH list for you. It does not show output.

func Fatal

func Fatal(err error)

Fatal exits the process with a given error.

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf exits the process with a given formatted message to stderr.

func Fork

func Fork(command string, args ...string) error

Fork runs a command with a given list of arguments. It resolves the command name in your $PATH list for you. It shows output and allows input.

func IsEPIPE

func IsEPIPE(err error) bool

IsEPIPE is the epipe erorr.

func MustCmd

func MustCmd(command string, args ...string) *exec.Cmd

MustCmd returns a new command with the fully qualified path of the executable. It panics on error.

func MustCmdParsed

func MustCmdParsed(statement string) *exec.Cmd

MustCmdParsed returns a command for a full comamnd statement.

func MustCmds

func MustCmds(statements ...string) []*exec.Cmd

MustCmds returns a command for a full comamnd statement.

func MustPassword

func MustPassword(prompt string) string

MustPassword gives a prompt and reads input until newlines without printing the input to screen. It panics on error.

func Output

func Output(command string, args ...string) ([]byte, error)

Output runs a command with a given list of arguments. It resolves the command name in your $PATH list for you. It captures combined output and returns it as bytes.

func Password

func Password(prompt string) (string, error)

Password gives a prompt and reads input until newlines without printing the input to screen.

func Passwordf

func Passwordf(format string, args ...interface{}) (string, error)

Passwordf gives a prompt and reads input until newlines without printing the input to screen.

func Pipe

func Pipe(commands ...*exec.Cmd) error

Pipe runs commands in sequence, piping combined output to the standard in of the next command.

func Prompt

func Prompt(prompt string) string

Prompt gives a prompt and reads input until newlines.

func PromptFrom

func PromptFrom(stdout io.Writer, stdin io.Reader, prompt string) string

PromptFrom gives a prompt and reads input until newlines from a given set of streams.

func Promptf

func Promptf(format string, args ...interface{}) string

Promptf gives a prompt of a given format and args and reads input until newlines.

func Put

func Put(stdin io.Reader, command string, args ...string) error

Put runs a given command with a given reader as its stdin.

func PutOutput

func PutOutput(stdin io.Reader, command string, args ...string) ([]byte, error)

PutOutput runs a given command with a given reader as its stdin and captures the output.

Types

This section is empty.

Directories

Path Synopsis
_examples

Jump to

Keyboard shortcuts

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