tiny
tiny copied to clipboard
Parsing of arguments on tiny CLI script could be better
There are two issues I haven't figured out how to solve properly in your code:
- 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 runningusage()
if no other operation has been requested. - 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.
You're right. It might be smart to start using commander or optimist for argument parsing.