Documentation
¶
Index ¶
- func PrintUsage()
- func PrintVersionOrUsage()
- func Register(c ICommand) bool
- func Write(w io.Writer)
- func WriteCommand(w io.Writer)
- type Command
- func (c *Command) AddDetails(txt string)
- func (c *Command) AddExample(cmdExample string, desc string)
- func (c *Command) GetDesc() string
- func (c *Command) GetDetails() string
- func (c *Command) GetExample() string
- func (c *Command) GetName() string
- func (c *Command) GetSynopsis() string
- func (c *Command) Init(name string, desc string)
- func (c *Command) Parse(arguments []string) (err error)
- func (c *Command) PrintUsage()
- func (c *Command) SetSynopsis(str string)
- func (c *Command) Validate()
- func (c *Command) Write(w io.Writer)
- type Group
- type ICommand
- type Option
- func (o *Option) BoolOption(p *bool, name string, value bool, usage string)
- func (o *Option) GetOptionDesc() string
- func (o *Option) IntOption(p *int, name string, value int, usage string)
- func (o *Option) StringOption(p *string, name string, value string, usage string)
- func (o *Option) UintOption(p *uint, name string, value uint, usage string)
- func (o *Option) ValueOption(value flag.Value, name string, usage string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintUsage ¶
func PrintUsage()
func PrintVersionOrUsage ¶
func PrintVersionOrUsage()
func WriteCommand ¶
Types ¶
type Command ¶
type Command struct { Option // contains filtered or unexported fields }
func (*Command) AddDetails ¶
func (*Command) AddExample ¶
func (*Command) GetDetails ¶
func (*Command) GetExample ¶
func (*Command) GetSynopsis ¶
func (*Command) PrintUsage ¶
func (c *Command) PrintUsage()
func (*Command) SetSynopsis ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func RegisterNewGroup ¶
type ICommand ¶
type ICommand interface { GetName() string GetDesc() string //get short description GetSynopsis() string GetDetails() string GetOptionDesc() string GetExample() string AddExample(cmdExample string, desc string) AddDetails(txt string) Init(name string, desc string) Exec() Parse(args []string) error PrintUsage() }
func GetCommand ¶
func ParseCommandLine ¶
type Option ¶
func (*Option) BoolOption ¶
func (*Option) GetOptionDesc ¶
func (*Option) StringOption ¶
func (*Option) UintOption ¶
Click to show internal directories.
Click to hide internal directories.