shellcommand

package
v0.0.0-...-37d5b15 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands = []*Command{
	cmdVersion,
}

Functions

func Run

func Run()

func SkHandlerFactory

func SkHandlerFactory(s *shell.Shell) shell.Handler

Types

type Command

type Command struct {
	// Run runs the command.
	// The args are the arguments after the command name.
	Run func(cmd *Command, args []string, rw io.ReadWriter) bool

	// UsageLine is the one-line usage message.
	// The first word in the line is taken to be the command name.
	UsageLine string

	// Short is the short description shown in the 'go help' output.
	Short string

	// Long is the long message shown in the 'go help <this-command>' output.
	Long string

	// Flag is a set of flags specific to this command.
	Flag flag.FlagSet

	IsDebug *bool
}

func (*Command) Name

func (c *Command) Name() string

Name returns the command's name: the first word in the usage line.

func (*Command) Runnable

func (c *Command) Runnable() bool

Runnable reports whether the command can be run; otherwise it is a documentation pseudo-command such as importpath.

func (*Command) Usage

func (c *Command) Usage()

type SkHandler

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

func (*SkHandler) HandleEof

func (h *SkHandler) HandleEof() error

func (*SkHandler) HandleLine

func (h *SkHandler) HandleLine(line string) error

Jump to

Keyboard shortcuts

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