options

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Short flags start with a single hyphen (ie. -flag)
	Short = "short"
	// Long flags start with two hyphens (ie. --flag)
	Long = "long"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Flag

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

Flag is an CLI switch that may affect execution

type Parser

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

Parser can be used to read and convert the raw program arguments

func NewParser

func NewParser(raw []string) (p *Parser, sub string)

NewParser does the initial parsing of arguments and returns the resulting Parser

func (*Parser) SetArgs

func (p *Parser) SetArgs(args interface{}) bool

SetArgs attempts to set the entries in 'args', using the previously parsed arguments

func (*Parser) SetFlags

func (p *Parser) SetFlags(flags interface{})

SetFlags attempts to set the entries in 'flags', using the previously parsed arguments

func (*Parser) UnknownFlags added in v1.1.0

func (p *Parser) UnknownFlags()

UnknownFlags checks for unregistered flags that are set

Jump to

Keyboard shortcuts

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