flags

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: GPL-3.0, LGPL-3.0, LGPL-3.0-or-later Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EthCategory        = "ETHEREUM"
	LightCategory      = "LIGHT CLIENT"
	DevCategory        = "DEVELOPER CHAIN"
	EthashCategory     = "ETHASH"
	TxPoolCategory     = "TRANSACTION POOL"
	PerfCategory       = "PERFORMANCE TUNING"
	AccountCategory    = "ACCOUNT"
	APICategory        = "API AND CONSOLE"
	NetworkingCategory = "NETWORKING"
	MinerCategory      = "MINER"
	GasPriceCategory   = "GAS PRICE ORACLE"
	VMCategory         = "VIRTUAL MACHINE"
	LoggingCategory    = "LOGGING AND DEBUGGING"
	MetricsCategory    = "METRICS AND STATS"
	MiscCategory       = "MISC"
	DeprecatedCategory = "ALIASED (deprecated)"
)

Variables

This section is empty.

Functions

func FlagString added in v4.2.0

func FlagString(f cli.Flag) string

FlagString prints a single flag in help.

func GlobalBig added in v4.2.0

func GlobalBig(ctx *cli.Context, name string) *big.Int

GlobalBig returns the value of a BigFlag from the global flag set.

func HomeDir added in v4.2.0

func HomeDir() string

func Merge added in v4.2.0

func Merge(groups ...[]cli.Flag) []cli.Flag

Merge merges the given flag slices.

func MigrateGlobalFlags added in v4.2.0

func MigrateGlobalFlags(ctx *cli.Context)

MigrateGlobalFlags makes all global flag values available in the context. This should be called as early as possible in app.Before.

Example:

geth account new --keystore /tmp/mykeystore --lightkdf

is equivalent after calling this method with:

geth --keystore /tmp/mykeystore --lightkdf account new

i.e. in the subcommand Action function of 'account new', ctx.Bool("lightkdf) will return true even if --lightkdf is set as a global option.

This function may become unnecessary when https://github.com/urfave/cli/pull/1245 is merged.

func NewApp

func NewApp(gitCommit, gitDate, usage string) *cli.App

NewApp creates an app with sane defaults.

Types

type BigFlag added in v4.2.0

type BigFlag struct {
	Name string

	Category    string
	DefaultText string
	Usage       string

	Required   bool
	Hidden     bool
	HasBeenSet bool

	Value *big.Int

	Aliases []string
}

BigFlag is a command line flag that accepts 256 bit big integers in decimal or hexadecimal syntax.

func (*BigFlag) Apply added in v4.2.0

func (f *BigFlag) Apply(set *flag.FlagSet) error

func (*BigFlag) GetCategory added in v4.2.0

func (f *BigFlag) GetCategory() string

func (*BigFlag) GetDefaultText added in v4.2.0

func (f *BigFlag) GetDefaultText() string

func (*BigFlag) GetEnvVars added in v4.2.0

func (f *BigFlag) GetEnvVars() []string

func (*BigFlag) GetUsage added in v4.2.0

func (f *BigFlag) GetUsage() string

func (*BigFlag) GetValue added in v4.2.0

func (f *BigFlag) GetValue() string

func (*BigFlag) IsRequired added in v4.2.0

func (f *BigFlag) IsRequired() bool

func (*BigFlag) IsSet added in v4.2.0

func (f *BigFlag) IsSet() bool

func (*BigFlag) IsVisible added in v4.2.0

func (f *BigFlag) IsVisible() bool

func (*BigFlag) Names added in v4.2.0

func (f *BigFlag) Names() []string

func (*BigFlag) String added in v4.2.0

func (f *BigFlag) String() string

func (*BigFlag) TakesValue added in v4.2.0

func (f *BigFlag) TakesValue() bool

type DirectoryFlag added in v4.2.0

type DirectoryFlag struct {
	Name string

	Category    string
	DefaultText string
	Usage       string

	Required   bool
	Hidden     bool
	HasBeenSet bool

	Value DirectoryString

	Aliases []string
}

DirectoryFlag is custom cli.Flag type which expand the received string to an absolute path. e.g. ~/.ethereum -> /home/username/.ethereum

func (*DirectoryFlag) Apply added in v4.2.0

func (f *DirectoryFlag) Apply(set *flag.FlagSet) error

Apply called by cli library, grabs variable from environment (if in env) and adds variable to flag set for parsing.

func (*DirectoryFlag) GetCategory added in v4.2.0

func (f *DirectoryFlag) GetCategory() string

func (*DirectoryFlag) GetDefaultText added in v4.2.0

func (f *DirectoryFlag) GetDefaultText() string

func (*DirectoryFlag) GetEnvVars added in v4.2.0

func (f *DirectoryFlag) GetEnvVars() []string

func (*DirectoryFlag) GetUsage added in v4.2.0

func (f *DirectoryFlag) GetUsage() string

func (*DirectoryFlag) GetValue added in v4.2.0

func (f *DirectoryFlag) GetValue() string

func (*DirectoryFlag) IsRequired added in v4.2.0

func (f *DirectoryFlag) IsRequired() bool

func (*DirectoryFlag) IsSet added in v4.2.0

func (f *DirectoryFlag) IsSet() bool

func (*DirectoryFlag) IsVisible added in v4.2.0

func (f *DirectoryFlag) IsVisible() bool

func (*DirectoryFlag) Names added in v4.2.0

func (f *DirectoryFlag) Names() []string

func (*DirectoryFlag) String added in v4.2.0

func (f *DirectoryFlag) String() string

func (*DirectoryFlag) TakesValue added in v4.2.0

func (f *DirectoryFlag) TakesValue() bool

type DirectoryString added in v4.2.0

type DirectoryString string

DirectoryString is custom type which is registered in the flags library which cli uses for argument parsing. This allows us to expand Value to an absolute path when the argument is parsed

func (*DirectoryString) Set added in v4.2.0

func (s *DirectoryString) Set(value string) error

func (*DirectoryString) String added in v4.2.0

func (s *DirectoryString) String() string

type TextMarshaler added in v4.2.0

type TextMarshaler interface {
	encoding.TextMarshaler
	encoding.TextUnmarshaler
}

func GlobalTextMarshaler added in v4.2.0

func GlobalTextMarshaler(ctx *cli.Context, name string) TextMarshaler

GlobalTextMarshaler returns the value of a TextMarshalerFlag from the global flag set.

type TextMarshalerFlag added in v4.2.0

type TextMarshalerFlag struct {
	Name string

	Category    string
	DefaultText string
	Usage       string

	Required   bool
	Hidden     bool
	HasBeenSet bool

	Value TextMarshaler

	Aliases []string
}

TextMarshalerFlag wraps a TextMarshaler value.

func (*TextMarshalerFlag) Apply added in v4.2.0

func (f *TextMarshalerFlag) Apply(set *flag.FlagSet) error

func (*TextMarshalerFlag) GetCategory added in v4.2.0

func (f *TextMarshalerFlag) GetCategory() string

func (*TextMarshalerFlag) GetDefaultText added in v4.2.0

func (f *TextMarshalerFlag) GetDefaultText() string

func (*TextMarshalerFlag) GetEnvVars added in v4.2.0

func (f *TextMarshalerFlag) GetEnvVars() []string

func (*TextMarshalerFlag) GetUsage added in v4.2.0

func (f *TextMarshalerFlag) GetUsage() string

func (*TextMarshalerFlag) GetValue added in v4.2.0

func (f *TextMarshalerFlag) GetValue() string

func (*TextMarshalerFlag) IsRequired added in v4.2.0

func (f *TextMarshalerFlag) IsRequired() bool

func (*TextMarshalerFlag) IsSet added in v4.2.0

func (f *TextMarshalerFlag) IsSet() bool

func (*TextMarshalerFlag) IsVisible added in v4.2.0

func (f *TextMarshalerFlag) IsVisible() bool

func (*TextMarshalerFlag) Names added in v4.2.0

func (f *TextMarshalerFlag) Names() []string

func (*TextMarshalerFlag) String added in v4.2.0

func (f *TextMarshalerFlag) String() string

func (*TextMarshalerFlag) TakesValue added in v4.2.0

func (f *TextMarshalerFlag) TakesValue() bool

Jump to

Keyboard shortcuts

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