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