Documentation ¶
Index ¶
- Constants
- Variables
- func Exec(command string, opts ...Options) error
- func Execs(commands []string, control ...string) error
- func Print(c *color.Color, s string)
- func Shell(command string, opts ...Options) error
- func Sudo(command string, opts ...Options) error
- type Buffer
- type Command
- func (c *Command) Close() error
- func (c *Command) CombinedOutput() (string, error)
- func (c *Command) Error(data []byte) (int, error)
- func (c *Command) ErrorAll() (string, error)
- func (c *Command) ErrorLine() (string, error)
- func (c *Command) Exited() bool
- func (c *Command) Kill() error
- func (c *Command) Output() (string, error)
- func (c *Command) Print()
- func (c *Command) PrintError()
- func (c *Command) Read(data []byte) (int, error)
- func (c *Command) ReadAll() (string, error)
- func (c *Command) ReadLine() (string, error)
- func (c *Command) Run() error
- func (c *Command) Start() error
- func (c *Command) Wait() error
- func (c *Command) Write(data []byte) (int, error)
- func (c *Command) WriteLine(command string) error
- type Options
Constants ¶
View Source
const ( And = "&&" //与 Or = "||" //或 Alone = ";" //单独执行 )
Variables ¶
Functions ¶
Types ¶
type Command ¶
type Command struct { Cmd *exec.Cmd Ssh *ssh.Session In io.Writer Out io.Reader Err io.Reader // contains filtered or unexported fields }
func (*Command) CombinedOutput ¶
func (*Command) PrintError ¶
func (c *Command) PrintError()
type Options ¶
type Options struct { Stdin io.ReadWriter Stdout io.ReadWriter Stderr io.ReadWriter Echo bool Async bool Passwd string }
Click to show internal directories.
Click to hide internal directories.