Skip to content

Add mandatory exit status #12730

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
Dec 9, 2019
Merged
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
5 changes: 5 additions & 0 deletions console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ want a command to create a user::
protected function execute(InputInterface $input, OutputInterface $output)
{
// ...

return 0;
}
}

Expand Down Expand Up @@ -316,6 +318,7 @@ command:
:method:`Symfony\\Component\\Console\\Command\\Command::execute` *(required)*
This method is executed after ``interact()`` and ``initialize()``.
It contains the logic you want the command to execute.
Must return an integer which will be used as the command `exit status`_.

.. _console-testing-commands:

Expand Down Expand Up @@ -395,3 +398,5 @@ tools capable of helping you with different tasks:
* :doc:`/components/console/helpers/formatterhelper`: customize the output colorization
* :doc:`/components/console/helpers/progressbar`: shows a progress bar
* :doc:`/components/console/helpers/table`: displays tabular data as a table

.. _`exit status`: https://en.wikipedia.org/wiki/Exit_status