File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -15,22 +15,22 @@ A simple package to execute shell commands on linux, darwin and windows.
1515## Usage
1616
1717``` go
18- cmd := cmd.NewCommand (" echo hello" )
18+ c := cmd.NewCommand (" echo hello" )
1919
20- err := cmd .Execute ()
20+ err := c .Execute ()
2121if err != nil {
2222 panic (err.Error ())
2323}
2424
25- fmt.Println (cmd .Stdout ())
26- fmt.Println (cmd .Stderr ())
25+ fmt.Println (c .Stdout ())
26+ fmt.Println (c .Stderr ())
2727```
2828
2929### Stream output to stderr and stdout
3030
3131``` go
32- cmd := cmd.NewCommand (" echo hello" , cmd.WithStandardStreams )
33- cmd .Execute ()
32+ c := cmd.NewCommand (" echo hello" , cmd.WithStandardStreams )
33+ c .Execute ()
3434```
3535
3636### Set custom options
@@ -44,8 +44,8 @@ func SetWorkingDir(c *Command) {
4444 c.WorkingDir = " /tmp/test"
4545}
4646
47- cmd := NewCommand (" pwd" , SetTimeout , SetWorkingDir )
48- cmd .Execute ()
47+ c := cmd. NewCommand (" pwd" , SetTimeout , SetWorkingDir )
48+ c .Execute ()
4949```
5050
5151## Development
@@ -58,4 +58,4 @@ make test
5858
5959### ToDo
6060
61- - os.Stdout and os.Stderr output access after execution via ` c.Stdout() ` and ` c.Stderr() `
61+ - os.Stdout and os.Stderr output access after execution via ` c.Stdout() ` and ` c.Stderr() `
You can’t perform that action at this time.
0 commit comments