tiny icon indicating copy to clipboard operation
tiny copied to clipboard

Parsing of arguments on tiny CLI script could be better

Open Tenzer opened this issue 12 years ago • 1 comments

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.

Tenzer avatar Jun 09 '12 10:06 Tenzer

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

chjj avatar Jun 10 '12 18:06 chjj