@@ -469,8 +469,9 @@ func Set(name, value string) error {
469
469
return CommandLine .Set (name , value )
470
470
}
471
471
472
- // PrintDefaults prints, to standard error unless configured
473
- // otherwise, the default values of all defined flags in the set.
472
+ // PrintDefaults prints to standard error unless configured otherwise, the
473
+ // default values of all defined command-line flags in the set. See the
474
+ // documentation for the global function PrintDefaults for more information.
474
475
func (f * FlagSet ) PrintDefaults () {
475
476
usages := f .FlagUsages ()
476
477
fmt .Fprint (f .Output (), usages )
@@ -712,7 +713,27 @@ func (f *FlagSet) FlagUsages() string {
712
713
return f .FlagUsagesWrapped (0 )
713
714
}
714
715
715
- // PrintDefaults prints to standard error the default values of all defined command-line flags.
716
+ // PrintDefaults prints, to standard error unless configured otherwise,
717
+ // a usage message showing the default settings of all defined
718
+ // command-line flags.
719
+ // For an integer valued flag x, the default output has the form
720
+ // -x int
721
+ // usage-message-for-x (default 7)
722
+ // The usage message will appear on a separate line for anything but
723
+ // a bool flag with a one-byte name. For bool flags, the type is
724
+ // omitted and if the flag name is one byte the usage message appears
725
+ // on the same line. The parenthetical default is omitted if the
726
+ // default is the zero value for the type. The listed type, here int,
727
+ // can be changed by placing a back-quoted name in the flag's usage
728
+ // string; the first such item in the message is taken to be a parameter
729
+ // name to show in the message and the back quotes are stripped from
730
+ // the message when displayed. For instance, given
731
+ // flag.String("I", "", "search `directory` for include files")
732
+ // the output will be
733
+ // -I directory
734
+ // search directory for include files.
735
+ //
736
+ // To change the destination for flag messages, call CommandLine.SetOutput.
716
737
func PrintDefaults () {
717
738
CommandLine .PrintDefaults ()
718
739
}
0 commit comments