From 1be06e4e1a24a2cb0debac264ecc135c25bf1d3c Mon Sep 17 00:00:00 2001 From: spf13 Date: Tue, 3 Sep 2013 19:04:50 -0400 Subject: [PATCH] Adding a separate command as a run value. --- cobra_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cobra_test.go b/cobra_test.go index 4c4e6de..88dc5f0 100644 --- a/cobra_test.go +++ b/cobra_test.go @@ -35,9 +35,11 @@ var cmdTimes = &Command{ Use: "times [string to echo]", Short: "Echo anything to the screen more times", Long: `an slightly useless command for testing.`, - Run: func(cmd *Command, args []string) { - tt = args - }, + Run: timesRunner, +} + +func timesRunner(cmd *Command, args []string) { + tt = args } func flagInit() {