cliflags

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandlePackOption

func HandlePackOption()

HandlePackOption will execute the logic necessary for `./probr run <PACK>`

func HandleRequestForRequiredVars

func HandleRequestForRequiredVars()

HandleRequestForRequiredVars will execute the logic for `./probr show-requirements (<PACK>)`

func LoglevelHandler

func LoglevelHandler(v *string)

LoglevelHandler validates provided value is a known loglevel and sets loglevel accordingly TODO: does this still work with our new logger?

func ResultsformatHandler

func ResultsformatHandler(v *string)

ResultsformatHandler parses a flag and sets the godog output type

func TagsHandler

func TagsHandler(v *string)

TagsHandler parses a flag and sets the godog/cucumber tags

func VarsFileHandler

func VarsFileHandler(v *string)

VarsFileHandler initializes configuration with VarsFile overriding env vars & defaults

func WriteDirHandler

func WriteDirHandler(v *string)

WriteDirHandler changes the root output directory

Types

type BoolFlag

type BoolFlag struct {
	Name    string
	Handler boolHandlerFunc
	Value   *bool
}

BoolFlag holds the user-provided value for the flag, and the function to be run within executeHandler

type Flag

type Flag interface {
	// contains filtered or unexported methods
}

Flag allows for different value types to be handled

type Flags

type Flags struct {
	PreParsedFlags []Flag
}

Flags allows for the gathering all flag definitions and executing them together

func (*Flags) ExecuteHandlers

func (flags *Flags) ExecuteHandlers()

ExecuteHandlers executes the logic for any flags that are provided via `./probr (--<FLAG>)`

func (*Flags) NewBoolFlag

func (flags *Flags) NewBoolFlag(name string, usage string, handler boolHandlerFunc)

NewBoolFlag creates a new flag that accepts bool values

func (*Flags) NewStringFlag

func (flags *Flags) NewStringFlag(name string, usage string, handler stringHandlerFunc)

NewStringFlag creates a new flag that accepts string values

type StringFlag

type StringFlag struct {
	Name    string
	Handler stringHandlerFunc
	Value   *string
}

StringFlag holds the user-provided value for the flag, and the function to be run within executeHandler

Jump to

Keyboard shortcuts

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