back/cli: fix main command not able to accept args

This commit is contained in:
Alice Gaudon 2021-11-24 18:18:19 +01:00
parent e1542ae476
commit 4c895229ec
1 changed files with 8 additions and 3 deletions

View File

@ -247,6 +247,7 @@ export default abstract class Application implements Extendable<ApplicationCompo
protected async processCommandLine(): Promise<boolean> {
const args = process.argv;
// Flags
const flags = {
verbose: false,
@ -272,9 +273,13 @@ export default abstract class Application implements Extendable<ApplicationCompo
else throw new Error(`Only one main command can be used at once (${mainCommand},${args[i]})`);
break;
default:
if (mainCommand) mainCommandArgs.push(args[i]);
else logger.fatal('Unrecognized argument', args[i]);
return true;
if (mainCommand) {
mainCommandArgs.push(args[i]);
} else {
logger.fatal('Unrecognized argument', args[i]);
return true;
}
break;
}
}