Documentation
¶
Index ¶
- func And(fns ...cobra.PositionalArgs) cobra.PositionalArgs
- func ApplyLogFlags(app *cobra.Command)
- func CompletionCommand() *cobra.Command
- func DefaultCLI(app *cobra.Command, version, commit, envPrefix string)
- func EnvironmentConfig(envPrefix string)
- func One() cobra.PositionalArgs
- func Range(min, max int) cobra.PositionalArgs
- func VersionCommand(version, commit string) *cobra.Command
- type Applicant
- func Alias(aliases ...string) Applicant
- func Args(fn cobra.PositionalArgs) Applicant
- func Completion() Applicant
- func Deprecated(message string) Applicant
- func Flag(name string, flagType FlagType, options ...FlagOption) Applicant
- func FlagLogFile() Applicant
- func FlagLogFormat() Applicant
- func FlagLogLevel(level string) Applicant
- func FlagLogLevelA(level string) Applicant
- func Hidden() Applicant
- func Long(description string) Applicant
- func Run(fn func(cmd *cobra.Command, args []string)) Applicant
- func Short(description string) Applicant
- func SubCommand(name string, applicants ...Applicant) Applicant
- func ValidArgs(args ...string) Applicant
- func Version(version, commit string) Applicant
- func WrapBuilderOption(fn ...CommandOption) Applicant
- type Command
- func (s *Command) A(fn func(c *Command)) *Command
- func (s *Command) Apply(applicants ...Applicant) *Command
- func (s *Command) Debug(w io.StringWriter)
- func (s *Command) Execute() error
- func (s *Command) ExecuteOrPanic()
- func (s *Command) GenerateCobra() *cobra.Command
- func (s *Command) S(name string, opts ...Applicant) *Command
- func (s *Command) Sub(name string, applicants ...Applicant) *Command
- type CommandOption
- type FlagInfo
- type FlagOption
- type FlagType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func And ¶
func And(fns ...cobra.PositionalArgs) cobra.PositionalArgs
func ApplyLogFlags ¶
func CompletionCommand ¶
func DefaultCLI ¶
func EnvironmentConfig ¶
func EnvironmentConfig(envPrefix string)
func One ¶
func One() cobra.PositionalArgs
func Range ¶
func Range(min, max int) cobra.PositionalArgs
func VersionCommand ¶
Types ¶
type Applicant ¶
type Applicant func(builder *Command)
func Args ¶
func Args(fn cobra.PositionalArgs) Applicant
func Completion ¶
func Completion() Applicant
func Deprecated ¶
func FlagLogFile ¶
func FlagLogFile() Applicant
func FlagLogFormat ¶
func FlagLogFormat() Applicant
func FlagLogLevel ¶
func FlagLogLevelA ¶ added in v0.6.0
func SubCommand ¶
func WrapBuilderOption ¶
func WrapBuilderOption(fn ...CommandOption) Applicant
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func NewCommandline ¶
func (*Command) Debug ¶
func (s *Command) Debug(w io.StringWriter)
func (*Command) ExecuteOrPanic ¶ added in v0.7.0
func (s *Command) ExecuteOrPanic()
func (*Command) GenerateCobra ¶
type CommandOption ¶
type FlagOption ¶
type FlagOption func(fi *FlagInfo)
func Abbr ¶
func Abbr(char string) FlagOption
func Description ¶
func Description(desc string) FlagOption
func Dirname ¶ added in v0.4.0
func Dirname() FlagOption
func Env ¶
func Env() FlagOption
Env option allows this Flag to be set from the environment. Please note that the name of the Flag is converted to snake_case. For more control over the name use EnvName.
func EnvName ¶
func EnvName(name string) FlagOption
func Filename ¶ added in v0.4.0
func Filename(extensions ...string) FlagOption
func Mandatory ¶
func Mandatory() FlagOption
func Persistent ¶
func Persistent() FlagOption
Click to show internal directories.
Click to hide internal directories.