cli

package
v0.0.0-...-a36ccc7 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitCodeSuccess           = 0
	ExitCodeInternalCliError  = 1
	ExitCodeBadUserInputError = 2
	UnauthenticatedErrorCode  = 3
)

Variables

This section is empty.

Functions

func New

func New(impl CLIHandlersInterface, version string) *urfavecli.Command

Types

type CLIHandlersInterface

type CLIHandlersInterface interface {

	// PleasantriesFarewell handles the invocation of:
	//
	// “`sh
	// pleasantries farewell <name> [flags]
	// “`
	PleasantriesFarewell(ctx context.Context, cmd *urfavecli.Command, arguments PleasantriesFarewellArgs, flags PleasantriesFarewellFlags) error

	// PleasantriesGreet handles the invocation of:
	//
	// “`sh
	// pleasantries greet <name> [flags]
	// “`
	PleasantriesGreet(ctx context.Context, cmd *urfavecli.Command, arguments PleasantriesGreetArgs, flags PleasantriesGreetFlags) error
}

CLIHandlersInterface represents the handlers required to implement all commands of the CLI. An implementation of this interface will be injected into the generated CLI wrapper code.

type Impl

type Impl struct{}

func (Impl) PleasantriesFarewell

func (Impl) PleasantriesFarewell(ctx context.Context, cmd *urfavecli.Command, arguments PleasantriesFarewellArgs, flags PleasantriesFarewellFlags) error

func (Impl) PleasantriesGreet

func (Impl) PleasantriesGreet(ctx context.Context, cmd *urfavecli.Command, arguments PleasantriesGreetArgs, flags PleasantriesGreetFlags) error

type PleasantriesFarewellArgs

type PleasantriesFarewellArgs struct {
	Name string
}

PleasantriesFarewellArgs holds the parsed arguments that will be injected into the command handler implementation.

type PleasantriesFarewellFlags

type PleasantriesFarewellFlags struct {
	Language string
}

PleasantriesFarewellFlags holds the parsed flags that will be injected into the command handler implementation.

type PleasantriesGreetArgs

type PleasantriesGreetArgs struct {
	Name string
}

PleasantriesGreetArgs holds the parsed arguments that will be injected into the command handler implementation.

type PleasantriesGreetFlags

type PleasantriesGreetFlags struct {
	Language string
}

PleasantriesGreetFlags holds the parsed flags that will be injected into the command handler implementation.

Jump to

Keyboard shortcuts

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