diff --git a/README.md b/README.md index 42aad4b..851fcc0 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,13 @@ var rootCmd = &cobra.Command{ // Do Stuff Here }, } + +func Execute() { + if err := rootCmd.Execute(); err != nil { + fmt.Println(err) + os.Exit(1) + } +} ``` You will additionally define flags and handle configuration in your init() function.