The SortFlags option mentioned in the README is not actually exported.
Instead
CommandLine.SortFlags is available.
# README.md
flags.BoolP("verbose", "v", false, "verbose output")
flags.String("coolflag", "yeaah", "it's really cool flag")
flags.Int("usefulflag", 777, "sometimes it's very useful")
-flags.SortFlags = false
+flags.CommandLine.SortFlags = false
flags.PrintDefaults()
The
SortFlagsoption mentioned in the README is not actually exported.pflag/README.md
Line 257 in d5e0c06
Instead
CommandLine.SortFlagsis available.