Skip to content

Commit 8a95d13

Browse files
committedJul 31, 2024
[Console] fix: fixed single command application run
1 parent 6fd14bc commit 8a95d13

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed
 

‎src/Application.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,17 @@ export default class Application {
578578

579579
if (! name) {
580580
name = this._defaultCommand;
581-
input = new ArrayInput({'command': this._defaultCommand});
581+
const args = this.definition.getArguments();
582+
this.definition.setArguments();
583+
for (const arg of args) {
584+
if ('command' === arg.getName()) {
585+
continue;
586+
}
587+
588+
this.definition.addArgument(arg);
589+
}
590+
591+
this.definition.addArgument(new InputArgument('command', InputArgument.OPTIONAL, 'The command to execute', name));
582592
}
583593

584594
// The command name MUST be the first element of the input

0 commit comments

Comments
 (0)