cliflag

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cliflag extends flagset with environment variable defaults.

Usage:

cliflag.String(root.Flags(), &address, "address", "a", "CODER_ADDRESS", "127.0.0.1:3000", "The address to serve the API and dashboard")

Will produce the following usage docs:

-a, --address string              The address to serve the API and dashboard (uses $CODER_ADDRESS). (default "127.0.0.1:3000")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolVarP

func BoolVarP(flagset *pflag.FlagSet, ptr *bool, name string, shorthand string, env string, def bool, usage string)

BoolVarP sets a bool flag on the given flag set.

func DurationVarP added in v0.6.0

func DurationVarP(flagset *pflag.FlagSet, ptr *time.Duration, name string, shorthand string, env string, def time.Duration, usage string)

DurationVarP sets a time.Duration flag on the given flag set.

func String added in v0.5.2

func String(flagset *pflag.FlagSet, name, shorthand, env, def, usage string)

String sets a string flag on the given flag set.

func StringArrayVarP added in v0.4.4

func StringArrayVarP(flagset *pflag.FlagSet, ptr *[]string, name string, shorthand string, env string, def []string, usage string)

func StringVarP

func StringVarP(flagset *pflag.FlagSet, p *string, name string, shorthand string, env string, def string, usage string)

StringVarP sets a string flag on the given flag set.

func Uint8VarP

func Uint8VarP(flagset *pflag.FlagSet, ptr *uint8, name string, shorthand string, env string, def uint8, usage string)

Uint8VarP sets a uint8 flag on the given flag set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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