Closed ebati closed 4 years ago
I updated the PR, added test with pflag.FlagSet
but did not modify ffcli
. Should ffcli
also need to allow multiple FlagSet implementations?
Should
ffcli
also need to allow multiple FlagSet implementations?
I guess it should be as simple as swapping *flag.FlagSet
for ff.FlagSet
, right? If so, yes please 👍
The usage func is set in parse (c.FlagSet.Usage = func (){...}
) so I couldn't swap types.
Functions below are also not in FlagSet definition but we can add them:
FlagSet methods have the same function signatures as flag.FlagSet, so flag.FlagSet can be used as FlagSet, for different flag libraries one can implement this interface. As an example AdaptPflag function converts pflag.FlagSet to FlagSet.