Fixes in example

This commit is contained in:
Máximo Cuadros 2013-12-21 11:32:14 +01:00
parent fae133554d
commit 1378a36255
1 changed files with 2 additions and 2 deletions

View File

@ -151,7 +151,7 @@ We have only defined one flag for a single command.
More documentation about flags is available at https://github.com/spf13/pflag More documentation about flags is available at https://github.com/spf13/pflag
Import( import(
"github.com/spf13/cobra" "github.com/spf13/cobra"
"fmt" "fmt"
"strings" "strings"
@ -195,7 +195,7 @@ More documentation about flags is available at https://github.com/spf13/pflag
}, },
} }
cmdTimes().Flags().IntVarP(&echoTimes, "times", "t", 1, "times to echo the input") cmdTimes.Flags().IntVarP(&echoTimes, "times", "t", 1, "times to echo the input")
var rootCmd = &cobra.Command{Use: "app"} var rootCmd = &cobra.Command{Use: "app"}
rootCmd.AddCommand(cmdPrint, cmdEcho) rootCmd.AddCommand(cmdPrint, cmdEcho)