UNPKG

674 BJavaScriptView Raw
1'use strict';
2
3// Importing modules.
4const program = require('commander');
5const processor = require('./processor');
6
7// Parses and processes command line arguments.
8module.exports = (version, args) => {
9 // Setup.
10 program
11 .version(version)
12 .usage("[options] passwordfile realm username")
13 .option('-c, --create', "Create a new file.");
14
15 // Help option.
16 program.on('--help', () => {
17 console.log(`
18 Examples:
19
20 htdigest [-c] passwordfile realm username
21
22 `);
23 });
24
25 // Parse options.
26 program.parse(args);
27
28 // Process program output.
29 processor.exec(program);
30};
\No newline at end of file