deno.land / x / yargs@v17.6.0-deno / example / count.js

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env nodevar argv = require('yargs/yargs')(process.argv.slice(2)) .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");
yargs

Version Info

Tagged at
a year ago