File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -564,11 +564,8 @@ func (tabularTemplate) Prettify(s string) string {
564564 return s + "\n " // add an extra newline
565565}
566566
567- // getFlagDefaultValue returns the default value of a flag. Previously, the [cli.DocGenerationFlag] interface included
568- // a GetValue string method, but it was removed in https://github.com/urfave/cli/pull/1988.
569- // This function serves as a workaround, attempting to retrieve the value using the removed method; if that fails, it
570- // tries to obtain it via reflection (the [cli.FlagBase] still has a Value field).
571- // It also checks if there is a DefaultText and if set returns it.
567+ // getFlagDefaultValue returns the default text or default value of a flag.
568+ // cli.BoolFlag will always return an default.
572569func getFlagDefaultValue (f cli.DocGenerationFlag ) (value , text string ) {
573570 // GetDefaultText also returns GetValue so we have to use reflection
574571 if ref := reflect .ValueOf (f ); ref .Kind () == reflect .Ptr && ref .Elem ().Kind () == reflect .Struct {
You can’t perform that action at this time.
0 commit comments