Set writer when running command as app

Also add test from https://github.com/codegangsta/cli/pull/202 with
slight modifications.
This commit is contained in:
jszwedko
2015-05-03 18:37:51 -07:00
parent f952f5ac6f
commit b8104e5da7
2 changed files with 57 additions and 0 deletions

View File

@@ -157,6 +157,7 @@ func (c Command) startApp(ctx *Context) error {
app.Commands = c.Subcommands
app.Flags = c.Flags
app.HideHelp = c.HideHelp
app.Writer = ctx.App.Writer
// bash completion
app.EnableBashCompletion = ctx.App.EnableBashCompletion