integrii / flaggy

Idiomatic Go input parsing with subcommands, positional values, and flags at any position. No required project or package layout and no external dependencies.
The Unlicense
858 stars 30 forks source link

Generic flag parser with many more flag types supported #8

Closed integrii closed 6 years ago

integrii commented 6 years ago

This is a major refactor to the flag parser to enable multiple-use flags #3 and a generic flag parser backed by a type switch for specific conversions #7.

In addition, flaggy now supports 35 different flag types!

string
[]string
bool
[]bool
time.Duration
[]time.Duration
float32
[]float32
float64
[]float64
uint
uint64
[]uint64
uint32
[]uint32
uint16
[]uint16
uint8
[]uint8
[]byte
int
[]int
int64
[]int64
int32
[]int32
int16
[]int16
int8
[]int8
net.IP
[]net.IP
net.HardwareAddr
[]net.HardwareAddr
net.IPMask
[]net.IPMask