cli

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

README

cli

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionFunc

type ActionFunc func(*Context)

type App

type App struct {
	Name        string
	Usage       string
	Description string
	Commands    []*Command
}

func (*App) Run

func (app *App) Run(args []string) error

type ArgsArray

type ArgsArray []string

func (*ArgsArray) First

func (a *ArgsArray) First() string

func (*ArgsArray) Get

func (a *ArgsArray) Get(index int) string

func (*ArgsArray) Tail

func (a *ArgsArray) Tail() []string

type Bool

type Bool struct {
	Name  string
	Usage string
	// contains filtered or unexported fields
}

func (*Bool) GetName

func (flagBool *Bool) GetName() string

func (*Bool) GetUsage

func (flagBool *Bool) GetUsage() string

func (*Bool) Kind

func (flagBool *Bool) Kind() reflect.Kind

type Command

type Command struct {
	Name        string
	Usage       string
	Description string
	Action      ActionFunc
	Flags       FlagSet
}

func (*Command) Run

func (c *Command) Run(ctx *Context)

type Context

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

func (*Context) Args

func (ctx *Context) Args() ArgsArray

func (*Context) String

func (ctx *Context) String(flag string) string

func (*Context) Value

func (ctx *Context) Value(flag string) interface{}

type Flag

type Flag interface {
	GetName() string
	GetUsage() string
	Kind() reflect.Kind
	// contains filtered or unexported methods
}

type FlagSet

type FlagSet []Flag

type Int

type Int struct {
	Name  string
	Usage string
	// contains filtered or unexported fields
}

func (*Int) GetName

func (flagInt *Int) GetName() string

func (*Int) GetUsage

func (flagInt *Int) GetUsage() string

func (*Int) Kind

func (flagInt *Int) Kind() reflect.Kind

type SliceInt

type SliceInt struct {
	Name  string
	Usage string
	// contains filtered or unexported fields
}

func (*SliceInt) GetName

func (flagSliceInt *SliceInt) GetName() string

func (*SliceInt) GetUsage

func (flagSliceInt *SliceInt) GetUsage() string

func (*SliceInt) Kind

func (flagSliceInt *SliceInt) Kind() reflect.Kind

type SliceString

type SliceString struct {
	Name  string
	Usage string
	// contains filtered or unexported fields
}

func (*SliceString) GetName

func (flagSliceString *SliceString) GetName() string

func (*SliceString) GetUsage

func (flagSliceString *SliceString) GetUsage() string

func (*SliceString) Kind

func (flagSliceString *SliceString) Kind() reflect.Kind

type String

type String struct {
	Name  string
	Usage string
	// contains filtered or unexported fields
}

func (*String) GetName

func (flagString *String) GetName() string

func (*String) GetUsage

func (flagString *String) GetUsage() string

func (*String) Kind

func (flagString *String) Kind() reflect.Kind

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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