cli

package
v6.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeepStringMap

type DeepStringMap struct {
	// contains filtered or unexported fields
}

DeepStringMap implements the Value and ValueCreator interfaces for nested string maps.

func (DeepStringMap) Create

func (d DeepStringMap) Create(
	v map[string]map[string]string,
	p *map[string]map[string]string,
	_ DeepStringMapConfig,
) cli.Value

Create implements the ValueCreator interface.

func (*DeepStringMap) Get

func (d *DeepStringMap) Get() any

Get implements the flag.Value interface.

func (*DeepStringMap) Set

func (d *DeepStringMap) Set(v string) error

Set implements the flag.Value interface. Valid nested JSON objects are parsed directly. JSON values that are not strings (numbers, booleans, null) are coerced to their string representations. Flat (non-nested) JSON objects are stored under the "*" key with the same coercion applied. Input that is not valid JSON returns an error.

func (*DeepStringMap) String

func (d *DeepStringMap) String() string

String implements the flag.Value interface.

func (DeepStringMap) ToString

func (d DeepStringMap) ToString(v map[string]map[string]string) string

ToString implements the ValueCreator interface.

type DeepStringMapConfig

type DeepStringMapConfig struct {
}

DeepStringMapConfig defines the configuration for deep string map flags.

type DeepStringMapFlag

type DeepStringMapFlag = cli.FlagBase[map[string]map[string]string, DeepStringMapConfig, DeepStringMap]

DeepStringMapFlag is a flag type which supports nested JSON string maps.

type Int

type Int struct {
	// contains filtered or unexported fields
}

Int implements the Value and ValueCreator interfaces for integers.

func (Int) Create

func (i Int) Create(v int, p *int, _ IntConfig) cli.Value

Create implements the ValueCreator interface.

func (*Int) Get

func (i *Int) Get() any

Get implements the flag.Value interface.

func (*Int) Set

func (i *Int) Set(v string) error

Set implements the flag.Value interface.

func (*Int) String

func (i *Int) String() string

String implements the flag.Value interface.

func (Int) ToString

func (i Int) ToString(v int) string

ToString implements the ValueCreator interface.

type IntConfig

type IntConfig struct {
}

IntConfig defines the configuration for integer flags.

type IntFlag deprecated

type IntFlag = cli.FlagBase[int, IntConfig, Int]

IntFlag is a flag type which supports integer values.

Deprecated: Use cli.IntFlag instead.

type Map

type Map struct {
	// contains filtered or unexported fields
}

Map implements the Value and ValueCreator interfaces for strict JSON maps.

func (Map) Create

func (m Map) Create(v map[string]string, p *map[string]string, _ MapConfig) cli.Value

Create implements the ValueCreator interface.

func (*Map) Get

func (m *Map) Get() any

Get implements the flag.Value interface.

func (*Map) Set

func (m *Map) Set(v string) error

Set implements the flag.Value interface.

func (*Map) String

func (m *Map) String() string

String implements the flag.Value interface.

func (Map) ToString

func (m Map) ToString(v map[string]string) string

ToString implements the ValueCreator interface.

type MapConfig

type MapConfig struct {
}

MapConfig defines the configuration for map flags.

type MapFlag

type MapFlag = cli.FlagBase[map[string]string, MapConfig, Map]

MapFlag is a flag type which requires valid JSON string maps.

type StringMap

type StringMap struct {
	// contains filtered or unexported fields
}

StringMap implements the Value and ValueCreator interfaces for string maps.

func (StringMap) Create

func (s StringMap) Create(v map[string]string, p *map[string]string, _ StringMapConfig) cli.Value

Create implements the ValueCreator interface.

func (*StringMap) Get

func (s *StringMap) Get() any

Get implements the flag.Value interface.

func (*StringMap) Set

func (s *StringMap) Set(v string) error

Set implements the flag.Value interface. JSON values that are not strings (numbers, booleans, null) are coerced to their string representations. Input that is not valid JSON at all is stored as-is under the "*" key. Set intentionally never returns errors.

func (*StringMap) String

func (s *StringMap) String() string

String implements the flag.Value interface.

func (StringMap) ToString

func (s StringMap) ToString(v map[string]string) string

ToString implements the ValueCreator interface.

type StringMapConfig

type StringMapConfig struct {
}

StringMapConfig defines the configuration for string map flags.

type StringMapFlag

type StringMapFlag = cli.FlagBase[map[string]string, StringMapConfig, StringMap]

StringMapFlag is a flag type which supports JSON string maps.

type StringSlice

type StringSlice struct {
	// contains filtered or unexported fields
}

StringSlice implements the Value and ValueCreator interfaces for string slices.

func (StringSlice) Create

func (s StringSlice) Create(v []string, p *[]string, c StringSliceConfig) cli.Value

Create implements the ValueCreator interface.

func (*StringSlice) Get

func (s *StringSlice) Get() any

Get implements the flag.Value interface.

func (*StringSlice) Set

func (s *StringSlice) Set(v string) error

Set implements the flag.Value interface.

func (*StringSlice) String

func (s *StringSlice) String() string

String implements the flag.Value interface.

func (StringSlice) ToString

func (s StringSlice) ToString(v []string) string

ToString implements the ValueCreator interface.

type StringSliceConfig

type StringSliceConfig struct {
	Delimiter    string
	EscapeString string
}

StringConfig defines the configuration for string flags.

type StringSliceFlag

type StringSliceFlag = cli.FlagBase[[]string, StringSliceConfig, StringSlice]

StringSliceFlag is a flag type which support comma separated values and escaping to not split at unwanted lines.

Jump to

Keyboard shortcuts

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