forked from yargs/yargs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelp.mjs
More file actions
30 lines (27 loc) · 674 Bytes
/
Copy pathhelp.mjs
File metadata and controls
30 lines (27 loc) · 674 Bytes
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
28
29
30
#!/usr/bin/env node
import yargs from 'yargs';
const argv = yargs(process.argv.slice(2))
.usage('This is my awesome program\n\nUsage: $0 [options]')
.help('help')
.alias('help', 'h')
.version('version', '1.0.1')
.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,
},
})
.parse();
console.log('Inspecting options');
console.dir(argv);
console.log('input:', argv.input);
console.log('output:', argv.output);