flags

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FlagDebug = NewBoolFlag(
		configuration.DEBUG,
		false,
		"",
	)
	FlagAppVulns = NewBoolFlag(
		"app-vulns",
		false,
		"enable app-vulns (deprecated, as this is the default value)",
	)
	FlagExcludeAppVulns = NewBoolFlag(
		"exclude-app-vulns",
		false,
		"disable app-vulns",
	)
	FlagSbomFormat = NewShortHandStringFlag(
		"format",
		"f",
		"",
		fmt.Sprintf("Specify the SBOM output format. %s", constants.SbomValidFormats),
	)
)

Functions

This section is empty.

Types

type BaseFlag

type BaseFlag struct {
	Name    string
	FlagSet *pflag.FlagSet
}

func InitBaseFlag

func InitBaseFlag(name string) *BaseFlag

func (BaseFlag) GetFlagSet

func (b BaseFlag) GetFlagSet() *pflag.FlagSet

type BoolFlag

type BoolFlag struct {
	*BaseFlag
}

func NewBoolFlag

func NewBoolFlag(name string, defaultValue bool, usage string) *BoolFlag

func NewShortHandBoolFlag

func NewShortHandBoolFlag(name string, shorthand string, defaultValue bool, usage string) *BoolFlag

func (*BoolFlag) GetAsCLIArgument

func (f *BoolFlag) GetAsCLIArgument(c configuration.Configuration) string

func (*BoolFlag) GetFlagValue

func (f *BoolFlag) GetFlagValue(c configuration.Configuration) bool

type Flag

type Flag interface {
	GetFlagSet() *pflag.FlagSet
	GetAsCLIArgument(configuration.Configuration) string
}

type StringFlag

type StringFlag struct {
	*BaseFlag
}

func NewShortHandStringFlag

func NewShortHandStringFlag(name string, shorthand string, defaultValue string, usage string) *StringFlag

func NewStringFlag

func NewStringFlag(name string, defaultValue string, usage string) *StringFlag

func (*StringFlag) GetAsCLIArgument

func (f *StringFlag) GetAsCLIArgument(c configuration.Configuration) string

func (*StringFlag) GetFlagValue

func (f *StringFlag) GetFlagValue(c configuration.Configuration) string

Jump to

Keyboard shortcuts

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