Update README.md

To avoid confusion, it is better to use `localCmd` instead of `rootCmd`
This commit is contained in:
Go Frendi Gunawan 2019-06-04 11:25:58 +07:00 committed by Steve Francia
parent 9eb9f5c66b
commit 5f23f55c81
1 changed files with 1 additions and 1 deletions

View File

@ -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. A flag can also be assigned locally which will only apply to that specific command.
```go ```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 ### Local Flag on Parent Commands