options

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultString = "default string"
	DefaultUint64 = 18446744073709551615
)

Variables

This section is empty.

Functions

func AddString

func AddString(fs *flag.FlagSet, opt *string, short, long, value string)

AddString adds a string option to a flag set

func AddUint64

func AddUint64(fs *flag.FlagSet, opt *uint64, short, long string, value uint64)

AddUint64 adds an uint64 option to a flag set

func CheckString

func CheckString(optionName, value string, err error) error

CheckString checks that a string option has a non-default value

func CheckUint64

func CheckUint64(optionName string, value uint64, err error) error

CheckUint64 checks that an uint64 option has a non-default value

func New

func New(args []string, usage func(), set func(*flag.FlagSet)) *flag.FlagSet

New initializes a flag set using the provided arguments.

  • args should start with the (sub)command's name
  • usage is a function that prints a usage message
  • set is a function that sets the command's flag arguments

Types

This section is empty.

Jump to

Keyboard shortcuts

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