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