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

28 lines
623 B
JavaScript
Raw Normal View History

2017-03-09 13:16:08 -05:00
var yargs = require('../index');
var argv = yargs
.usage('This is my awesome program\n\nUsage: $0 [options]')
.help('help').alias('help', 'h')
.version('1.0.1', 'version').alias('version', 'V')
.options({
input: {
alias: 'i',
description: "<filename> Input file name",
requiresArg: true,
required: true
},
output: {
alias: 'o',
description: "<filename> output file name",
requiresArg: true,
required: true
}
})
.argv;
console.log('Inspecting options');
console.dir(argv);
console.log("input:", argv.input);
console.log("output:", argv.output);