cobrax

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	*cobra.Command
}

func NewCommand

func NewCommand(use string, opts ...Option) *Command

func (*Command) AddCommand

func (c *Command) AddCommand(cmds ...*Command)

func (*Command) Flags

func (c *Command) Flags() *FlagSet

func (*Command) MustInit

func (c *Command) MustInit()

func (*Command) PersistentFlags

func (c *Command) PersistentFlags() *FlagSet

type FlagSet

type FlagSet struct {
	*pflag.FlagSet
}

func (*FlagSet) BoolVar

func (f *FlagSet) BoolVar(p *bool, name string)

func (*FlagSet) BoolVarP

func (f *FlagSet) BoolVarP(p *bool, name, shorthand string)

func (*FlagSet) BoolVarPWithDefaultValue

func (f *FlagSet) BoolVarPWithDefaultValue(p *bool, name, shorthand string, value bool)

func (*FlagSet) BoolVarWithDefaultValue

func (f *FlagSet) BoolVarWithDefaultValue(p *bool, name string, value bool)

func (*FlagSet) IntVar

func (f *FlagSet) IntVar(p *int, name string)

func (*FlagSet) IntVarWithDefaultValue

func (f *FlagSet) IntVarWithDefaultValue(p *int, name string, value int)

func (*FlagSet) StringSliceVar

func (f *FlagSet) StringSliceVar(p *[]string, name string)

func (*FlagSet) StringSliceVarP

func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string)

func (*FlagSet) StringSliceVarPWithDefaultValue

func (f *FlagSet) StringSliceVarPWithDefaultValue(p *[]string, name, shorthand string, value []string)

func (*FlagSet) StringSliceVarWithDefaultValue

func (f *FlagSet) StringSliceVarWithDefaultValue(p *[]string, name string, value []string)

func (*FlagSet) StringVar

func (f *FlagSet) StringVar(p *string, name string)

func (*FlagSet) StringVarP

func (f *FlagSet) StringVarP(p *string, name, shorthand string)

func (*FlagSet) StringVarPWithDefaultValue

func (f *FlagSet) StringVarPWithDefaultValue(p *string, name, shorthand string, value string)

func (*FlagSet) StringVarWithDefaultValue

func (f *FlagSet) StringVarWithDefaultValue(p *string, name string, value string)

type Option

type Option func(*cobra.Command)

func WithArgs

func WithArgs(arg cobra.PositionalArgs) Option

func WithHidden

func WithHidden() Option

func WithRun

func WithRun(run func(*cobra.Command, []string)) Option

func WithRunE

func WithRunE(runE func(*cobra.Command, []string) error) Option

Jump to

Keyboard shortcuts

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