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> {
|
protected async processCommandLine(): Promise<boolean> {
|
||||||
const args = process.argv;
|
const args = process.argv;
|
||||||
|
|
||||||
// Flags
|
// Flags
|
||||||
const flags = {
|
const flags = {
|
||||||
verbose: false,
|
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]})`);
|
else throw new Error(`Only one main command can be used at once (${mainCommand},${args[i]})`);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (mainCommand) mainCommandArgs.push(args[i]);
|
if (mainCommand) {
|
||||||
else logger.fatal('Unrecognized argument', args[i]);
|
mainCommandArgs.push(args[i]);
|
||||||
return true;
|
} else {
|
||||||
|
logger.fatal('Unrecognized argument', args[i]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user