Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two properties for parsed options? #13

Closed
shadowspawn opened this issue Nov 14, 2021 · 2 comments
Closed

Two properties for parsed options? #13

shadowspawn opened this issue Nov 14, 2021 · 2 comments

Comments

@shadowspawn
Copy link
Collaborator

The current description has two properties for identified options, and an option with a value appears in both:

args {Object}, having properties and Boolean values corresponding to parsed options passed
values {Object}, have properties and String values corresponding to parsed options passed

I found this a bit unexpected, and unlike what I see in other implementations (Commander, Yargs, et al).

If this a deliberate design decision? I didn't find any discussion that led to this, and don't want to go too deep on commentary if it is a somewhat accidental iteration as functionality has been added!

@bcoe bcoe added question Further information is requested discussion and removed question Further information is requested labels Nov 14, 2021
@bcoe
Copy link
Collaborator

bcoe commented Nov 14, 2021

@shadowspawn If I recall, one of the reason for the two return values, was so that you could differentiate between the case where an option was passed no argument, vs., an option not being set at all.

I think in practice someone would tend to use either args or values, but someone building a more copmlex command line application on top of the parser would be able to look at values vs., `args, and infer more information about what the user provided.

@shadowspawn
Copy link
Collaborator Author

Thanks for recollections. Not convinced yet, but happy to wait and see! (How code develops, what gets stored, what client code looks like.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants