woof
v0.4.1
Published
๐ถ command line applications made as easy as fetch
Downloads
49
Readme
Installation
npm install woof
Usage
const cli = woof(`
Usage
$ foo <input>
Commands:
start, -s Starts foo!
compile, -c Compile foo!
Options
--rainbow, -r Include a rainbow
--unicorn, -u [type] Include a unicorn [rainbow|sea]
Examples
$ foo unicorns --rainbow
๐ unicorns ๐
$ foo --unicorn rainbow
๐ ๐ฆ ๐
$ foo --unicorn sea
๐ ๐ฆ ๐
`, {
commands: {
start: {
alias: 's'
},
compile: {
alias: 'c'
}
},
flags: {
rainbow: {
type: 'boolean',
alias: 'r'
},
unicorn: {
type: 'string',
alias: 'u',
default: 'rainbow',
validate: function (value) {
return ['rainbow', 'sea'].indexOf(value) === -1 ? `please providate a valid unicorn type (rainbow|sea), '${value}' is not a valid option` : true
}
}
}
});
console.log(cli);