clicontext

package
v0.0.0-...-a0ddc14 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandContext

type CommandContext struct {
	Command string
	Args    []string
	// contains filtered or unexported fields
}

func NewCommandContext

func NewCommandContext(args []string) *CommandContext

func (*CommandContext) CurrentCommand

func (c *CommandContext) CurrentCommand() string

func (*CommandContext) Invoke

func (c *CommandContext) Invoke(commands map[string]CommandEntryFunc) error

func (*CommandContext) NextContext

func (c *CommandContext) NextContext(name string, args []string) *CommandContext

func (*CommandContext) Parse

func (c *CommandContext) Parse(set *flag.FlagSet) error

func (*CommandContext) SetDefaultCommand

func (c *CommandContext) SetDefaultCommand(name string)

type CommandEntryFunc

type CommandEntryFunc func(*CommandContext) error

type Context

type Context struct {
	In          *os.File
	InFilename  string
	Out         *os.File
	OutFilename string
	Set         *flag.FlagSet
}

func New

func New(name string) *Context

func (*Context) Close

func (c *Context) Close()

func (*Context) CloseNonDefault

func (c *Context) CloseNonDefault()

func (*Context) SetIn

func (c *Context) SetIn(inFile string) error

func (*Context) SetOut

func (c *Context) SetOut(outFile string) error

Jump to

Keyboard shortcuts

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