flags

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: MPL-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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.: 'wtf -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"`
}

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) HasConfig

func (flags *Flags) HasConfig() bool

HasConfig 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(version string, 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