back/cli: fix main command not able to accept args
This commit is contained in:
parent
e1542ae476
commit
4c895229ec
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user