github.com/erikjuhani/miniflag (go): Package miniflag implements command-line flag parsing. miniflag offers minimal API on top of go flag module found in the standard library.  The minimal API is created by using the generics functionality added in 1.18. The main difference between the flag module in standard library and miniflag is that all the flags defined in miniflag are setup using just a single function. For example creating integer and boolean values in standard library requires using two different function calls `Int()` and `Bool()`, whereas in miniflag you only use one `Flag`.  With miniflag shorthands are created as separate flag definitions, but will hold the reference to same variable.  Define flags using miniflag.Flag() or miniflag.SetFlag().  Note: Taken from go flag module in standard library with variation to match miniflag implementation.  This declares an integer flag, -n, stored in the pointer nFlag, with type *int:  Or you can create custom flags that satisfy the Value interface and couple them to flag parsing by:  For such flags, the default value is just the initial value of the variable.  After all flags are defined, call:  to parse the command line into the defined flags.  Flags may then be used directly. All flag values are pointers.  After parsing, the arguments following the flags are available as the slice flag.Args().
Keywords: cli|flags|go|golang-library|no-dependencies