cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2013 License: BSD-3-Clause, GPL-3.0, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateTagName

func ValidateTagName(tagName string) error

Types

type Command

type Command interface {
	Name() CommandName
	Synopsis() string
	Description() string
	Options() Options
	Exec(options Options, args []string) error
}

type CommandName

type CommandName string

type CommandNames

type CommandNames []CommandName

func (CommandNames) Len

func (commandNames CommandNames) Len() int

func (CommandNames) Less

func (commandNames CommandNames) Less(i, j int) bool

func (CommandNames) Swap

func (commandNames CommandNames) Swap(i, j int)

type Option

type Option struct {
	LongName    string
	ShortName   string
	Description string
	HasArgument bool
	Argument    string
}

type Options

type Options []Option

func (Options) Get

func (options Options) Get(name string) *Option

func (Options) HasOption

func (options Options) HasOption(name string) bool

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser(globalOptions Options, commandByName map[CommandName]Command) *Parser

func (*Parser) Parse

func (parser *Parser) Parse(args []string) (commandName CommandName, options Options, arguments []string, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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