flagcodec

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagToggle = iota
	FlagOption
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Flags

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

func ParseArgvKeyValue

func ParseArgvKeyValue(argv []string) *Flags

ParseArgvKeyValue parses a clean (trimmed) argv whose components are either toggles or key=value pairs. IOW, this is a restricted and easier to parse flavour of argv on which option and value are guaranteed to be in the same item. IOW, we expect "--opt=foo" AND NOT "--opt", "foo"

func (*Flags) Argv

func (fl *Flags) Argv() []string

func (*Flags) SetOption

func (fl *Flags) SetOption(name, data string)

func (*Flags) SetToggle

func (fl *Flags) SetToggle(name string)

type Val

type Val struct {
	Kind int
	Data string
}

Jump to

Keyboard shortcuts

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