Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
names: ['help', 'h'],
type: 'bool',
help: 'Show this help.'
}
];
const fileOpts = [
{
names: ['file', 'f'],
helpArg: 'FILE',
help: 'Load data from the given file instead of reading from stdin.',
type: 'string'
}
];
dashdash.addOptionType({
name: 'colorOptions',
takesArg: true,
helpArg: 'OPTION',
parseArg(option, optStr, arg) {
const validOptions = ['off', 'force', 'auto', 'auto+pager'];
if(validOptions.indexOf(arg) == -1) {
throw new Error('argument for ' + optStr + ' is not valid');
}
return arg;
}
});
const objectOutputOpts = [
{
names: ['pretty-print', 'p'],
type: 'bool',