This example shows how to run a command, with it's standard out and error being logged.
()
| 46 | |
| 47 | // This example shows how to run a command, with it's standard out and error being logged. |
| 48 | func ExampleVerbose() { |
| 49 | ctx := newCtx() |
| 50 | err := shell.Command("echo", "Hello", "from the shell").Verbose().Run(ctx) |
| 51 | if err != nil { |
| 52 | log.F(ctx, true, "Unable to say hello: %v", err) |
| 53 | } |
| 54 | // Output: |
| 55 | //I: [Example] Exec: echo Hello "from the shell" |
| 56 | //I: [Example] <echo> Hello from the shell |
| 57 | } |
| 58 | |
| 59 | // This example shows how to run a command and capture it's output. |
| 60 | func ExampleCapture() { |