From d9ecfb571c5228349eee101831d1bdaf48375091 Mon Sep 17 00:00:00 2001 From: Alessandro Chitolina Date: Wed, 31 Jul 2024 19:58:30 +0200 Subject: [PATCH] [Console] fix: fixed single command application run --- src/Application.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Application.js b/src/Application.js index 58e1d9b..e0fdbdd 100644 --- a/src/Application.js +++ b/src/Application.js @@ -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 (arg.getName() === 'command') { + 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