nut-cli
v0.0.2
Published
Nut is an ultimate nodejs command line arguments manager,it helps you in setting up help menu and listen to user arguments in a linear fashion
Downloads
19
Maintainers
Readme
nut
Nut is an ultimate nodejs command line arguments manager,it helps you in setting up help menu and listen to user arguments in a linear fashion
Example
#!/usr/bin/env node
var nut = require('nut-cli');
// Your app command eg bower
nut.bootCommand('gitHut');
nut.addCommand('download','[repo:String]','Enter repo name you want to download');
nut.addCommand('info','[repo:String]','Enter repo info');
nut.addCommand('whoami',false,'Find who you are on gitHut');
nut.addCommandOptions('download','--path','[<path/from/cwd>:Path]','Enter path where you want to save this repo');
nut.addCommandOptions('info','--long','[<Boolean>:Boolean]','Will show complete descriptions');
var commands = nut.parse();
console.log(commands);
Above example will help you in registering 3 simple commands with options.Below is the usage guide.
./index.js help info
./index.js help download
./index.js help
./index.js download jquery --path "/Users/harmindervirk/"