flag

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(name string, value bool, usage string, envKey string) *bool

Bool is a similar to flag.Bool but it also parse value from specified environment variable when the parameter was not provided explicitly on command line argument. Environment variables are ignored when the given envKey is an empty string.

func DumpAll

func DumpAll(ctx context.Context)

func Float64 added in v0.58.2

func Float64(name string, value float64, usage string, envKey string) *float64

Float64 is similar to flag.Float64 but it also parses value from specified environment variable when the parameter was not provided explicitly on command line argument. Environment variables are ignored when the given envKey is an empty string.

func Int

func Int(name string, value int, usage string, envKey string) *int

Int is a similar to flag.Int but it also parse value from specified environment variable when the parameter was not provided explicitly on command line argument. Environment variables are ignored when the given envKey is an empty string.

func Parse

func Parse() error

func Parsed

func Parsed() bool

func PrintDefaults

func PrintDefaults()

func Reset

func Reset()

func String

func String(name string, value string, usage string, envKey string) *string

String is a similar to flag.String but it also parse value from specified environment variable when the parameter was not provided explicitly on command line argument. Environment variables are ignored when the given envKey is an empty string.

Types

type FlagParser

type FlagParser func() error

type FlagValueDumper

type FlagValueDumper func() string

Jump to

Keyboard shortcuts

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