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

few ideas #3

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

few ideas #3

wants to merge 1 commit into from

Conversation

ruyadorno
Copy link
Contributor

No description provided.

@ruyadorno ruyadorno marked this pull request as draft May 13, 2022 14:11
Copy link
Owner

@darcyclarke darcyclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make some changes here to the example - as you mention - & update accordingly. That said, I'll have to think on removing recursive. If we remove that, then I could also likely remove alias & be down to a single config (ie. positionalValues) which is really up for interpretation... we could remove that as well & get to a no-config situation where minargs becomes the MVP (ie. minimum viable parse™️)

Comment on lines +46 to 50
🤔 Is `recursive` really essential? it seems to me that it can be fairly
trivial for the user to be recursively parsing the remainder in case they need
it, IMO having in mind a lib that strives to be minimal, this part can be
removed for the sake of simplicity.

Copy link
Owner

@darcyclarke darcyclarke May 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally had this removed as you're right that it is trivial to add (although it's definitely nice to have baked in & is consistent with what we've done for functions like mkdir/rmdir)

Comment on lines +103 to +109
🤔 I'm confused with the returned value of this example here since it seems to
conflict a bit with the statement above:

> The `type` `"value"` will only ever be defined -- in place of `"positional"` -- when `positionalValues=true`

What "type value" is this referring to? is it `argv`'s `value` property? Or
maybe it's a top level property that will replace `positional`?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I think this example needs to be updated. The first parsed element is a positional - without a value (and that's not shown here). I'll update this.

Comment on lines 345 to +346
* `--foo` will parse to `{ args: { "foo": [""] } }` & `--foo=true` to ` { args: { "foo": ["true"] } }` respectively
🙏
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope this emoji means this is a good thing? Not coercing/inferring types is a big part of this approach.

Comment on lines 378 to +379
* `--number -2` will be parsed as `{ args: { "number": [""], "2": [""] } }`
👍
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed - unquoted values shouldn't be parsed as values if they start with -. It's pretty straightforward.

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

Successfully merging this pull request may close these issues.

2 participants