Documentation ¶
Index ¶
- func BaseName(path string) string
- func CompileStrs(regStrs []string) (*regexp.Regexp, error)
- func FailOnError(err error)
- func GetCmdPath(cmd string) (string, error)
- func GetGlobArgs(args []string) ([]string, error)
- func IsMatchStrs(str string, regStrs []string) (bool, error)
- func PP(a ...interface{}) (int, error)
- func PPf(format string, a ...interface{}) (int, error)
- func ReadToBuf(scanner *bufio.Scanner) (*bytes.Buffer, error)
- func ScanPrintStderr(scanner *bufio.Scanner, print bool)
- func ScanPrintStdout(scanner *bufio.Scanner, print bool)
- func ScanWrite(scanner *bufio.Scanner, writer io.Writer, print bool)
- func SurroundWord(w string, r rune) string
- type Cmd
- func (c *Cmd) CmdRun() error
- func (c *Cmd) CmdStart() error
- func (c *Cmd) CmdWait()
- func (c *Cmd) GetExitCode()
- func (c *Cmd) StderrPipe() (io.ReadCloser, error)
- func (c *Cmd) StderrScanner() (*bufio.Scanner, error)
- func (c *Cmd) StdinPipe() (io.WriteCloser, error)
- func (c *Cmd) StdoutPipe() (io.ReadCloser, error)
- func (c *Cmd) StdoutScanner() (*bufio.Scanner, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompileStrs ¶
CompileStrs is regexp strings compile to *regexp.Regexp.
func IsMatchStrs ¶
IsMatchStrs is whether str match or not.
func ScanPrintStderr ¶
ScanPrintStderr is scan and print to stderr.
func ScanPrintStdout ¶
ScanPrintStdout is scan and print to stdout.
Types ¶
type Cmd ¶
type Cmd struct { Cmd *exec.Cmd CmdLine string Stdin bytes.Buffer Stdout bytes.Buffer Stderr bytes.Buffer ExitError error ExitCode int StdinEnc *encoding.Decoder StdoutEnc *encoding.Decoder StderrEnc *encoding.Decoder StdoutPrint bool StderrPrint bool Wg sync.WaitGroup // contains filtered or unexported fields }
Cmd is command infomation.
func (*Cmd) StderrPipe ¶
func (c *Cmd) StderrPipe() (io.ReadCloser, error)
StderrPipe return exec.StderrPipe.
func (*Cmd) StderrScanner ¶
StderrScanner make bufio.Scanner.
func (*Cmd) StdinPipe ¶
func (c *Cmd) StdinPipe() (io.WriteCloser, error)
StdinPipe return exec.StdinPipe.
func (*Cmd) StdoutPipe ¶
func (c *Cmd) StdoutPipe() (io.ReadCloser, error)
StdoutPipe return exec.StdoutPipe.
Click to show internal directories.
Click to hide internal directories.