Documentation
¶
Overview ¶
Package adapter holds helpers shared by the cli/* framework adapters.
Index ¶
- func ApplyFlagVisibility(f *help.Flag, hideLong, hideShort, noIndent bool)
- func ApplyLongHelp(sections []help.Section, args []string, opts ...help.Option) []help.Section
- func FlagRefs(sections []help.Section) help.FlagRefs
- func NegatableLong(name, prefix string, positiveOnly, negativeOnly bool) string
- func NormalizePlaceholder(placeholder string, lowercase bool) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyFlagVisibility ¶
ApplyFlagVisibility applies the clib hide-long/hide-short/no-indent extras to a mapped help flag.
func ApplyLongHelp ¶
ApplyLongHelp applies opts to sections along with the default long-help policy: unless overridden via help.WithAlwaysShowDescription or help.WithAlwaysShowExamples, the description blurb and examples are hidden on -h and shown on --help.
func FlagRefs ¶ added in v0.7.16
FlagRefs flattens rendered flag sections into non-rendering reference metadata. Adapters use this when a dispatcher command intentionally hides its option sections but descriptions may still refer to those flags.
func NegatableLong ¶
NegatableLong returns the advertised long-name spelling of a negatable flag. A bare positive/negative tag advertises just that variant; the flag stays negatable either way, so the hidden spelling still parses and completes.
func NormalizePlaceholder ¶
NormalizePlaceholder lowercases an explicit placeholder for consistency with clib's help style, unless the adapter was told to preserve it.
Types ¶
This section is empty.