app

package module
v0.0.0-...-78b167e Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppNames

func AppNames() []string

func Register

func Register(name string, app AppEntry)

func Run

func Run(name string, ctx *Context) error

Types

type AppEntry

type AppEntry func(ctx *Context) error

func Get

func Get(name string) AppEntry

type Context

type Context struct {
	Args   []string
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer

	*chdir.Chdirfs
	// contains filtered or unexported fields
}

func (*Context) Flag

func (c *Context) Flag() *flag.FlagSet

func (*Context) Init

func (c *Context) Init()

func (*Context) LineReader

func (c *Context) LineReader() LineReader

func (*Context) ParseFlags

func (c *Context) ParseFlags() error

func (*Context) Printf

func (c *Context) Printf(fmtstr string, args ...interface{})

type LineReader

type LineReader interface {
	Prompt(string) (string, error)
	AppendHistory(string)
	SetAutoComplete(func(string) []string)
	Close() error
}

Directories

Path Synopsis
animal
* @Descripttion: * @version: * @Author: cm.d * @Date: 2021-11-07 00:01:19 * @LastEditors: cm.d * @LastEditTime: 2021-11-07 00:56:32
* @Descripttion: * @version: * @Author: cm.d * @Date: 2021-11-07 00:01:19 * @LastEditors: cm.d * @LastEditTime: 2021-11-07 00:56:32
examples

Jump to

Keyboard shortcuts

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