Skip to content

[Console] Running commands with short options is broken if value contains "h" #25938

Closed
@jakzal

Description

@jakzal
Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Symfony version 2.7.39

Behat tests started failing because of this issue (see here).

The following command started displaying a help message, instead of running the test suite:

behat --no-colors -sbig_brother -fpretty --format-settings='{\"paths\": true}' features

The cause of the issue seems to be #24987 which allowed grouping short options. -sbig_brother contains the "h" letter which is treated as -h and the Application assumes it needs to display a help message:

$name = $this->getCommandName($input);
if (true === $input->hasParameterOption(array('--help', '-h'))) {
if (!$name) {
$name = 'help';
$input = new ArrayInput(array('command' => 'help'));
} else {
$this->wantHelps = true;
}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions