parse

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 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 Join

func Join(a, b string) string

func NextLevel

func NextLevel(fs FlagSet)

func Setup

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

Types

type FlagGetter

type FlagGetter interface {
	Lookup(name string) *flag.Flag
	VisitAll(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

Jump to

Keyboard shortcuts

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