Documentation ¶
Index ¶
- Constants
- func Apply(c *Command, cmdOpts ...Option)
- func CheckErr(msg interface{})
- func CheckExit(err error, printStack ...bool)
- func SetDebug(debug bool)
- type AnyFlag
- type Command
- type FlagSet
- type Option
- func Alias(alias ...string) Option
- func ArgAliases(alias ...string) Option
- func Args(args PositionalArgs) Option
- func Comment(short string, long ...string) Option
- func DisableAutoGenTag(disabled ...bool) Option
- func DisableFlagParsing(disabled ...bool) Option
- func DisableFlagsInUseLine(disabled ...bool) Option
- func DisableSuggestions(disabled ...bool) Option
- func ExactArgs(n int) Option
- func ExactValidArgs(n int) Option
- func Flags(appFlag func(fs *FlagSet)) Option
- func Group(opts ...Option) Option
- func HelpCommand() Option
- func Hidden(hidden ...bool) Option
- func Long(long ...string) Option
- func PersistentFlags(appFlag func(fs *FlagSet)) Option
- func PersistentPostRun(run Runnable) Option
- func PersistentPreRun(run Runnable) Option
- func PostRun(run Runnable) Option
- func PreRun(run Runnable) Option
- func Run(run Runnable) Option
- func StructFlags(appFlag func(fs *AnyFlag)) Option
- func SubCommand(commands ...*Command) Option
- func Use(use string, alias ...string) Option
- func ValidArgs(validArgs ...string) Option
- func ValidArgsFunction(...) Option
- func Version(version string) Option
- type OptionApply
- type PositionalArgs
- type Runnable
- type ShellCompDirective
Constants ¶
View Source
const (
ShellCompDirectiveNoFileComp = cobra.ShellCompDirectiveNoFileComp
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnyFlag ¶
func StructFlag ¶
type Command ¶
func (*Command) AddCommand ¶
type Option ¶
type Option interface {
Apply(c *Command)
}
func ArgAliases ¶
func Args ¶
func Args(args PositionalArgs) Option
func DisableAutoGenTag ¶
func DisableFlagParsing ¶
func DisableFlagsInUseLine ¶
func DisableSuggestions ¶
func ExactValidArgs ¶
func HelpCommand ¶
func HelpCommand() Option
func PersistentFlags ¶
func PersistentPostRun ¶
func PersistentPreRun ¶
func StructFlags ¶
func SubCommand ¶
func ValidArgsFunction ¶
type OptionApply ¶
type OptionApply func(c *Command)
func (OptionApply) Apply ¶
func (opt OptionApply) Apply(c *Command)
type PositionalArgs ¶
type PositionalArgs = cobra.PositionalArgs
type ShellCompDirective ¶
type ShellCompDirective = cobra.ShellCompDirective
Click to show internal directories.
Click to hide internal directories.