-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: main
Are you sure you want to change the base?
few ideas #3
Conversation
There was a problem hiding this 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™️)
🤔 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. | ||
|
There was a problem hiding this comment.
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
)
🤔 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`? |
There was a problem hiding this comment.
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.
* `--foo` will parse to `{ args: { "foo": [""] } }` & `--foo=true` to ` { args: { "foo": ["true"] } }` respectively | ||
🙏 |
There was a problem hiding this comment.
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.
* `--number -2` will be parsed as `{ args: { "number": [""], "2": [""] } }` | ||
👍 |
There was a problem hiding this comment.
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.
No description provided.