flag

package
v0.0.0-...-05ee0c8 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package flag contains types that represent typed command-line flags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boolean

type Boolean struct {
	Value       bool
	Required    bool
	Hidden      bool
	Destination *bool
	Name        string
	Usage       string
	EnvVar      string
}

The Boolean type represents a command-line flag that is parsed as a boolean value.

func (*Boolean) Unwrap

func (f *Boolean) Unwrap() cli.Flag

Unwrap the Boolean into its cli.Flag equivalent.

type Duration

type Duration struct {
	Name        string
	Usage       string
	Value       time.Duration
	Destination *time.Duration
	EnvVar      string
	Required    bool
	Hidden      bool
}

The Duration type represents a command-line flag that is parsed as a time.Duration value.

func (*Duration) Unwrap

func (f *Duration) Unwrap() cli.Flag

Unwrap the Duration into its cli.Flag equivalent.

type Flag

type Flag interface {
	Unwrap() cli.Flag
}

The Flag interface describes types that can be unwrapped into a cli.Flag implementation.

type Flags

type Flags []Flag

The Flags type is a collection of Flag implementations.

func (Flags) Unwrap

func (f Flags) Unwrap() []cli.Flag

Unwrap all flags in the collection to their cli.Flag equivalents.

type Float64

type Float64 struct {
	Name        string
	Usage       string
	Value       float64
	Destination *float64
	EnvVar      string
	Required    bool
	Hidden      bool
}

The Float64 type represents a command-line flag that is parsed as a float64 value.

func (*Float64) Unwrap

func (f *Float64) Unwrap() cli.Flag

Unwrap the Float64 into its cli.Flag equivalent.

type Int

type Int struct {
	Name        string
	Usage       string
	Value       int
	Destination *int
	EnvVar      string
	Required    bool
	Hidden      bool
}

The Int type represents a command-line flag that is parsed as an integer value.

func (*Int) Unwrap

func (f *Int) Unwrap() cli.Flag

Unwrap the Int into its cli.Flag equivalent.

type String

type String struct {
	Name        string
	Usage       string
	Value       string
	Destination *string
	EnvVar      string
	Required    bool
	Hidden      bool
}

The String type represents a command-line flag that is parsed as a string value.

func (*String) Unwrap

func (f *String) Unwrap() cli.Flag

Unwrap the String into its cli.Flag equivalent.

Jump to

Keyboard shortcuts

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