man

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: BSD-3-Clause-Clear Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const SensitiveAnnotationKey = "sensitive"

SensitiveAnnotationKey is the pflag annotation key used to mark flags whose values contain secrets (cryptographic keys, tokens, etc.) and must not appear in logs or process listings.

Variables

This section is empty.

Functions

func ProcessEmbeddedDocs

func ProcessEmbeddedDocs(manFiles embed.FS)

Types

type CommandOpts

type CommandOpts func(d *Doc)

func WithHiddenFlags

func WithHiddenFlags(flags ...string) CommandOpts

Hide any global or persisent flags from parent commands on the given command

func WithRun

func WithRun(f func(cmd *cobra.Command, args []string)) CommandOpts

func WithSubcommands

func WithSubcommands(subCmds ...*Doc) CommandOpts

type Doc

type Doc struct {
	cobra.Command
	DocFlags       []DocFlag
	DocSubcommands []*Doc
}

func ProcessDoc

func ProcessDoc(doc string) (*Doc, error)

func (*Doc) AddSubcommands

func (d *Doc) AddSubcommands(subCmds ...*Doc)

func (*Doc) GetDocFlag

func (d *Doc) GetDocFlag(name string) DocFlag

func (*Doc) GetShort

func (d *Doc) GetShort(subCmds []string) string

deprecated

func (*Doc) MarkSensitiveFlags added in v0.32.0

func (d *Doc) MarkSensitiveFlags()

MarkSensitiveFlags sets pflag annotations on all flags in the command's FlagSet that are marked sensitive in the doc metadata. Call after all flags have been registered.

type DocFlag

type DocFlag struct {
	Name        string   `yaml:"name"`
	Description string   `yaml:"description"`
	Shorthand   string   `yaml:"shorthand"`
	Default     string   `yaml:"default"`
	Enum        []string `yaml:"enum"`
	Sensitive   bool     `yaml:"sensitive"`
}

func (DocFlag) DefaultAsBool

func (f DocFlag) DefaultAsBool() bool

type Manual

type Manual struct {
	Docs map[string]*Doc
	En   map[string]*Doc
	Fr   map[string]*Doc
	// contains filtered or unexported fields
}
var Docs Manual

func (Manual) GetCommand

func (m Manual) GetCommand(cmd string, opts ...CommandOpts) *Doc

func (Manual) GetDoc

func (m Manual) GetDoc(cmd string) *Doc

func (*Manual) SetLang

func (m *Manual) SetLang(l string)

Jump to

Keyboard shortcuts

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