cmd

package
v0.0.0-...-371464c Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 5 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 CLI

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

CLI is the interface that wraps the cli app.

CLI embeds the Cmd interface from the github.com/smart-echo/micro/util/cmd package and adds a Run method.

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

var (
	// DefaultCLI is the default, unmodified root command.
	DefaultCLI CLI = NewCLI()
)

func NewCLI

func NewCLI(opts ...mcmd.Option) CLI

NewCLI returns a new command.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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