Skip to content

[Console] Update the hidden command doc when using the pipe syntax #21170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ After configuring and registering the command, you can run it in the terminal:
As you might expect, this command will do nothing as you didn't write any logic
yet. Add your own logic inside the ``__invoke()`` method.

.. _command-aliases:

Command Aliases
~~~~~~~~~~~~~~~

Expand Down
11 changes: 4 additions & 7 deletions console/hide_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ the ``hidden`` property of the ``AsCommand`` attribute::
// ...
}

You can also define a command as hidden using the pipe (``|``) syntax in the
command name::
You can also define a command as hidden using the pipe (``|``) syntax of
:ref:`command aliases <command-aliases>`. To do this, use the command name as one
of the aliases and leave the main command name (the part before the ``|``) empty::

// src/Command/LegacyCommand.php
namespace App\Command;
Expand All @@ -39,11 +40,7 @@ command name::

.. versionadded:: 7.4

The ability to define a command as hidden using the pipe syntax in the
command name was introduced in Symfony 7.4.

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.
Support for hidding commands using the pipe syntax was introduced in Symfony 7.4.

.. note::

Expand Down