flag

package
v0.0.0-...-9f7285a Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

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 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