Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
To avoid confusion, it is better to use `localCmd` instead of `rootCmd`
  • Loading branch information
goFrendiAsgard authored and spf13 committed Jun 7, 2019
1 parent 9eb9f5c commit 5f23f55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5f23f55

Please sign in to comment.