shell

package
v0.0.0-...-1d05166 Latest Latest
Warning

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

Go to latest
Published: May 2, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNoOutputInBrocaster  = errutil.NewFactory("no output in brocaster")
	ErrorOutputCountMismatch2 = errutil.NewFactory("output count expect %d but got %d")
)

errors

View Source
var Module = cmder.NewModule("shell").
	SetUsage("run shell script and log stdout/stderr without tee").
	AddFlag(
		&cli.BoolFlag{
			Name:        "a",
			Aliases:     []string{"append"},
			Usage:       "Append the output to the files rather than overwriting them",
			Destination: &flagAppend,
		},
		&cli.StringSliceFlag{
			Name:  "stdout",
			Usage: "Log stdout stream to file, could use multiple times",
			Value: &flagStdouts,
		},
		&cli.StringSliceFlag{
			Name:  "stderr",
			Usage: "Log stderr stream to file, could use multiple times",
			Value: &flagStderrs,
		},
	).
	SetAction(action)

Module info

Functions

func Run

func Run(name string, option Option) (err error)

Run shell command with Option

Types

type Option

type Option struct {
	Args []string

	Append  bool
	Stdouts []string
	Stderrs []string
}

Option for Run

Jump to

Keyboard shortcuts

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