Skip to content

thetutlage/nut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

help screen for info command

./index.js help download

help screen for download command

./index.js help

help screen

./index.js download jquery --path "/Users/harmindervirk/"

help screen

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published