1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-01 07:27:19 -04:00
notes/node_modules/yargs/example/count.js

16 lines
495 B
JavaScript
Raw Normal View History

2017-03-09 13:16:08 -05:00
#!/usr/bin/env node
var argv = require('yargs')
.count('verbose')
.alias('v', 'verbose')
.argv;
VERBOSE_LEVEL = argv.verbose;
function WARN() { VERBOSE_LEVEL >= 0 && console.log.apply(console, arguments); }
function INFO() { VERBOSE_LEVEL >= 1 && console.log.apply(console, arguments); }
function DEBUG() { VERBOSE_LEVEL >= 2 && console.log.apply(console, arguments); }
WARN("Showing only important stuff");
INFO("Showing semi-important stuff too");
DEBUG("Extra chatty mode");