parse

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package parse provides tools for common flag parsing tasks.

Index

Constants

This section is empty.

Variables

View Source
var SetSeparator = "."

Functions

func AllowResetSpecified added in v0.9.0

func AllowResetSpecified(fs FlagSet, allow bool)

func IgnoreUndefined added in v0.9.0

func IgnoreUndefined(fs FlagSet, ignore bool)

func Join

func Join(a, b string) string

func NextLevel

func NextLevel(fs FlagSet)

func Setup

func Setup(x interface{}, v Visitor) error

func Stash added in v0.4.0

func Stash(fs FlagSet, fn func(*flag.Flag) bool)

Types

type FlagGetter

type FlagGetter interface {
	Lookup(name string) *flag.Flag
	VisitAll(func(*flag.Flag))
	VisitUnspecified(func(*flag.Flag))
}

type FlagSet

type FlagSet interface {
	FlagGetter
	FlagSetter
}

func NewFlagSet

func NewFlagSet(flags *flag.FlagSet, opts ...FlagSetOption) FlagSet

type FlagSetOption

type FlagSetOption func(*flagSet)

func WithIgnoreUndefined

func WithIgnoreUndefined(v bool) FlagSetOption

type FlagSetter

type FlagSetter interface {
	Set(name, value string) error
}

type SetupFunc

type SetupFunc func(name, value string) error

type Visitor

type Visitor interface {
	Set(name, value string) error
	Has(name string) bool
}

type VisitorFunc

type VisitorFunc struct {
	SetFunc func(name, value string) error
	HasFunc func(name string) bool
}

func (VisitorFunc) Has

func (v VisitorFunc) Has(name string) bool

func (VisitorFunc) Set

func (v VisitorFunc) Set(name, value string) error

Directories

Path Synopsis
Package pargs implements POSIX program argument syntax conventions.
Package pargs implements POSIX program argument syntax conventions.

Jump to

Keyboard shortcuts

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