cmd

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commons

type Commons struct {
	Development bool   `short:"D" env:"DEBUG,DEV,DEVELOPMENT" help:"Enable development mode"`
	Level       string `short:"l" env:"LOG_LEVEL" help:"Set the logging level (debug|info|warn|error|fatal)" default:"info"`

	Version Version `cmd:"" help:"Print version information and quit."`
	Licence Licence `cmd:"" help:"Print licence of the application."`
}

func (*Commons) Logger

func (g *Commons) Logger() (*zap.Logger, error)

type Licence

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

Licence represent a license with its content. It is not possible to use another primitive (like string) because kong will not recognize the licence command

func NewLicence

func NewLicence(s string) Licence

func (Licence) Run

func (l Licence) Run(*kong.Context) (err error)

type Option

type Option func(runner *Runner) error

An Option applies optional changes to the CLI application.

func WithAuthors

func WithAuthors(authors ...string) Option

func WithCommands

func WithCommands(commands interface{}) Option

Read the doc

func WithDescription

func WithDescription(description string) Option

func WithName

func WithName(name string) Option

func WithVersion

func WithVersion(version string) Option

func (Option) Apply

func (o Option) Apply(r *Runner) error

type Runner

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

func New

func New(opts ...Option) *Runner

type Version

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

func NewVersion

func NewVersion(version string, commit string, buildSource string, date string) Version

func (Version) Run

func (u Version) Run(*kong.Context) (err error)

Jump to

Keyboard shortcuts

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