Documentation ¶
Index ¶
- type Map
- func (m *Map) Add(pos *counters.Conditional, name, short, long string, typ types.ArgTypes, ...) error
- func (m *Map) Count() int
- func (m *Map) CountPositionalArgs() (count int)
- func (m *Map) FindDuplicates() error
- func (m *Map) Get(name *string) *descriptor.Descriptor
- func (m *Map) GetByLong(token *string) (*string, *descriptor.Descriptor)
- func (m *Map) GetByName(token *string) (*string, *descriptor.Descriptor)
- func (m *Map) GetByPosition(position int) (*string, *descriptor.Descriptor)
- func (m *Map) GetByShort(token *string) (*string, *descriptor.Descriptor)
- func (m *Map) List() map[string]descriptor.Descriptor
- func (m *Map) ListPositionalArgs(format string) (result []any)
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) CountPositionalArgs ¶
CountPositionalArgs - return a count of positional arguments
func (*Map) FindDuplicates ¶
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 ¶
ListPositionalArgs - return a formatted string list of positional arguments (name, type, help string)
Source Files ¶
- Descriptor.CountPositionalArgs.go
- Descriptor.GetByLong.go
- Descriptor.GetByName.go
- Descriptor.GetByPosition.go
- Descriptor.GetByShort.go
- Descriptor.ListPositionalArgs.go
- Descriptor.Map.Add.go
- Descriptor.Map.Count.go
- Descriptor.Map.FindDuplicates.go
- Descriptor.Map.Get.go
- Descriptor.Map.List.go
- Descriptor.Map.go
- constants.go