Skip to content

Commit

Permalink
[Console] fix: fixed single command application run
Browse files Browse the repository at this point in the history
  • Loading branch information
alekitto committed Jul 31, 2024
1 parent 6fd14bc commit 8a95d13
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,17 @@ export default class Application {

if (! name) {
name = this._defaultCommand;
input = new ArrayInput({'command': this._defaultCommand});
const args = this.definition.getArguments();
this.definition.setArguments();
for (const arg of args) {
if ('command' === arg.getName()) {
continue;
}

this.definition.addArgument(arg);
}

this.definition.addArgument(new InputArgument('command', InputArgument.OPTIONAL, 'The command to execute', name));
}

// The command name MUST be the first element of the input
Expand Down

0 comments on commit 8a95d13

Please sign in to comment.