flags

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MPL-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EXTRA = `` /* 338-byte string literal not displayed */

Functions

This section is empty.

Types

type Flags

type Flags struct {
	Config  string `short:"c" long:"config" optional:"yes" description:"Path to config file"`
	Module  string `short:"m" long:"module" optional:"yes" description:"Display info about a specific module, i.e.: 'wtfutil -m=todo'"`
	Profile bool   `short:"p" long:"profile" optional:"yes" description:"Profile application memory usage"`
	Version bool   `short:"v" long:"version" description:"Show version info"`
	// Work-around go-flags misfeatures. If any sub-command is defined
	// then `wtf` (no sub-commands, the common usage), is warned about.
	Opt struct {
		Cmd  string   `positional-arg-name:"command"`
		Args []string `positional-arg-name:"args"`
	} `positional-args:"yes"`
	// contains filtered or unexported fields
}

Flags is the container for command line flag data

func NewFlags

func NewFlags() *Flags

NewFlags creates an instance of Flags

func (*Flags) ConfigFilePath

func (flags *Flags) ConfigFilePath() string

ConfigFilePath returns the path to the currently-loaded config file

func (*Flags) HasCustomConfig added in v0.19.0

func (flags *Flags) HasCustomConfig() bool

HasCustomConfig returns TRUE if a config path was passed in, FALSE if one was not

func (*Flags) HasModule

func (flags *Flags) HasModule() bool

HasModule returns TRUE if a module name was passed in, FALSE if one was not

func (*Flags) HasVersion

func (flags *Flags) HasVersion() bool

HasVersion returns TRUE if the version flag was passed in, FALSE if it was not

func (*Flags) Parse

func (flags *Flags) Parse()

Parse parses the incoming flags

func (*Flags) RenderIf added in v0.14.0

func (flags *Flags) RenderIf(config *config.Config)

RenderIf displays special-case information based on the flags passed in, if any flags were passed in

Jump to

Keyboard shortcuts

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