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

Can configure option from JSON for more readability #665

Closed
luatnd opened this issue Jul 20, 2017 · 1 comment
Closed

Can configure option from JSON for more readability #665

luatnd opened this issue Jul 20, 2017 · 1 comment

Comments

@luatnd
Copy link

luatnd commented Jul 20, 2017

Hi,
I feel that this commander.js is the best cli parser I found. I choose it to develop my small cli app.
But when I start to use it while reading its docs, it take me 2 times to find the <> [] syntax, but still missing the -no- syntax explanation.
So I've made a configure() that port to option() for an easy work:

JSON config --> configure() --> option()
It look like this, please tell me if you think it's good, I'll submit this code, hope this help:

image

And it still have some issue:
#601 Adding support for required arguments
#230 Required arguments for options and commands are not enforced
#574 Defining boolean options via Command#option() defaults to undefined, not false


For further refactoring, In my opinion, I think these features might good:
• Validation value
• Change parseOptions() behavior: It check through the argv's option only, so every option defined but not in argv was not be checked for default value.
• Typescript

Thanks.

@roman-vanesyan
Copy link
Collaborator

Hello there! Really thanks for your interesting in project. While your feature is good, we'd prefer to keep commander's API small and consistent and sure easily to create high-level wrappers on top of it, means we are beside of opinionated decisions like this :-)

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

No branches or pull requests

2 participants