{"modulePath":"github.com/webdevops/go-shell","version":"v0.0.0-20171102182145-aac7e8b74cc8","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package shell\n\n## Variables\n\n```go\nvar (\n\t// Available shell list\n\tShellList = map[string][]string{\n\t\t\"zsh\":  {\"/bin/zsh\", \"-o\", \"errexit\", \"-o\", \"pipefail\", \"-c\"},\n\t\t\"bash\": {\"/bin/bash\", \"-o\", \"errexit\", \"-o\", \"pipefail\", \"-c\"},\n\t\t\"sh\":   {\"/bin/sh\", \"-o\", \"errexit\", \"-c\"},\n\t}\n\n\t// Shell for command invocation\n\tShell = []string{\"/bin/sh\", \"-o\", \"errexit\", \"-c\"}\n\n\t// Specifies if panic is thrown if command fails\n\tPanic = true\n\n\t// Error func hook if command fails\n\tErrorFunc = func(c *Command, p *Process) {}\n\n\t// Verbose func hook before command is executed\n\tVerboseFunc = func(c *Command) {}\n\n\t// Trace command for each executed\n\tTrace = false\n\n\t// Trae output prefix\n\tTracePrefix = \"+\"\n)\n```\n\n```go\nvar Tee io.Writer\n```\n\n## Functions\n\n```go\nfunc ErrExit()\n```\n\n```go\nfunc Path(parts ...string) string\n```\n\n```go\nfunc PathTemplate(parts ...string) func(...interface{}) string\n```\n\n```go\nfunc Quote(arg string) string\n```\nQuote shell arguments as string\n\n```go\nfunc QuoteValues(arg ...string) []string\n```\nQuote multiple shell arguments as string list\n\n```go\nfunc SetDefaultShell(shell string)\n```\nSets the default shell (eg. \"sh\" or \"bash\") for command execution and usage in ShellCommandBuilder\n\n## Types\n\n```go\ntype Command struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc Cmd(cmd ...interface{}) *Command\n```\nCreate new Command instance\n\n```go\nfunc NewCmd(command string, args ...string) *Command\n```\nCreate a new shell command instance using strings as parameters\n\n```go\nfunc (c *Command) ErrFn() func(...interface{}) error\n```\n\n```go\nfunc (c *Command) OutputFn() func(...interface{}) (string, error)\n```\n\n```go\nfunc (c *Command) Pipe(cmd ...interface{}) *Command\n```\nAdd command as pipe to an existing command\n\n```go\nfunc (c *Command) ProcFn() func(...interface{}) *Process\n```\n\n```go\nfunc (c *Command) Run() *Process\n```\nRun command\n\n```go\nfunc (c *Command) RunInteractive() *Process\n```\nRun command in interactive mode\n\n```go\nfunc (c *Command) ToString() string\n```\nCreate human readable command as string\n\n```go\ntype Process struct {\n\tStdout     *bytes.Buffer\n\tStderr     *bytes.Buffer\n\tStdin      io.WriteCloser\n\tExitStatus int\n\tCommand    *Command\n}\n```\n\n```go\nfunc Run(cmd ...interface{}) *Process\n```\n\n```go\nfunc (p *Process) Bytes() []byte\n```\n\n```go\nfunc (p *Process) Debug() string\n```\nCreate human readable representation of process status\n\n```go\nfunc (p *Process) Error() error\n```\n\n```go\nfunc (p *Process) Read(b []byte) (int, error)\n```\n\n```go\nfunc (p *Process) String() string\n```\n\n```go\nfunc (p *Process) Write(b []byte) (int, error)\n```\n\n","path":"github.com/webdevops/go-shell","name":"shell","synopsis":"","isRedistributable":true}
