From 83773614293e6c9406454a53ce5e263500ce6e44 Mon Sep 17 00:00:00 2001 From: spf13 Date: Wed, 28 Oct 2015 13:45:33 -0400 Subject: [PATCH] Add extra feedback on successful initialization --- cobra/cmd/init.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cobra/cmd/init.go b/cobra/cmd/init.go index dffcb2c..51e7447 100644 --- a/cobra/cmd/init.go +++ b/cobra/cmd/init.go @@ -14,6 +14,7 @@ package cmd import ( + "fmt" "os" "github.com/spf13/cobra" @@ -175,7 +176,7 @@ func init() { // RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.{{ .appName }}.yaml)") {{ end }} // Cobra also supports local flags which will only run when this action is called directly - // RootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle" ) + RootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle" ) } @@ -210,4 +211,9 @@ func initConfig() { if err != nil { er(err) } + + fmt.Println("Yor Cobra application is ready at") + fmt.Println(ProjectPath()) + fmt.Println("Give it a try by going there and running `go run main.go`") + fmt.Println("Add commands to it by running `cobra add [cmdname]`") }