mirror of
https://github.com/thangisme/notes.git
synced 2026-06-11 09:49:21 -04:00
Initial commit
This commit is contained in:
26
node_modules/yargs/example/implies_hash.js
generated
vendored
Normal file
26
node_modules/yargs/example/implies_hash.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var argv = require('yargs')
|
||||
.usage('Usage: $0 -x [num] -y [num] -w [msg] -h [msg]')
|
||||
.implies({
|
||||
x: 'y',
|
||||
w: '--no-h',
|
||||
1: 'h'
|
||||
})
|
||||
.argv;
|
||||
|
||||
if (argv.x) {
|
||||
console.log('x / y : ' + (argv.x / argv.y));
|
||||
}
|
||||
|
||||
if (argv.y) {
|
||||
console.log('y: ' + argv.y);
|
||||
}
|
||||
|
||||
if (argv.w) {
|
||||
console.log('w: ' +argv.w);
|
||||
}
|
||||
|
||||
if (argv.h) {
|
||||
console.log('h: ' +argv.h);
|
||||
}
|
||||
Reference in New Issue
Block a user