@jsspec/cli-options
v0.0.8
Published
Command line option parser
Downloads
2
Maintainers
Readme
@jsspec/cli-options
Command line options parser for jsspec.
Example:
const CLIOptions = require('@jsspec/cli-options')
options = {
random: { alias: 'R', type: Boolean, required: false, default: true },
require: { alias: 'r', type: Array, required: false, default: [] },
format: { alias: 'f', type: String, required: false, default: 'documentation' },
files: { type: Array, required: false, default: [] }
};
const cliOptions = new CLIOptions(process.argv.slice(2), options, 'files');
const settings = cliOptions.settings;
console.log(cliOptions.errors.join('\n'));