Description
This repo started out with a plan, which was not immediately clear to new-comers (me!). In trying to clarify the naming, I initiated a change in the results conventions which has not been completed (#12 #22 #23). So let's regroup and get the naming and README and code all in sync again.
Which convention will we use?
- (1) "existence" property in result, which records true for any option used anyhow (and a
values
property) - (2) flags/values with separate results for flags and values
- (3) (combined results is included for comparison with other libraries, not as a contender)
I propose in absence of anyone with strong preference for flags/values that we go back to "existence" conventions. (I think flags/values is perfectly workable, but it was somewhat accidental!)
I wanted to explore what client code would look like for various conventions used in the result of the parse. Here are my client scenarios:
Primary use cases for simple use (no error check because optimistic or strict)
- detect boolean flag used
- detect withValue option used and get value
Other use cases for bring-your-own validation checks:
- detect boolean flag misused
- detect withValue option misused
- detect option used in any form (valid or invalid, whether specified in withValue or not)
These examples include some behaviours which are under discussion or touched on elsewhere (especially the misuse cases #24 and #25). Most are being discussed separately, so please join those discussions rather than comment on special cases here unless it is relevant to your choice of preferred high level convention.