MCPcopy Index your code
hub / github.com/cli/cli / getDefaultValueDisplayString

Function getDefaultValueDisplayString

internal/docs/markdown.go:82–93  ·  view source on GitHub ↗
(f *pflag.Flag)

Source from the content-addressed store, hash-verified

80}
81
82func getDefaultValueDisplayString(f *pflag.Flag) string {
83
84 if hiddenFlagDefaults[f.DefValue] || hiddenFlagDefaults[f.Value.Type()] {
85 return ""
86 }
87
88 if dvf, found := defaultValFormats[f.Value.Type()]; found {
89 return fmt.Sprintf(dvf, f.Value)
90 }
91 return fmt.Sprintf(" (default %s)", f.Value)
92
93}
94
95type flagView struct {
96 Name string

Callers 2

printFlagsHTMLFunction · 0.85
manPrintFlagsFunction · 0.85

Calls 1

TypeMethod · 0.45

Tested by

no test coverage detected