tag

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Complete       = "complete"
	CompleteHidden = "complete-hidden"
	Default        = "default"
	Enum           = "enum"
	EnumTerse      = "enum-terse"
	Ext            = "ext"
	Forward        = "forward"
	Group          = "group"
	HideDefault    = "hide-default"
	HideLong       = "hide-long"
	HideShort      = "hide-short"
	Highlight      = "highlight"
	Hint           = "hint"
	Inverse        = "inverse"
	Order          = "order"
	Negatable      = "negatable"
	Negative       = "negative"
	NoIndent       = "no-indent"
	Placeholder    = "placeholder"
	Positive       = "positive"
	Terse          = "terse"
	Usage          = "usage"
)

Clib tag keys.

Variables

This section is empty.

Functions

func Parse

func Parse(s, key string) (string, bool, error)

Parse extracts the value for key from a clib tag string. Returns the unquoted value and true if found, or "" and false otherwise. Bare keys (no '=') return "" and true.

Format: comma-separated entries, values optionally single-quoted:

"negatable,group='Filters',placeholder='repo'"

func Split

func Split(s string) ([]string, error)

Split splits a clib tag on commas, respecting single-quoted values.

func SplitCSV

func SplitCSV(s string) []string

SplitCSV splits s on commas, trims whitespace from each element, and returns the resulting slice. Returns nil for empty input.

Empty fields are preserved deliberately. An empty entry can be a valid enum member - e.g. a `enum:",json,wide" default:""` flag whose empty value is the default - and, crucially, keeping empties keeps Enum index-aligned with the separately-split EnumHighlight/EnumTerse slices. Empties are hidden from help output later by dropEmptyEnum in help/render.go, which drops the paired highlight in lockstep.

Types

This section is empty.

Jump to

Keyboard shortcuts

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