File: help.js

package info (click to toggle)
node-yargs 10.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,428 kB
  • sloc: makefile: 4; sh: 2
file content (27 lines) | stat: -rw-r--r-- 623 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);