flagutil

package
v1.35.3-cluster Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: Apache-2.0 Imports: 4 Imported by: 43

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array []string

Array is a flag that holds an array of values.

It may be set either by specifying multiple flags with the given name passed to NewArray or by joining flag values by comma.

The following example sets equivalent flag array with two items (value1, value2):

-foo=value1 -foo=value2
-foo=value1,value2

Flag values may be quoted. For instance, the following arg creates an array of ("a", "b, c") items:

-foo='a,"b, c"'

func NewArray added in v1.34.0

func NewArray(name, description string) *Array

NewArray returns new Array with the given name and description.

func (*Array) GetOptionalArg added in v1.35.3

func (a *Array) GetOptionalArg(argIdx int) string

GetOptionalArg returns optional arg under the given argIdx.

func (*Array) Set

func (a *Array) Set(value string) error

Set implements flag.Value interface

func (*Array) String

func (a *Array) String() string

String implements flag.Value interface

Jump to

Keyboard shortcuts

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