Documentation ¶
Index ¶
- func Run(args []string) int
- func RunCustom(args []string, runOpts *RunOptions) int
- type BaseCommand
- type BoolPtr
- type BoolPtrVar
- type BoolVar
- type DurationVar
- type FlagBool
- type FlagExample
- type FlagSet
- func (f *FlagSet) BoolPtrVar(i *BoolPtrVar)
- func (f *FlagSet) BoolVar(i *BoolVar)
- func (f *FlagSet) DurationVar(i *DurationVar)
- func (f *FlagSet) Float64Var(i *Float64Var)
- func (f *FlagSet) Int64Var(i *Int64Var)
- func (f *FlagSet) IntVar(i *IntVar)
- func (f *FlagSet) Name() string
- func (f *FlagSet) StringMapVar(i *StringMapVar)
- func (f *FlagSet) StringSliceVar(i *StringSliceVar)
- func (f *FlagSet) StringVar(i *StringVar)
- func (f *FlagSet) TimeVar(i *TimeVar)
- func (f *FlagSet) Uint64Var(i *Uint64Var)
- func (f *FlagSet) UintVar(i *UintVar)
- func (f *FlagSet) Var(value flag.Value, name, usage string)
- func (f *FlagSet) VarFlag(i *VarFlag)
- func (f *FlagSet) Visit(fn func(*flag.Flag))
- func (f *FlagSet) VisitAll(fn func(*flag.Flag))
- type FlagSets
- func (f *FlagSets) Args() []string
- func (f *FlagSets) Completions() complete.Flags
- func (f *FlagSets) Help() string
- func (f *FlagSets) NewFlagSet(name string) *FlagSet
- func (f *FlagSets) Parse(args []string, opts ...ParseOptions) error
- func (f *FlagSets) Parsed() bool
- func (f *FlagSets) Visit(fn func(*flag.Flag))
- type FlagVisibility
- type Float64Var
- type Int64Var
- type IntVar
- type ParseOptionAllowRawFormat
- type ParseOptions
- type ReviewCommand
- type RunCommand
- type RunOptions
- type StringMapVar
- type StringSliceVar
- type StringVar
- type TimeFormat
- type TimeVar
- type Uint64Var
- type UintVar
- type VarFlag
- type VaultUI
- type VersionCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunCustom ¶
func RunCustom(args []string, runOpts *RunOptions) int
RunCustom allows passing in a base command template to pass to other commands. Currently, this is only used for setting a custom token helper.
Types ¶
type BaseCommand ¶
type BoolPtr ¶
type BoolPtr struct {
// contains filtered or unexported fields
}
BoolPtr is a bool which is aware if it has been set.
type BoolPtrVar ¶
type BoolVar ¶
type BoolVar struct { Name string Aliases []string Usage string Default bool Hidden bool EnvVar string Target *bool Completion complete.Predictor }
-- BoolVar and boolValue
type DurationVar ¶
type DurationVar struct { Name string Aliases []string Usage string Default time.Duration Hidden bool EnvVar string Target *time.Duration Completion complete.Predictor }
-- DurationVar and durationValue
type FlagBool ¶
type FlagBool interface {
IsBoolFlag() bool
}
FlagBool is an interface which boolean flags implement.
type FlagExample ¶
type FlagExample interface {
Example() string
}
FlagExample is an interface which declares an example value.
type FlagSet ¶
type FlagSet struct {
// contains filtered or unexported fields
}
FlagSet is a grouped wrapper around a real flag set and a grouped flag set.
func (*FlagSet) BoolPtrVar ¶
func (f *FlagSet) BoolPtrVar(i *BoolPtrVar)
func (*FlagSet) DurationVar ¶
func (f *FlagSet) DurationVar(i *DurationVar)
func (*FlagSet) Float64Var ¶
func (f *FlagSet) Float64Var(i *Float64Var)
func (*FlagSet) StringMapVar ¶
func (f *FlagSet) StringMapVar(i *StringMapVar)
func (*FlagSet) StringSliceVar ¶
func (f *FlagSet) StringSliceVar(i *StringSliceVar)
type FlagSets ¶
type FlagSets struct {
// contains filtered or unexported fields
}
FlagSets is a group of flag sets.
func (*FlagSets) Completions ¶
Completions returns the completions for this flag set.
func (*FlagSets) NewFlagSet ¶
NewFlagSet creates a new flag set from the given flag sets.
func (*FlagSets) Parse ¶
func (f *FlagSets) Parse(args []string, opts ...ParseOptions) error
Parse parses the given flags, returning any errors. Warnings, if any, regarding the arguments format are sent to stdout
type FlagVisibility ¶
type FlagVisibility interface {
Hidden() bool
}
FlagVisibility is an interface which declares whether a flag should be hidden from help and completions. This is usually used for deprecations on "internal-only" flags.
type Float64Var ¶
type Float64Var struct { Name string Aliases []string Usage string Default float64 Hidden bool EnvVar string Target *float64 Completion complete.Predictor }
-- Float64Var and float64Value
type Int64Var ¶
type Int64Var struct { Name string Aliases []string Usage string Default int64 Hidden bool EnvVar string Target *int64 Completion complete.Predictor }
-- Int64Var and int64Value
type IntVar ¶
type IntVar struct { Name string Aliases []string Usage string Default int Hidden bool EnvVar string Target *int Completion complete.Predictor }
-- IntVar and intValue
type ParseOptionAllowRawFormat ¶
type ParseOptionAllowRawFormat bool
type ParseOptions ¶
type ParseOptions interface{}
type ReviewCommand ¶
type ReviewCommand struct { *BaseCommand // contains filtered or unexported fields }
func (*ReviewCommand) AutocompleteArgs ¶
func (r *ReviewCommand) AutocompleteArgs() complete.Predictor
func (*ReviewCommand) AutocompleteFlags ¶
func (r *ReviewCommand) AutocompleteFlags() complete.Flags
func (*ReviewCommand) Flags ¶
func (r *ReviewCommand) Flags() *FlagSets
func (*ReviewCommand) Help ¶
func (r *ReviewCommand) Help() string
func (*ReviewCommand) Run ¶
func (r *ReviewCommand) Run(args []string) int
func (*ReviewCommand) Synopsis ¶
func (r *ReviewCommand) Synopsis() string
type RunCommand ¶
type RunCommand struct { *BaseCommand // contains filtered or unexported fields }
func (*RunCommand) AutocompleteArgs ¶
func (r *RunCommand) AutocompleteArgs() complete.Predictor
func (*RunCommand) AutocompleteFlags ¶
func (r *RunCommand) AutocompleteFlags() complete.Flags
func (*RunCommand) Flags ¶
func (r *RunCommand) Flags() *FlagSets
func (*RunCommand) Help ¶
func (r *RunCommand) Help() string
func (*RunCommand) Run ¶
func (r *RunCommand) Run(args []string) int
func (*RunCommand) Synopsis ¶
func (r *RunCommand) Synopsis() string
type RunOptions ¶
type StringMapVar ¶
type StringMapVar struct { Name string Aliases []string Usage string Default map[string]string Hidden bool Target *map[string]string Completion complete.Predictor }
-- StringMapVar and stringMapValue
type StringSliceVar ¶
type StringSliceVar struct { Name string Aliases []string Usage string Default []string Hidden bool EnvVar string Target *[]string Completion complete.Predictor }
-- StringSliceVar and stringSliceValue
type StringVar ¶
type StringVar struct { Name string Aliases []string Usage string Default string Hidden bool EnvVar string Target *string Completion complete.Predictor }
-- StringVar and stringValue
type TimeFormat ¶
type TimeFormat int
Identify the allowable formats, identified by the minimum precision accepted. TODO: move this somewhere where it can be re-used for the API.
const ( TimeVar_EpochSecond TimeFormat = 1 << iota TimeVar_RFC3339Nano TimeVar_RFC3339Second TimeVar_Day TimeVar_Month )
const TimeVar_TimeOrDay TimeFormat = TimeVar_EpochSecond | TimeVar_RFC3339Nano | TimeVar_RFC3339Second | TimeVar_Day
Default value to use
type TimeVar ¶
type TimeVar struct { Name string Aliases []string Usage string Default time.Time Hidden bool EnvVar string Target *time.Time Completion complete.Predictor Formats TimeFormat }
-- TimeVar and timeValue
type Uint64Var ¶
type Uint64Var struct { Name string Aliases []string Usage string Default uint64 Hidden bool EnvVar string Target *uint64 Completion complete.Predictor }
-- Uint64Var and uint64Value
type UintVar ¶
type UintVar struct { Name string Aliases []string Usage string Default uint Hidden bool EnvVar string Target *uint Completion complete.Predictor }
-- UintVar && uintValue
type VarFlag ¶
type VarFlag struct { Name string Aliases []string Usage string Default string EnvVar string Value flag.Value Completion complete.Predictor }
-- VarFlag
type VersionCommand ¶
type VersionCommand struct {
*BaseCommand
}
VersionCommand is a Command implementation prints the version.
func (*VersionCommand) AutocompleteArgs ¶
func (c *VersionCommand) AutocompleteArgs() complete.Predictor
func (*VersionCommand) AutocompleteFlags ¶
func (c *VersionCommand) AutocompleteFlags() complete.Flags
func (*VersionCommand) Flags ¶
func (c *VersionCommand) Flags() *FlagSets
func (*VersionCommand) Help ¶
func (c *VersionCommand) Help() string
func (*VersionCommand) Run ¶
func (c *VersionCommand) Run(_ []string) int
func (*VersionCommand) Synopsis ¶
func (c *VersionCommand) Synopsis() string