command

package
v0.0.0-...-a88c32c Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: ISC Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Success is the exit code when a command execution is successful.
	Success int = iota
	// GenericError is the generic exit code when something fails.
	GenericError
	// FlagError is the exit code when an undefined or invalid flag is provided to a command.
	FlagError
)

Variables

This section is empty.

Functions

func NewFactory

func NewFactory(ui ui.UI) cli.CommandFactory

NewFactory returns a cli.CommandFactory for creating a new command.

Types

type Command

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

Command is the cli.Command implementation for emerge command.

func New

func New(ui ui.UI) *Command

New creates a new command.

func (*Command) Help

func (c *Command) Help() string

Help returns a long help text including usage, description, and list of flags for the command.

func (*Command) Run

func (c *Command) Run(args []string) int

Run runs the actual command with the given command-line arguments. This method is used as a proxy for creating dependencies and the actual command execution is delegated to the run method for testing purposes.

func (*Command) Synopsis

func (c *Command) Synopsis() string

Synopsis returns a short one-line synopsis for the command.

Jump to

Keyboard shortcuts

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