Package Usage: go: github.com/anacrolix/tagflag
Package tagflag uses reflection to derive flags and positional arguments to a
program, and parses and sets them from a slice of arguments.
For example:
Supported tags include:
MarshalArgs is called on fields that implement ArgsMarshaler. A number of
arguments matching the arity of the field are passed if possible.
Slices will collect successive values, within the provided arity constraints.
A few helpful types have builtin marshallers, for example Bytes,
*net.TCPAddr, *url.URL, time.Duration, and net.IP.
Flags are strictly passed with the form -K or -K=V. No space between -K and
the value is allowed. This allows positional arguments to be mixed in with
flags, and prevents any confusion due to some flags occasionally not taking
values. A `--` will terminate flag parsing, and treat all further arguments
as positional.
A builtin help and usage printer are provided, and activated when passing
-h or -help.
Flag and positional argument names are automatically munged to fit the
standard scheme within tagflag.
6 versions
Latest release: over 2 years ago
206 dependent packages
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/github.com/anacrolix/tagflag