Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Console] Command usage output invalid if argument name is a reserved style #41315

Copy link
Copy link
Closed
@n0rbyt3

Description

@n0rbyt3
Issue body actions

Symfony version(s) affected: >=4.4

Description
If you name an console input argument "info" and try to use the command without arguments, the help output is incorrect.

How to reproduce

class FooBarCommand extends Command
{
    protected static $defaultName = 'foo:bar';

    protected function configure()
    {
        $this->addArgument('first', InputArgument::REQUIRED);
        $this->addArgument('info', InputArgument::REQUIRED);
        $this->addArgument('last', InputArgument::REQUIRED);
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        return Command::SUCCESS;
    }
}

Command line:

php bin\console foo:bar
[Not anough arguments info]
foo:bar <first> <last>

Possible Solution
Do not print the arguments as tags, use another delimiter instead or the output should not get formatted.

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.