command

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MPL-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// FlagParseError indicates that a command was unable to successfully parse the flags/arguments provided to it.
	FlagParseError int = iota + 16

	// ConfigError indicates that there was an error in the hcdiag configuration.
	ConfigError

	// RunError indicates an error in the runner or its supporting unexported procedures.
	RunError
)

The following error group is intended for issues within the command's execution.

View Source
const (
	// AgentSetupError is returned when the agent cannot be setup properly prior to command execution.
	AgentSetupError int = iota + 32

	// AgentExecutionError is returned when the agent returns an error to the calling command.
	AgentExecutionError
)

The following error group is intended for issues with the Agent.

View Source
const Success int = 0

Success indicates a successful command execution.

Variables

This section is empty.

Functions

func RunCommandFactory

func RunCommandFactory(ui cli.Ui) cli.CommandFactory

RunCommandFactory provides a cli.CommandFactory that will produce an appropriately-initiated *command.

func Usage

func Usage(txt string, flags *flag.FlagSet) string

func VersionCommandFactory

func VersionCommandFactory(ui cli.Ui) cli.CommandFactory

VersionCommandFactory provides a cli.CommandFactory that will produce an appropriately-initiated *command.

Types

type CSVFlag

type CSVFlag struct {
	Values *[]string
}

func (CSVFlag) Set

func (s CSVFlag) Set(v string) error

func (CSVFlag) String

func (s CSVFlag) String() string

type RunCommand

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

func NewRunCommand

func NewRunCommand(ui cli.Ui) *RunCommand

NewRunCommand produces a new *command pointer, initialized for use in a CLI application.

func (*RunCommand) Help

func (c *RunCommand) Help() string

Help provides help text to users who pass in the --help flag or who enter invalid options.

func (*RunCommand) Run

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

Run executes the command.

func (*RunCommand) Synopsis

func (c *RunCommand) Synopsis() string

Synopsis provides a brief description of the command, for inclusion in the application's primary --help.

type Usager

type Usager struct {
	Usage string
	Flags *flag.FlagSet
}

func (*Usager) String

func (u *Usager) String() string

type VersionCommand

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

func NewVersionCommand

func NewVersionCommand(ui cli.Ui) *VersionCommand

func (VersionCommand) Help

func (c VersionCommand) Help() string

func (VersionCommand) Run

func (c VersionCommand) Run([]string) int

func (VersionCommand) Synopsis

func (c VersionCommand) Synopsis() string

Jump to

Keyboard shortcuts

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