Skip to content

[Console] [Command] Helpers uses stderr by default #18837

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
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
8 changes: 8 additions & 0 deletions components/console/helpers/processhelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ In case the process fails, debugging is easier:
.. image:: /_images/components/console/process-helper-error-debug.png
:alt: The last line shows "RES 127 Command dit not run successfully", and the output lines show more the error information from the command.

.. note::

By default, the process helper uses the error output (``stderr``) as
its default output. This behavior can be changed by passing an instance of
:class:`Symfony\\Component\\Console\\Output\\StreamOutput` to the
:method:`Symfony\\Component\\Console\\Helper\\ProcessHelper::run`
method.

Arguments
---------

Expand Down
8 changes: 8 additions & 0 deletions components/console/helpers/progressbar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ number of units, and advance the progress as the command executes::
``$progress->advance()`` with a negative value. For example, if you call
``$progress->advance(-2)`` then it will regress the progress bar 2 steps.

.. note::

By default, the progress bar helper uses the error output (``stderr``) as
its default output. This behavior can be changed by passing an instance of
:class:`Symfony\\Component\\Console\\Output\\StreamOutput` to the
:class:`Symfony\\Component\\Console\\Helper\\ProgressBar`
constructor.

Instead of advancing the bar by a number of steps (with the
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::advance` method),
you can also set the current progress by calling the
Expand Down
8 changes: 8 additions & 0 deletions components/console/helpers/questionhelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ the second argument is not provided, ``true`` is assumed.

The regex defaults to ``/^y/i``.

.. note::

By default, the question helper uses the error output (``stderr``) as
its default output. This behavior can be changed by passing an instance of
:class:`Symfony\\Component\\Console\\Output\\StreamOutput` to the
:method:`Symfony\\Component\\Console\\Helper\\QuestionHelper::ask`
method.

Asking the User for Information
-------------------------------

Expand Down