app

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 18 Imported by: 17

Documentation

Overview

Package app contains methods for configuring a command-line application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

The App type represents a command-line application.

func New

func New(opts ...Option) *App

New creates a new command-line application with no action. Metadata such as name, version etc. are set by default.

func (*App) Run

func (a *App) Run() error

Run the application.

type Option

type Option func(app *cli.App)

The Option type is a function that can apply configuration to the command-line application.

func WithFlags

func WithFlags(flags ...flag.Flag) Option

WithFlags sets command-line flags that can be applied before Run is called.

func WithRunner

func WithRunner(run RunFunc) Option

WithRunner sets the action function to be used by the command-line application when Run is called.

type RunFunc

type RunFunc func(ctx context.Context) error

The RunFunc type describes a method invoked to start a cli command.

Jump to

Keyboard shortcuts

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