Lines Matching defs:Cmd
34 // Cmd represents an external command being prepared or run.
36 // A Cmd cannot be reused after calling its Run, Output or CombinedOutput
38 type Cmd struct {
110 // Command returns the Cmd struct to execute the named program with
119 // The returned Cmd's Args field is constructed from the command name
122 func Command(name string, arg ...string) *Cmd {
123 cmd := &Cmd{
129 cmd.lookPathErr = err
131 cmd.Path = lp
134 return cmd
146 func (c *Cmd) envv() []string {
153 func (c *Cmd) argv() []string {
165 func (c *Cmd) stdin() (f *os.File, err error) {
199 func (c *Cmd) stdout() (f *os.File, err error) {
203 func (c *Cmd) stderr() (f *os.File, err error) {
210 func (c *Cmd) writerDescriptor(w io.Writer) (f *os.File, err error) {
239 func (c *Cmd) closeDescriptors(closers []io.Closer) {
254 func (c *Cmd) Run() error {
291 func (c *Cmd) Start() error {
310 type F func(*Cmd) (*os.File, error)
311 for _, setupFd := range []F{(*Cmd).stdin, (*Cmd).stdout, (*Cmd).stderr} {
371 // Wait releases any resources associated with the Cmd.
372 func (c *Cmd) Wait() error {
402 func (c *Cmd) Output() ([]byte, error) {
414 func (c *Cmd) CombinedOutput() ([]byte, error) {
434 func (c *Cmd) StdinPipe() (io.WriteCloser, error) {
476 func (c *Cmd) StdoutPipe() (io.ReadCloser, error) {
501 func (c *Cmd) StderrPipe() (io.ReadCloser, error) {