app

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package app provides functions for creating command-line applications

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 returns a new App that functions as a command-line application configured via the provided Option functions.

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