verflag

package
v0.0.0-...-90f89e6 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(fs *flag.FlagSet)

AddFlags registers this package's flags on arbitrary FlagSets, such that they point to the same value as the global flags.

func PrintAndExitIfRequested

func PrintAndExitIfRequested()

PrintAndExitIfRequested will check if the -version flag was passed and, if so, print the version and exit.

func VersionVar

func VersionVar(p *VersionValue, name, shortName string, value VersionValue, usage string)

VersionVar defines a flag with the specified name and usage string.

Types

type VersionValue

type VersionValue int

VersionValue ...

const (
	VersionFalse VersionValue = 0
	VersionTrue  VersionValue = 1
	VersionRaw   VersionValue = 2
)

Define some const.

func Version

func Version(name, shortName string, value VersionValue, usage string) *VersionValue

Version wraps the VersionVar function.

func (*VersionValue) Get

func (v *VersionValue) Get() interface{}

Get ...

func (*VersionValue) IsBoolFlag

func (v *VersionValue) IsBoolFlag() bool

IsBoolFlag ...

func (*VersionValue) Set

func (v *VersionValue) Set(s string) error

Set ...

func (*VersionValue) String

func (v *VersionValue) String() string

func (*VersionValue) Type

func (v *VersionValue) Type() string

Type of the flag as required by the pflag.Value interface.

Jump to

Keyboard shortcuts

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