Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagTypeBool     = "bool"
	FlagTypeString   = "string"
	FlagTypeDuration = "duration"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Flag

type Flag struct {
	Name         string
	Type         FlagType
	Help         string
	Aliases      []string
	Shorts       []rune
	DefaultValue any
	// contains filtered or unexported fields
}

func (*Flag) IsBool

func (f *Flag) IsBool() bool

func (*Flag) Parse

func (f *Flag) Parse(s string) error

func (*Flag) Value

func (f *Flag) Value() any

type FlagType

type FlagType string

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser(version string, tokens []string, flags ...*Flag) *Parser

func (*Parser) Parse

func (p *Parser) Parse() error

func (*Parser) RemainingArgs

func (p *Parser) RemainingArgs() []string

func (*Parser) TaskName

func (p *Parser) TaskName() string

func (*Parser) WriteHelp

func (p *Parser) WriteHelp(w io.Writer) error

Jump to

Keyboard shortcuts

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