parser

package
v0.0.0-...-b1b3373 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Name  string
	Flags map[string]string
	Args  []string
}

type CommandDef

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

func NewCommand

func NewCommand(name string) *CommandDef

func (*CommandDef) Flag

func (c *CommandDef) Flag(name string, kind FlagKind) *CommandDef

func (*CommandDef) PosArg

func (c *CommandDef) PosArg(name string) *CommandDef

func (*CommandDef) VarPosArg

func (c *CommandDef) VarPosArg() *CommandDef

type FlagDef

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

type FlagKind

type FlagKind int
const (
	Switch FlagKind = iota
	Field
)

type Parser

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

func NewParser

func NewParser() *Parser

func (*Parser) AddCommands

func (p *Parser) AddCommands(cmds ...*CommandDef)

func (*Parser) Parse

func (p *Parser) Parse(args []string) (*Command, error)

Jump to

Keyboard shortcuts

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