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

Parsing of arguments on tiny CLI script could be better #7

Open
Tenzer opened this issue Jun 9, 2012 · 1 comment
Open

Parsing of arguments on tiny CLI script could be better #7

Tenzer opened this issue Jun 9, 2012 · 1 comment

Comments

@Tenzer
Copy link
Contributor

Tenzer commented Jun 9, 2012

There are two issues I haven't figured out how to solve properly in your code:

  1. If the tiny script is ran without any arguments, the program doesn't output anything and never exits. It would probably be better if it had a fallback to running usage() if no other operation has been requested.
  2. Writing multiple arguments together to ie. -dp will cause the program to just exit right away, and not do anything. I can't help but think using some other node module for parsing the arguments would make it much easier, instead of reinventing the wheel. That would of course introduce another dependency though.
@chjj
Copy link
Owner

chjj commented Jun 10, 2012

You're right. It might be smart to start using commander or optimist for argument parsing.

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