Not all applications use log or want to exit if Parse
fails. I'd say that Parse
should return an error. Unfortunately, this would mean changing the public API, which is a non-starter.
How would you feel about exposing (say) ParseEnv
, which returns an error? (Exposing ParseEnv
could just consist of renaming parse
to ParseEnv
.) And maybe at the same time deprecate Parse
?
On the topic of public APIs, it might be nice to add a ParseFlagSet
, which takes in a FlagSet
(rather than just using the default) and returns an error.
I'm happy to send in a PR for one or both of these, if the idea is welcome. We need at least the former.