flag

package
v0.0.0-...-9601d62 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package flag provides flags support for uconfig

Index

Constants

View Source
const (
	ContinueOnError = ErrorHandling(flag.ContinueOnError)
	ExitOnError     = ErrorHandling(flag.ExitOnError)
	PanicOnError    = ErrorHandling(flag.PanicOnError)
)

These constants cause FlagSet.Parse to behave as described if the parse fails.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorHandling

type ErrorHandling flag.ErrorHandling

ErrorHandling defines how FlagSet.Parse behaves if the parse fails.

type Flags

type Flags interface {
	Visit(f flat.Fields) error

	Parse() error

	SetUsage(fn func())
}

Flags is it

func New

func New(name string, errorHandling ErrorHandling, args []string) Flags

New returns a new Flags

func Standard

func Standard() Flags

Standard returns a set of flags configured in the common way. It is same as: `New(os.Args[0], ContinueOnError, os.Args[1:])`

Jump to

Keyboard shortcuts

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