commands

package
v0.0.0-...-f44e450 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	// Description explains what this verb commands to do
	Description() string

	// Usage prints the syntax of arguments for this command
	Usage() string

	// SetupFlagSet is called to allow the command implementation
	// to setup which option flags it has.
	SetupFlagSet(flagSet *flag.FlagSet)

	// Execute is the main function here. It is responsible to
	// start the execution of the command.
	//
	// `args` are the arguments left unused by verb itself and options.
	Execute(ctx context.Context, cfg Config, args []string) error
}

Command is an interface of implementations of command verbs (like "dump", "verify" etc of "afascli dump"/"afascli verify")

type Config

type Config struct {
	IsQuiet             bool
	FirmwareWandOptions []firmwarewand.Option
}

type Descriptioner

type Descriptioner interface {
	Description() string
}

Descriptioner is the interface for error-s which requires method Description, which in turn is used to provide verbose explanation of how to interpret the error.

type ErrArgs

type ErrArgs struct {
	Err error
}

func (ErrArgs) Error

func (err ErrArgs) Error() string

func (ErrArgs) Unwrap

func (err ErrArgs) Unwrap() error

type ExitCoder

type ExitCoder interface {
	ExitCode() int
}

ExitCoder is an error signature used to override the exitcode in the end of main.main.

type SilentError

type SilentError struct {
	Err error
}

func (SilentError) Error

func (err SilentError) Error() string

func (SilentError) Unwrap

func (err SilentError) Unwrap() error

Jump to

Keyboard shortcuts

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