cmd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Root = NewCmd()

Functions

func AutoConfigAndExit

func AutoConfigAndExit[T any](appName string, saveFn func(savedConfig *T)) *T

AutoConfigAndExit try to load saved config, then return it or use 'saveFn' to update and save it to disk. In update mode, this function will not return to its caller.

func InstallAndExit

func InstallAndExit()

Types

type Cmd

type Cmd struct {
	Use   string
	Short string
	Long  string
	// contains filtered or unexported fields
}

func NewCmd

func NewCmd() *Cmd

func (*Cmd) Flags

func (c *Cmd) Flags() *FlagSet

func (*Cmd) Run

func (c *Cmd) Run(r func(args []string) error)

type FlagSet

type FlagSet = pflag.FlagSet

Jump to

Keyboard shortcuts

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