cmd

package
v0.0.0-...-efcda9a Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func App

func App() *cli.App

App returns the cli app within the default command.

func DefaultOptions

func DefaultOptions() mcmd.Options

DefaultOptions returns the options passed to the default command.

func Register

func Register(cmds ...*cli.Command)

Register appends commands to the default app.

func Run

func Run()

Run runs the cli app within the default command. On error, it prints the error message and exits.

Types

type Cmd

type Cmd interface {
	mcmd.Cmd
	Run() error
}

Cmd is the interface that wraps the cli app.

Cmd embeds the Cmd interface from the go-micro.dev/v4/cmd package and adds a Run method.

Run runs the cli app within this command and exits on error.

var (
	// DefaultCmd is the default, unmodified root command.
	DefaultCmd Cmd = NewCmd()
)

func NewCmd

func NewCmd(opts ...mcmd.Option) Cmd

NewCmd returns a new command.

Directories

Path Synopsis
cli
new
run

Jump to

Keyboard shortcuts

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