command

package
v0.0.0-...-903ec0a Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultErrorMessage

func DefaultErrorMessage(cmd cli.NamedCommand) string

DefaultErrorMessage returns the default error message for this command

func GlobalOptions

func GlobalOptions() string

GlobalOptions returns the global usage options string.

Types

type Command

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

Command is the base command

func (*Command) FlagSet

func (c *Command) FlagSet(name string) *pflag.FlagSet

FlagSet declares flags that are common to all commands, returning a pflag.FlagSet struct that will hold their values after pflag.Parse() is called by the command.

type FooCommand

type FooCommand struct {
	UI cli.UI

	Command
}

FooCommand :

func (*FooCommand) Help

func (c *FooCommand) Help() string

Help :

func (*FooCommand) Name

func (c *FooCommand) Name() string

Name :

func (*FooCommand) Run

func (c *FooCommand) Run(ctx context.Context, args []string) int

Run :

func (*FooCommand) Synopsis

func (c *FooCommand) Synopsis() string

Synopsis :

Jump to

Keyboard shortcuts

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