EasyEngine / cli-language-compare

Dummy project to compare different programming languages for a CLI project
1 stars 1 forks source link

Nodejs + commander argument handling takes too much efforts #8

Closed harshadyeola closed 6 years ago

harshadyeola commented 10 years ago

When we pass args to command we need to apply checks manually on

# Here we are checking no. of args should not be zero
# but we need to check max no. of args also
if (!pkgs.length) {
  console.error('packages required');
  process.exit(1);
}
rahul286 commented 10 years ago

Did you search for libraries?

There must be other libs to take care of that.

rahul286 commented 10 years ago

See https://www.npmjs.org/package/validator

http://validatejs.org/

Also:

https://nodejsmodules.org/tags/validation https://nodejsmodules.org/tags/sanitize https://nodejsmodules.org/tags/commander

Off-topic: https://www.npmjs.org/package/inquirer (for interactive projects)