|
1 | 1 | Progress Indicator
|
2 | 2 | ==================
|
3 | 3 |
|
4 |
| -When executing longer-running commands without knowing if the the processing |
5 |
| -is nearly done or not, it may be helpful to show that something is actually |
6 |
| -happening and that updates as your command runs. |
| 4 | +Progress indicators are useful to let users know that a command isn't stalled. |
| 5 | +Unlike :doc:`progress bars </components/console/helpers/progressbar>`, these |
| 6 | +indicators are used when the command duration is indeterminate (e.g. long-running |
| 7 | +commands, unquantifiable tasks, etc.) |
7 | 8 |
|
8 |
| -To do so, use the |
9 |
| -:class:`Symfony\\Component\\Console\\Helper\\ProgressIndicator` and advance the |
10 |
| -progress as the command executes:: |
| 9 | +They work by instantiating the :class:`Symfony\\Component\\Console\\Helper\\ProgressIndicator` |
| 10 | +class and advancing the progress as the command executes:: |
11 | 11 |
|
12 | 12 | use Symfony\Component\Console\Helper\ProgressIndicator;
|
13 | 13 |
|
@@ -57,10 +57,9 @@ level of verbosity of the ``OutputInterface`` instance:
|
57 | 57 | / Processing... (1 sec, 6.0 MiB)
|
58 | 58 | - Processing... (1 sec, 6.0 MiB)
|
59 | 59 |
|
60 |
| -.. note:: |
| 60 | +.. tip:: |
61 | 61 |
|
62 |
| - If you call a command with the quiet flag (``-q``), the progress indicator won't |
63 |
| - be displayed. |
| 62 | + Call a command with the quiet flag (``-q``) to not display any progress indicator. |
64 | 63 |
|
65 | 64 | Instead of relying on the verbosity mode of the current command, you can also
|
66 | 65 | force a format via the second argument of the ``ProgressIndicator``
|
@@ -108,8 +107,7 @@ built-in placeholders:
|
108 | 107 | * ``memory``: The current memory usage;
|
109 | 108 | * ``message``: used to display arbitrary messages in the progress indicator.
|
110 | 109 |
|
111 |
| -If you want to customize a placeholder, for example the ``message`` one, here |
112 |
| -is how you should do this:: |
| 110 | +For example, this is how you can customize the ``message`` placeholder:: |
113 | 111 |
|
114 | 112 | ProgressIndicator::setPlaceholderFormatterDefinition(
|
115 | 113 | 'message',
|
|
0 commit comments