cli

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: BSD-3-Clause Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(path string) bool

func Version

func Version() string

Version returns a version string. If the version variable in this package was set to a non-empty string by the linker, Version returns that. Otherwise, if build information is available via debug.ReadBuildInfo, Version returns debug.Buildinfo.Main.Version. Otherwise, Version returns "unknown".

Types

type Flags

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

func (*Flags) Init

func (f *Flags) Init(all ...Initializer) (context.Context, context.CancelFunc, error)

Init is equivalent to InitWithSignals with SIGINT, SIGPIPE, and SIGTERM.

func (*Flags) InitWithSignals added in v1.8.0

func (f *Flags) InitWithSignals(all []Initializer, signals ...os.Signal) (context.Context, context.CancelFunc, error)

InitWithSignals handles the flags defined in SetFlags, calls the Init method for each element of all, and returns a context canceled when any signal in signals is raised.

func (*Flags) SetFlags

func (f *Flags) SetFlags(fs *flag.FlagSet)

type Initializer

type Initializer interface {
	Init() error
}

Jump to

Keyboard shortcuts

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