descriptormap

package
v2.0.0-...-4b7107c Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

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

Map - map of descriptors (name:descriptor)

func (*Map) Add

func (m *Map) Add(pos *counters.Conditional, name, short, long string, typ types.ArgTypes,
	required bool, dValue any, help string) error

Add - Add the new descriptor to the descriptor map

func (*Map) Count

func (m *Map) Count() int

Count - return a count of argument descriptors

func (*Map) CountPositionalArgs

func (m *Map) CountPositionalArgs() (count int)

CountPositionalArgs - return a count of positional arguments

func (*Map) FindDuplicates

func (m *Map) FindDuplicates() error

FindDuplicates - find any duplicate arguments and throw and error

func (*Map) Get

func (m *Map) Get(name *string) *descriptor.Descriptor

Get - Given an argument name, return its descriptor

func (*Map) GetByLong

func (m *Map) GetByLong(token *string) (*string, *descriptor.Descriptor)

GetByLong - perform a linear search of the descriptor map for a matching Long arg

func (*Map) GetByName

func (m *Map) GetByName(token *string) (*string, *descriptor.Descriptor)

GetByName - search the descriptor map for a token with the given *token name

func (*Map) GetByPosition

func (m *Map) GetByPosition(position int) (*string, *descriptor.Descriptor)

GetByPosition - given a position, return the descriptor name and object

func (*Map) GetByShort

func (m *Map) GetByShort(token *string) (*string, *descriptor.Descriptor)

GetByShort - perform a linear search of the descriptor map for a matching short arg

func (*Map) List

func (m *Map) List() map[string]descriptor.Descriptor

List - return the descriptor map

func (*Map) ListPositionalArgs

func (m *Map) ListPositionalArgs(format string) (result []any)

ListPositionalArgs - return a formatted string list of positional arguments (name, type, help string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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