From 5f23f55c8183489b4e881ff0dc99ac6a746baa0c Mon Sep 17 00:00:00 2001 From: Go Frendi Gunawan Date: Tue, 4 Jun 2019 11:25:58 +0700 Subject: [PATCH] Update README.md To avoid confusion, it is better to use `localCmd` instead of `rootCmd` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bce0fa7a..60c5a425 100644 --- a/README.md +++ b/README.md @@ -338,7 +338,7 @@ rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose out A flag can also be assigned locally which will only apply to that specific command. ```go -rootCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") +localCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") ``` ### Local Flag on Parent Commands