cli

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 21 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Home

func Home() fsdir.T

Home returns the fsdir of the home directory of this component.

func LoadKey

func LoadKey(fm fsdir.T, p ...string) (key ed25519.PrivateKey, err error)

func RunChild

func RunChild(args ...string) (err error)

func SignalLoop

func SignalLoop(hs SignalMap)

func UnpackEmbedded

func UnpackEmbedded(f embed.FS, fm fsdir.T, force bool) error

Unpack go v1.16 embedded FS contents to disk.

Types

type CLI

type CLI struct {
	Subcmds  []*Subcmd
	Sections []Section
}

func (CLI) Parse

func (c CLI) Parse(args []string) *Subcmd

func (CLI) Usage

func (c CLI) Usage()

type Entry

type Entry struct{ Key, Value string }

type Section

type Section struct {
	Title   string
	Entries []Entry
}

type SignalMap

type SignalMap map[os.Signal]func() bool

type Subcmd

type Subcmd struct {
	*flag.FlagSet
	io.Writer

	Desc     string
	Usage    func()
	Run      func(fsdir.T)
	Sections []Section
	Hidden   bool
	// contains filtered or unexported fields
}

func (*Subcmd) Output

func (sub *Subcmd) Output() io.Writer

func (*Subcmd) SetDefaultUsage

func (sub *Subcmd) SetDefaultUsage()

func (*Subcmd) SetMinimalUsage

func (sub *Subcmd) SetMinimalUsage(example string)

Directories

Path Synopsis
commonsub
Package fsdir provides an abstract interface to a directory on disk.
Package fsdir provides an abstract interface to a directory on disk.

Jump to

Keyboard shortcuts

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