diff --git a/console.rst b/console.rst index 28b560d1f9b..6eb9dd10148 100644 --- a/console.rst +++ b/console.rst @@ -28,6 +28,10 @@ the ``list`` command to view all available commands in the application: cache:clear Clear the cache ... +.. note:: + + ``list`` is the default command, so running ``php bin/console`` is the same. + If you find the command you need, you can run it with the ``--help`` option to view the command's documentation: @@ -35,6 +39,13 @@ to view the command's documentation: $ php bin/console assets:install --help +.. note:: + + ``--help`` is one of the built-in global options from the Console component, + which are available for all commands, including those you can create. + To learn more about them, you can read + :ref:`this section `. + APP_ENV & APP_DEBUG ~~~~~~~~~~~~~~~~~~~ diff --git a/console/input.rst b/console/input.rst index 6a242185034..3abf3a37b9b 100644 --- a/console/input.rst +++ b/console/input.rst @@ -404,4 +404,26 @@ to help you unit test the completion logic:: } } +.. _console-global-options: + +Command Global Options +---------------------- + +The Console component adds some predefined options to all commands: + +* ``--verbose``: sets the verbosity level (e.g. ``1`` the default, ``2`` and + ``3``, or you can use respective shortcuts ``-v``, ``-vv`` and ``-vvv``) +* ``--quiet``: disables output and interaction +* ``--no-interaction``: disables interaction +* ``--version``: outputs the version number of the console application +* ``--help``: displays the command help +* ``--ansi|--no-ansi``: whether to force of disable coloring the output + +When using the ``FrameworkBundle``, two more options are predefined: + +* ``--env``: sets the Kernel configuration environment (defaults to ``APP_ENV``) +* ``--no-debug``: disables Kernel debug (defaults to ``APP_DEBUG``) + +So your custom commands can use them too out-of-the-box. + .. _`docopt standard`: http://docopt.org/