ng-afelio
Version:
Extended Angular CLI
18 lines (16 loc) • 431 B
JavaScript
function getAllArgs(command, includeHelp, includeOptions) {
const remainArgs = command.args.filter(a => a.startsWith('-'));
let options = [];
if (includeOptions) {
options = command.options.map(o => o.long);
}
if (includeHelp) {
if (!options.includes('--help')) {
options.push('--help')
}
}
return [...remainArgs, ...options];
}
module.exports = {
getAllArgs
};