Documentation ¶
Index ¶
- Constants
- func AutoEnvVars(flags []cli.Flag, prefix string)
- func CheckEnvVars(ctx *cli.Context, flags []cli.Flag, prefix string)
- func FlagString(f cli.Flag) string
- func GlobalBig(ctx *cli.Context, name string) *big.Int
- func HomeDir() string
- func Merge(groups ...[]cli.Flag) []cli.Flag
- func MigrateGlobalFlags(ctx *cli.Context)
- func NewApp(usage string) *cli.App
- type BigFlag
- func (f *BigFlag) Apply(set *flag.FlagSet) error
- func (f *BigFlag) GetCategory() string
- func (f *BigFlag) GetDefaultText() string
- func (f *BigFlag) GetEnvVars() []string
- func (f *BigFlag) GetUsage() string
- func (f *BigFlag) GetValue() string
- func (f *BigFlag) IsRequired() bool
- func (f *BigFlag) IsSet() bool
- func (f *BigFlag) IsVisible() bool
- func (f *BigFlag) Names() []string
- func (f *BigFlag) String() string
- func (f *BigFlag) TakesValue() bool
- type DirectoryFlag
- func (f *DirectoryFlag) Apply(set *flag.FlagSet) error
- func (f *DirectoryFlag) GetCategory() string
- func (f *DirectoryFlag) GetDefaultText() string
- func (f *DirectoryFlag) GetEnvVars() []string
- func (f *DirectoryFlag) GetUsage() string
- func (f *DirectoryFlag) GetValue() string
- func (f *DirectoryFlag) IsRequired() bool
- func (f *DirectoryFlag) IsSet() bool
- func (f *DirectoryFlag) IsVisible() bool
- func (f *DirectoryFlag) Names() []string
- func (f *DirectoryFlag) String() string
- func (f *DirectoryFlag) TakesValue() bool
- type DirectoryString
- type TextMarshaler
- type TextMarshalerFlag
- func (f *TextMarshalerFlag) Apply(set *flag.FlagSet) error
- func (f *TextMarshalerFlag) GetCategory() string
- func (f *TextMarshalerFlag) GetDefaultText() string
- func (f *TextMarshalerFlag) GetEnvVars() []string
- func (f *TextMarshalerFlag) GetUsage() string
- func (f *TextMarshalerFlag) GetValue() string
- func (f *TextMarshalerFlag) IsRequired() bool
- func (f *TextMarshalerFlag) IsSet() bool
- func (f *TextMarshalerFlag) IsVisible() bool
- func (f *TextMarshalerFlag) Names() []string
- func (f *TextMarshalerFlag) String() string
- func (f *TextMarshalerFlag) TakesValue() bool
Constants ¶
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 AutoEnvVars ¶ added in v1.10.49
func AutoEnvVars(flags []cli.Flag, prefix string)
AutoEnvVars extens all the specific CLI flags with automatically generated env vars by capitalizing the flag, replacing . with _ and prefixing it with the specified string.
Note, the prefix should *not* contain the separator underscore, that will be added automatically.
func CheckEnvVars ¶ added in v1.10.49
func CheckEnvVars(ctx *cli.Context, flags []cli.Flag, prefix string)
CheckEnvVars iterates over all the environment variables and checks if any of them look like a CLI flag but is not consumed. This can be used to detect old or mistyped names.
func MigrateGlobalFlags ¶
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.
Types ¶
type BigFlag ¶
type BigFlag struct { Name string Category string DefaultText string Usage string Required bool Hidden bool HasBeenSet bool Value *big.Int Aliases []string EnvVars []string // contains filtered or unexported fields }
BigFlag is a command line flag that accepts 256 bit big integers in decimal or hexadecimal syntax.
func (*BigFlag) GetCategory ¶
func (*BigFlag) GetDefaultText ¶
func (*BigFlag) GetEnvVars ¶
func (*BigFlag) IsRequired ¶
func (*BigFlag) TakesValue ¶
type DirectoryFlag ¶
type DirectoryFlag struct { Name string Category string DefaultText string Usage string Required bool Hidden bool HasBeenSet bool Value DirectoryString Aliases []string EnvVars []string }
DirectoryFlag is custom cli.Flag type which expand the received string to an absolute path. e.g. ~/.cortex -> /home/username/.cortex
func (*DirectoryFlag) Apply ¶
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 ¶
func (f *DirectoryFlag) GetCategory() string
func (*DirectoryFlag) GetDefaultText ¶
func (f *DirectoryFlag) GetDefaultText() string
func (*DirectoryFlag) GetEnvVars ¶
func (f *DirectoryFlag) GetEnvVars() []string
func (*DirectoryFlag) GetUsage ¶
func (f *DirectoryFlag) GetUsage() string
func (*DirectoryFlag) GetValue ¶
func (f *DirectoryFlag) GetValue() string
func (*DirectoryFlag) IsRequired ¶
func (f *DirectoryFlag) IsRequired() bool
func (*DirectoryFlag) IsSet ¶
func (f *DirectoryFlag) IsSet() bool
func (*DirectoryFlag) IsVisible ¶
func (f *DirectoryFlag) IsVisible() bool
func (*DirectoryFlag) Names ¶
func (f *DirectoryFlag) Names() []string
func (*DirectoryFlag) String ¶
func (f *DirectoryFlag) String() string
func (*DirectoryFlag) TakesValue ¶
func (f *DirectoryFlag) TakesValue() bool
type DirectoryString ¶
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 ¶
func (s *DirectoryString) Set(value string) error
func (*DirectoryString) String ¶
func (s *DirectoryString) String() string
type TextMarshaler ¶
type TextMarshaler interface { encoding.TextMarshaler encoding.TextUnmarshaler }
func GlobalTextMarshaler ¶
func GlobalTextMarshaler(ctx *cli.Context, name string) TextMarshaler
GlobalTextMarshaler returns the value of a TextMarshalerFlag from the global flag set.
type TextMarshalerFlag ¶
type TextMarshalerFlag struct { Name string Category string DefaultText string Usage string Required bool Hidden bool HasBeenSet bool Value TextMarshaler Aliases []string EnvVars []string }
TextMarshalerFlag wraps a TextMarshaler value.
func (*TextMarshalerFlag) GetCategory ¶
func (f *TextMarshalerFlag) GetCategory() string
func (*TextMarshalerFlag) GetDefaultText ¶
func (f *TextMarshalerFlag) GetDefaultText() string
func (*TextMarshalerFlag) GetEnvVars ¶
func (f *TextMarshalerFlag) GetEnvVars() []string
func (*TextMarshalerFlag) GetUsage ¶
func (f *TextMarshalerFlag) GetUsage() string
func (*TextMarshalerFlag) GetValue ¶
func (f *TextMarshalerFlag) GetValue() string
func (*TextMarshalerFlag) IsRequired ¶
func (f *TextMarshalerFlag) IsRequired() bool
func (*TextMarshalerFlag) IsSet ¶
func (f *TextMarshalerFlag) IsSet() bool
func (*TextMarshalerFlag) IsVisible ¶
func (f *TextMarshalerFlag) IsVisible() bool
func (*TextMarshalerFlag) Names ¶
func (f *TextMarshalerFlag) Names() []string
func (*TextMarshalerFlag) String ¶
func (f *TextMarshalerFlag) String() string
func (*TextMarshalerFlag) TakesValue ¶
func (f *TextMarshalerFlag) TakesValue() bool