Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
const customActionExample = new ArgumentParser({ addHelp: false });
customActionExample.addArgument('--abc', {
action: CustomAction1,
});
customActionExample.addArgument('--def', {
action: CustomAction2,
});
const constExample = new ArgumentParser();
constExample.addArgument(
['-f', '--foo'],
{
help: 'foo bar',
nargs: Const.ONE_OR_MORE
}
);
constExample.addArgument(
['-b', '--bar'],
{
help: 'bar foo',
nargs: Const.ZERO_OR_MORE
}
);
constExample.addArgument(
'--baz',
{
help: 'baz',
nargs: Const.OPTIONAL
}
);
parser.addArgument(['-o', '--output-path'], {
action: 'store',
required: false,
help: 'Define output path for artifacts',
});
parser.addArgument(['-r', '--save-report'], {
action: 'storeTrue',
required: false,
help: 'Save lighthouse report as html for every supplied url',
});
requiredArgs.addArgument(['-u', '--urls'], {
action: 'store',
required: true,
nargs: Const.ONE_OR_MORE,
help: 'The lighthouse badge(s) will contain the respective average score(s) of all the urls supplied, combined',
});
module.exports = {
parser,
};