cli

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2017 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LongHelp

func LongHelp(rootName string, root *cmds.Command, path []string, out io.Writer) error

LongHelp writes a formatted CLI helptext string to a Writer for the given command

func NewResponseEmitter

func NewResponseEmitter(stdout, stderr io.Writer, enc func(cmds.Request) func(io.Writer) cmds.Encoder, req cmds.Request) (cmds.ResponseEmitter, <-chan int)

func Parse

func Parse(input []string, stdin *os.File, root *cmds.Command) (cmds.Request, *cmds.Command, []string, error)

Parse parses the input commandline string (cmd, flags, and args). returns the corresponding command Request object.

func ParseArgs

func ParseArgs(req cmds.Request, inputs []string, stdin *os.File, argDefs []cmdkit.Argument, root *cmds.Command) ([]string, []files.File, error)

func ShortHelp

func ShortHelp(rootName string, root *cmds.Command, path []string, out io.Writer) error

ShortHelp writes a formatted CLI helptext string to a Writer for the given command

Types

type ErrSet

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

type ResponseEmitter added in v0.3.0

type ResponseEmitter interface {
	cmds.ResponseEmitter

	Stdout() io.Writer
	Stderr() io.Writer
	Exit(int)
}

ResponseEmitter extends cmds.ResponseEmitter to give better control over the command line

Jump to

Keyboard shortcuts

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