flag

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flag

type Flag interface {
	// Add flags to the command.
	AddFlags(cmd *cobra.Command)

	// Validate values set to flags.
	Validate() error
}

Flag is the interface that handles command line options.

type FlagSet

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

FlagSet is the collection of flags to be set to the command.

func NewFlagSet

func NewFlagSet(args ...Flag) *FlagSet

Create a new flag collection.

func (*FlagSet) AddAllFlags

func (s *FlagSet) AddAllFlags(cmd *cobra.Command)

Add flags to the command.

func (*FlagSet) ValidateAll

func (s *FlagSet) ValidateAll() error

Validate all flags.

type MinElevationFlags

type MinElevationFlags struct {
	MinElevation float64
}

func NewMinElevationFlags

func NewMinElevationFlags() *MinElevationFlags

Create a new MinElevationFlags with default values set.

func (*MinElevationFlags) AddFlags

func (f *MinElevationFlags) AddFlags(cmd *cobra.Command)

Add flags to the command.

func (*MinElevationFlags) Validate

func (f *MinElevationFlags) Validate() error

Validate flag values.

type OutputFormatFlags

type OutputFormatFlags struct {
	Format string
}

func NewOutputFormatFlags

func NewOutputFormatFlags() *OutputFormatFlags

Create a new OutputFormatFlags with default values set.

func (*OutputFormatFlags) AddFlags

func (f *OutputFormatFlags) AddFlags(cmd *cobra.Command)

Add flags to the command.

func (*OutputFormatFlags) ToPrinter

func (f *OutputFormatFlags) ToPrinter() printer.Printer

Return a Printer corresponding to the output format.

func (*OutputFormatFlags) Validate

func (f *OutputFormatFlags) Validate() error

Validate flag values.

type PassRangeFlags

type PassRangeFlags struct {
	AOSAfter       time.Time
	AOSBefore      time.Time
	DurationInDays uint8

	// Maximum duration in days used in the validation.
	MaxDurationInDays uint8
	// contains filtered or unexported fields
}

func NewPassRangeFlags

func NewPassRangeFlags() *PassRangeFlags

Create a new PassRangeFlags with default values set.

func (*PassRangeFlags) AddFlags

func (f *PassRangeFlags) AddFlags(cmd *cobra.Command)

Add flags to the command.

func (*PassRangeFlags) Validate

func (f *PassRangeFlags) Validate() error

Validate flag values.

type UWRangeFlags

type UWRangeFlags struct {
	StartTime      time.Time
	EndTime        time.Time
	DurationInDays uint16

	// Maximum duration in days used in the validation.
	MaxDurationInDays uint16
	// contains filtered or unexported fields
}

func NewUWRangeFlags

func NewUWRangeFlags() *UWRangeFlags

Create a new UWRangeFlags with default values set.

func (*UWRangeFlags) AddFlags

func (f *UWRangeFlags) AddFlags(cmd *cobra.Command)

Add flags to the command.

func (*UWRangeFlags) Validate

func (f *UWRangeFlags) Validate() error

Validate flag values.

Jump to

Keyboard shortcuts

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