Skip to content

Console auto completion for arguments with default value #44505

@dmolineus

Description

@dmolineus

Symfony version(s) affected

5.4|6.x

Description

The new console auto completion feature is awesome but unfortunately doesn't work quite well with arguments defining default values.

Given is a console command with two argument command [<task=default> [<dir>]] where the first argument task has a default value.

Expected behaviour: If I enter command <TAB> I expect to the the suggested values for task. Instead I see the suggestions for dir.

How to reproduce

  • Create a console command with 2 arguments
  • The first argument has a default value
  • Enable the auto completion and provide suggestions for these two arguments

Possible Solution

Default values has to be ignored then choosing the current argument for suggestions

Additional Context

No response

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