man

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause-Clear Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessEmbeddedDocs added in v0.14.0

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 added in v0.14.0

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

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"`
}

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