UNPKG

812 BJavaScriptView Raw
1const { Argument } = require('./lib/argument.js');
2const { Command } = require('./lib/command.js');
3const { CommanderError, InvalidArgumentError } = require('./lib/error.js');
4const { Help } = require('./lib/help.js');
5const { Option } = require('./lib/option.js');
6
7exports.program = new Command();
8
9exports.createCommand = (name) => new Command(name);
10exports.createOption = (flags, description) => new Option(flags, description);
11exports.createArgument = (name, description) => new Argument(name, description);
12
13/**
14 * Expose classes
15 */
16
17exports.Command = Command;
18exports.Option = Option;
19exports.Argument = Argument;
20exports.Help = Help;
21
22exports.CommanderError = CommanderError;
23exports.InvalidArgumentError = InvalidArgumentError;
24exports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated