@@ -133,67 +133,6 @@ Commands have three lifecycle methods:
133
133
This method is executed after ``interact() `` and ``initialize() ``.
134
134
It contains the logic you want the command to execute.
135
135
136
- .. _components-console-coloring :
137
-
138
- Coloring the Output
139
- ~~~~~~~~~~~~~~~~~~~
140
-
141
- .. note ::
142
-
143
- By default, the Windows command console doesn't support output coloring. The
144
- Console component disables output coloring for Windows systems, but if your
145
- commands invoke other scripts which emit color sequences, they will be
146
- wrongly displayed as raw escape characters. Install the `Cmder `_, `ConEmu `_, `ANSICON `_
147
- or `Mintty `_ (used by default in GitBash and Cygwin) free applications
148
- to add coloring support to your Windows command console.
149
-
150
- Whenever you output text, you can surround the text with tags to color its
151
- output. For example::
152
-
153
- // green text
154
- $output->writeln('<info>foo</info>');
155
-
156
- // yellow text
157
- $output->writeln('<comment>foo</comment>');
158
-
159
- // black text on a cyan background
160
- $output->writeln('<question>foo</question>');
161
-
162
- // white text on a red background
163
- $output->writeln('<error>foo</error>');
164
-
165
- The closing tag can be replaced by ``</> ``, which revokes all formatting options
166
- established by the last opened tag.
167
-
168
- It is possible to define your own styles using the class
169
- :class: `Symfony\\ Component\\ Console\\ Formatter\\ OutputFormatterStyle `::
170
-
171
- use Symfony\Component\Console\Formatter\OutputFormatterStyle;
172
-
173
- // ...
174
- $style = new OutputFormatterStyle('red', 'yellow', array('bold', 'blink'));
175
- $output->getFormatter()->setStyle('fire', $style);
176
- $output->writeln('<fire>foo</>');
177
-
178
- Available foreground and background colors are: ``black ``, ``red ``, ``green ``,
179
- ``yellow ``, ``blue ``, ``magenta ``, ``cyan `` and ``white ``.
180
-
181
- And available options are: ``bold ``, ``underscore ``, ``blink ``, ``reverse ``
182
- (enables the "reverse video" mode where the background and foreground colors
183
- are swapped) and ``conceal `` (sets the foreground color to transparent, making
184
- the typed text invisible - although it can be selected and copied; this option is
185
- commonly used when asking the user to type sensitive information).
186
-
187
- You can also set these colors and options inside the tagname::
188
-
189
- // green text
190
- $output->writeln('<fg=green>foo</>');
191
-
192
- // black text on a cyan background
193
- $output->writeln('<fg=black;bg=cyan>foo</>');
194
-
195
- // bold text on a yellow background
196
- $output->writeln('<bg=yellow;options=bold>foo</>');
197
136
198
137
.. _verbosity-levels :
199
138
0 commit comments