Documentation
¶
Overview ¶
Package cli implements a simple command line interface library.
Index ¶
- Variables
- func InputBool(prompt string) (bool, error)
- func InputComplex64(prompt string) (complex64, error)
- func InputComplex128(prompt string) (complex128, error)
- func InputFloat32(prompt string) (float32, error)
- func InputFloat64(prompt string) (float64, error)
- func InputInt(prompt string) (int, error)
- func InputInt8(prompt string) (int8, error)
- func InputInt16(prompt string) (int16, error)
- func InputInt32(prompt string) (int32, error)
- func InputInt64(prompt string) (int64, error)
- func InputString(prompt string) (string, error)
- func InputUint(prompt string) (uint, error)
- func InputUint8(prompt string) (uint8, error)
- func InputUint16(prompt string) (uint16, error)
- func InputUint32(prompt string) (uint32, error)
- func InputUint64(prompt string) (uint64, error)
- func Resolve[T any](ctx *Context) (T, error)
- type Application
- type Context
- type Menu
Constants ¶
This section is empty.
Variables ¶
var Stdin = bufio.NewReader(os.Stdin)
Stdin is the buffer reader of os.Stdin.
Functions ¶
func InputComplex64 ¶ added in v0.9.0
InputComplex64 gets complex64 value from stdin.
func InputComplex128 ¶ added in v0.9.0
func InputComplex128(prompt string) (complex128, error)
InputComplex128 gets complex128 value from stdin.
func InputFloat32 ¶ added in v0.9.0
InputFloat32 gets float32 value from stdin.
func InputFloat64 ¶ added in v0.9.0
InputFloat64 gets float64 value from stdin.
func InputInt16 ¶ added in v0.9.0
InputInt16 gets int16 value from stdin.
func InputInt32 ¶ added in v0.9.0
InputInt32 gets int32 value from stdin.
func InputInt64 ¶ added in v0.9.0
InputInt64 gets int64 value from stdin.
func InputString ¶ added in v0.7.0
InputString gets string value from stdin.
func InputUint8 ¶ added in v0.9.0
InputUint8 gets uint8 value from stdin.
func InputUint16 ¶ added in v0.9.0
InputUint16 gets uint16 value from stdin.
func InputUint32 ¶ added in v0.9.0
InputUint32 gets uint32 value from stdin.
func InputUint64 ¶ added in v0.9.0
InputUint64 gets uint64 value from stdin.
Types ¶
type Application ¶ added in v0.5.0
type Application struct {
Menu
// contains filtered or unexported fields
}
Application presents a application.
func (*Application) AddService ¶ added in v0.5.0
func (app *Application) AddService(creator any, shared bool) *Application
AddService adds a service to this application.
func (*Application) Run ¶ added in v0.5.0
func (app *Application) Run() error
Run starts the application and waits for it to complete.
func (*Application) SetDivider ¶ added in v0.5.0
func (app *Application) SetDivider(divider string) *Application
SetDivider sets divider for this application.
type Context ¶ added in v0.5.0
Context represents the action context.