Skip to content

Commit 5f23f55

Browse files
goFrendiAsgardspf13
authored andcommitted
Update README.md
To avoid confusion, it is better to use `localCmd` instead of `rootCmd`
1 parent 9eb9f5c commit 5f23f55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose out
338338
A flag can also be assigned locally which will only apply to that specific command.
339339

340340
```go
341-
rootCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from")
341+
localCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from")
342342
```
343343

344344
### Local Flag on Parent Commands

0 commit comments

Comments
 (0)