Skip to content

Hidden console commands appear in "Did you mean .." list #33398

@m-vo

Description

@m-vo

Description
Setting a command to hidden does not remove it from the list of suggested commands when the input is ambiguous. ("Did you mean one of these?"). That's of course a side effect of the command still being accessible and allowing commands to be shortened.

It feels a bit inconsistent but I'm actually not sure what to change about this. So maybe add a note to the docs?

Hidden commands behave the same as normal commands but they are no longer displayed in command listings, so end-users are not aware of their existence.

Note: In case a user enters an ambiguous command that matches the name of a hidden command it will still get shown in the list of suggestions.

How to reproduce

  1. create a command some:visible-command
  2. create second command some:hidden-command but configure it with $this->setHidden(true)
  3. run bin/console → only the first command is visible in the list of commands ✓
  4. run bin/console some:
Did you mean one of these?          
    some:visible-command                
    some:hidden-command

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