adapter

package
v0.7.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package adapter holds helpers shared by the cli/* framework adapters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFlagVisibility

func ApplyFlagVisibility(f *help.Flag, hideLong, hideShort, noIndent bool)

ApplyFlagVisibility applies the clib hide-long/hide-short/no-indent extras to a mapped help flag.

func ApplyLongHelp

func ApplyLongHelp(sections []help.Section, args []string, opts ...help.Option) []help.Section

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

func FlagRefs(sections []help.Section) help.FlagRefs

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

func NegatableLong(name, prefix string, positiveOnly, negativeOnly bool) string

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

func NormalizePlaceholder(placeholder string, lowercase bool) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL