4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Console\Tests;
14 use Symfony\Component\Console\Application;
15 use Symfony\Component\Console\Input\ArrayInput;
16 use Symfony\Component\Console\Input\InputArgument;
17 use Symfony\Component\Console\Input\InputOption;
18 use Symfony\Component\Console\Output\NullOutput;
19 use Symfony\Component\Console\Output\Output;
20 use Symfony\Component\Console\Tester\ApplicationTester;
22 class ApplicationTest extends \PHPUnit_Framework_TestCase
24 protected static $fixturesPath;
26 public static function setUpBeforeClass()
28 self::$fixturesPath = realpath(__DIR__.'/Fixtures/');
29 require_once self::$fixturesPath.'/FooCommand.php';
30 require_once self::$fixturesPath.'/Foo1Command.php';
31 require_once self::$fixturesPath.'/Foo2Command.php';
32 require_once self::$fixturesPath.'/Foo3Command.php';
35 protected function normalizeLineBreaks($text)
37 return str_replace(PHP_EOL, "\n", $text);
41 * Replaces the dynamic placeholders of the command help text with a static version.
42 * The placeholder %command.full_name% includes the script path that is not predictable
43 * and can not be tested against.
45 protected function ensureStaticCommandHelp(Application $application)
47 foreach ($application->all() as $command) {
48 $command->setHelp(str_replace('%command.full_name%', 'app/console %command.name%', $command->getHelp()));
52 public function testConstructor()
54 $application = new Application('foo', 'bar');
55 $this->assertEquals('foo', $application->getName(), '__construct() takes the application name as its first argument');
56 $this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its first argument');
57 $this->assertEquals(array('help', 'list'), array_keys($application->all()), '__construct() registered the help and list commands by default');
60 public function testSetGetName()
62 $application = new Application();
63 $application->setName('foo');
64 $this->assertEquals('foo', $application->getName(), '->setName() sets the name of the application');
67 public function testSetGetVersion()
69 $application = new Application();
70 $application->setVersion('bar');
71 $this->assertEquals('bar', $application->getVersion(), '->setVersion() sets the version of the application');
74 public function testGetLongVersion()
76 $application = new Application('foo', 'bar');
77 $this->assertEquals('<info>foo</info> version <comment>bar</comment>', $application->getLongVersion(), '->getLongVersion() returns the long version of the application');
80 public function testHelp()
82 $application = new Application();
83 $this->assertStringEqualsFile(self::$fixturesPath.'/application_gethelp.txt', $this->normalizeLineBreaks($application->getHelp()), '->setHelp() returns a help message');
86 public function testAll()
88 $application = new Application();
89 $commands = $application->all();
90 $this->assertEquals('Symfony\\Component\\Console\\Command\\HelpCommand', get_class($commands['help']), '->all() returns the registered commands');
92 $application->add(new \FooCommand());
93 $commands = $application->all('foo');
94 $this->assertEquals(1, count($commands), '->all() takes a namespace as its first argument');
97 public function testRegister()
99 $application = new Application();
100 $command = $application->register('foo');
101 $this->assertEquals('foo', $command->getName(), '->register() registers a new command');
104 public function testAdd()
106 $application = new Application();
107 $application->add($foo = new \FooCommand());
108 $commands = $application->all();
109 $this->assertEquals($foo, $commands['foo:bar'], '->add() registers a command');
111 $application = new Application();
112 $application->addCommands(array($foo = new \FooCommand(), $foo1 = new \Foo1Command()));
113 $commands = $application->all();
114 $this->assertEquals(array($foo, $foo1), array($commands['foo:bar'], $commands['foo:bar1']), '->addCommands() registers an array of commands');
117 public function testHasGet()
119 $application = new Application();
120 $this->assertTrue($application->has('list'), '->has() returns true if a named command is registered');
121 $this->assertFalse($application->has('afoobar'), '->has() returns false if a named command is not registered');
123 $application->add($foo = new \FooCommand());
124 $this->assertTrue($application->has('afoobar'), '->has() returns true if an alias is registered');
125 $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns a command by name');
126 $this->assertEquals($foo, $application->get('afoobar'), '->get() returns a command by alias');
129 $application->get('foofoo');
130 $this->fail('->get() throws an \InvalidArgumentException if the command does not exist');
131 } catch (\Exception $e) {
132 $this->assertInstanceOf('\InvalidArgumentException', $e, '->get() throws an \InvalidArgumentException if the command does not exist');
133 $this->assertEquals('The command "foofoo" does not exist.', $e->getMessage(), '->get() throws an \InvalidArgumentException if the command does not exist');
136 $application = new Application();
137 $application->add($foo = new \FooCommand());
139 $r = new \ReflectionObject($application);
140 $p = $r->getProperty('wantHelps');
141 $p->setAccessible(true);
142 $p->setValue($application, true);
143 $command = $application->get('foo:bar');
144 $this->assertEquals('Symfony\Component\Console\Command\HelpCommand', get_class($command), '->get() returns the help command if --help is provided as the input');
147 public function testGetNamespaces()
149 $application = new Application();
150 $application->add(new \FooCommand());
151 $application->add(new \Foo1Command());
152 $this->assertEquals(array('foo'), $application->getNamespaces(), '->getNamespaces() returns an array of unique used namespaces');
155 public function testFindNamespace()
157 $application = new Application();
158 $application->add(new \FooCommand());
159 $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists');
160 $this->assertEquals('foo', $application->findNamespace('f'), '->findNamespace() finds a namespace given an abbreviation');
161 $application->add(new \Foo2Command());
162 $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists');
164 $application->findNamespace('f');
165 $this->fail('->findNamespace() throws an \InvalidArgumentException if the abbreviation is ambiguous');
166 } catch (\Exception $e) {
167 $this->assertInstanceOf('\InvalidArgumentException', $e, '->findNamespace() throws an \InvalidArgumentException if the abbreviation is ambiguous');
168 $this->assertEquals('The namespace "f" is ambiguous (foo, foo1).', $e->getMessage(), '->findNamespace() throws an \InvalidArgumentException if the abbreviation is ambiguous');
172 $application->findNamespace('bar');
173 $this->fail('->findNamespace() throws an \InvalidArgumentException if no command is in the given namespace');
174 } catch (\Exception $e) {
175 $this->assertInstanceOf('\InvalidArgumentException', $e, '->findNamespace() throws an \InvalidArgumentException if no command is in the given namespace');
176 $this->assertEquals('There are no commands defined in the "bar" namespace.', $e->getMessage(), '->findNamespace() throws an \InvalidArgumentException if no command is in the given namespace');
180 public function testFind()
182 $application = new Application();
183 $application->add(new \FooCommand());
184 $this->assertEquals('FooCommand', get_class($application->find('foo:bar')), '->find() returns a command if its name exists');
185 $this->assertEquals('Symfony\Component\Console\Command\HelpCommand', get_class($application->find('h')), '->find() returns a command if its name exists');
186 $this->assertEquals('FooCommand', get_class($application->find('f:bar')), '->find() returns a command if the abbreviation for the namespace exists');
187 $this->assertEquals('FooCommand', get_class($application->find('f:b')), '->find() returns a command if the abbreviation for the namespace and the command name exist');
188 $this->assertEquals('FooCommand', get_class($application->find('a')), '->find() returns a command if the abbreviation exists for an alias');
190 $application->add(new \Foo1Command());
191 $application->add(new \Foo2Command());
194 $application->find('f');
195 $this->fail('->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a namespace');
196 } catch (\Exception $e) {
197 $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a namespace');
198 $this->assertRegExp('/Command "f" is not defined./', $e->getMessage(), '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a namespace');
202 $application->find('a');
203 $this->fail('->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for an alias');
204 } catch (\Exception $e) {
205 $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for an alias');
206 $this->assertEquals('Command "a" is ambiguous (afoobar, afoobar1 and 1 more).', $e->getMessage(), '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for an alias');
210 $application->find('foo:b');
211 $this->fail('->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a command');
212 } catch (\Exception $e) {
213 $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a command');
214 $this->assertEquals('Command "foo:b" is ambiguous (foo:bar, foo:bar1).', $e->getMessage(), '->find() throws an \InvalidArgumentException if the abbreviation is ambiguous for a command');
218 public function testFindAlternativeExceptionMessage()
220 $application = new Application();
221 $application->add(new \FooCommand());
223 // Command + singular
225 $application->find('foo:baR');
226 $this->fail('->find() throws an \InvalidArgumentException if command does not exist, with one alternative');
227 } catch (\Exception $e) {
228 $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with one alternative');
229 $this->assertRegExp('/Did you mean this/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with one alternative');
232 // Namespace + singular
234 $application->find('foO:bar');
235 $this->fail('->find() throws an \InvalidArgumentException if command does not exist, with one alternative');
236 } catch (\Exception $e) {
237 $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with one alternative');
238 $this->assertRegExp('/Did you mean this/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with one alternative');
242 $application->add(new \Foo1Command());
243 $application->add(new \Foo2Command());
247 $application->find('foo:baR');
248 $this->fail('->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
249 } catch (\Exception $e) {
250 $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
251 $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
254 // Namespace + plural
256 $application->find('foo2:bar');
257 $this->fail('->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
258 } catch (\Exception $e) {
259 $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
260 $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
264 public function testFindAlternativeCommands()
266 $application = new Application();
268 $application->add(new \FooCommand());
269 $application->add(new \Foo1Command());
270 $application->add(new \Foo2Command());
273 $application->find($commandName = 'Unknown command');
274 $this->fail('->find() throws an \InvalidArgumentException if command does not exist');
275 } catch (\Exception $e) {
276 $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist');
277 $this->assertEquals(sprintf('Command "%s" is not defined.', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, without alternatives');
281 $application->find($commandName = 'foo');
282 $this->fail('->find() throws an \InvalidArgumentException if command does not exist');
283 } catch (\Exception $e) {
284 $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist');
285 $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
286 $this->assertRegExp('/foo:bar/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "foo:bar"');
287 $this->assertRegExp('/foo1:bar/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "foo1:bar"');
288 $this->assertRegExp('/foo:bar1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "foo:bar1"');
291 // Test if "foo1" command throw an "\InvalidArgumentException" and does not contain
292 // "foo:bar" as alternative because "foo1" is too far from "foo:bar"
294 $application->find($commandName = 'foo1');
295 $this->fail('->find() throws an \InvalidArgumentException if command does not exist');
296 } catch (\Exception $e) {
297 $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist');
298 $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
299 $this->assertFalse(strpos($e->getMessage(), 'foo:bar'), '->find() throws an \InvalidArgumentException if command does not exist, without "foo:bar" alternative');
303 public function testFindAlternativeNamespace()
305 $application = new Application();
307 $application->add(new \FooCommand());
308 $application->add(new \Foo1Command());
309 $application->add(new \Foo2Command());
310 $application->add(new \foo3Command());
313 $application->find('Unknown-namespace:Unknown-command');
314 $this->fail('->find() throws an \InvalidArgumentException if namespace does not exist');
315 } catch (\Exception $e) {
316 $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if namespace does not exist');
317 $this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, without alternatives');
321 $application->find('foo2:command');
322 $this->fail('->find() throws an \InvalidArgumentException if namespace does not exist');
323 } catch (\Exception $e) {
324 $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if namespace does not exist');
325 $this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative');
326 $this->assertRegExp('/foo/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo"');
327 $this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo1"');
328 $this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo3"');
332 public function testSetCatchExceptions()
334 $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
335 $application->setAutoExit(false);
336 $application->expects($this->any())
337 ->method('getTerminalWidth')
338 ->will($this->returnValue(120));
339 $tester = new ApplicationTester($application);
341 $application->setCatchExceptions(true);
342 $tester->run(array('command' => 'foo'), array('decorated' => false));
343 $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->setCatchExceptions() sets the catch exception flag');
345 $application->setCatchExceptions(false);
347 $tester->run(array('command' => 'foo'), array('decorated' => false));
348 $this->fail('->setCatchExceptions() sets the catch exception flag');
349 } catch (\Exception $e) {
350 $this->assertInstanceOf('\Exception', $e, '->setCatchExceptions() sets the catch exception flag');
351 $this->assertEquals('Command "foo" is not defined.', $e->getMessage(), '->setCatchExceptions() sets the catch exception flag');
355 public function testAsText()
357 $application = new Application();
358 $application->add(new \FooCommand);
359 $this->ensureStaticCommandHelp($application);
360 $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext1.txt', $this->normalizeLineBreaks($application->asText()), '->asText() returns a text representation of the application');
361 $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext2.txt', $this->normalizeLineBreaks($application->asText('foo')), '->asText() returns a text representation of the application');
364 public function testAsXml()
366 $application = new Application();
367 $application->add(new \FooCommand);
368 $this->ensureStaticCommandHelp($application);
369 $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml1.txt', $application->asXml(), '->asXml() returns an XML representation of the application');
370 $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml2.txt', $application->asXml('foo'), '->asXml() returns an XML representation of the application');
373 public function testRenderException()
375 $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
376 $application->setAutoExit(false);
377 $application->expects($this->any())
378 ->method('getTerminalWidth')
379 ->will($this->returnValue(120));
380 $tester = new ApplicationTester($application);
382 $tester->run(array('command' => 'foo'), array('decorated' => false));
383 $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->renderException() renders a pretty exception');
385 $tester->run(array('command' => 'foo'), array('decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE));
386 $this->assertContains('Exception trace', $tester->getDisplay(), '->renderException() renders a pretty exception with a stack trace when verbosity is verbose');
388 $tester->run(array('command' => 'list', '--foo' => true), array('decorated' => false));
389 $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception2.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->renderException() renders the command synopsis when an exception occurs in the context of a command');
391 $application->add(new \Foo3Command);
392 $tester = new ApplicationTester($application);
393 $tester->run(array('command' => 'foo3:bar'), array('decorated' => false));
394 $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->renderException() renders a pretty exceptions with previous exceptions');
396 $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
397 $application->setAutoExit(false);
398 $application->expects($this->any())
399 ->method('getTerminalWidth')
400 ->will($this->returnValue(32));
401 $tester = new ApplicationTester($application);
403 $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
404 $application->setAutoExit(false);
405 $application->expects($this->any())
406 ->method('getTerminalWidth')
407 ->will($this->returnValue(32));
408 $tester = new ApplicationTester($application);
410 $tester->run(array('command' => 'foo'), array('decorated' => false));
411 $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception4.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->renderException() wraps messages when they are bigger than the terminal');
414 public function testRun()
416 $application = new Application();
417 $application->setAutoExit(false);
418 $application->setCatchExceptions(false);
419 $application->add($command = new \Foo1Command());
420 $_SERVER['argv'] = array('cli.php', 'foo:bar1');
426 $this->assertSame('Symfony\Component\Console\Input\ArgvInput', get_class($command->input), '->run() creates an ArgvInput by default if none is given');
427 $this->assertSame('Symfony\Component\Console\Output\ConsoleOutput', get_class($command->output), '->run() creates a ConsoleOutput by default if none is given');
429 $application = new Application();
430 $application->setAutoExit(false);
431 $application->setCatchExceptions(false);
433 $this->ensureStaticCommandHelp($application);
434 $tester = new ApplicationTester($application);
436 $tester->run(array(), array('decorated' => false));
437 $this->assertStringEqualsFile(self::$fixturesPath.'/application_run1.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() runs the list command if no argument is passed');
439 $tester->run(array('--help' => true), array('decorated' => false));
440 $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() runs the help command if --help is passed');
442 $tester->run(array('-h' => true), array('decorated' => false));
443 $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() runs the help command if -h is passed');
445 $tester->run(array('command' => 'list', '--help' => true), array('decorated' => false));
446 $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() displays the help if --help is passed');
448 $tester->run(array('command' => 'list', '-h' => true), array('decorated' => false));
449 $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() displays the help if -h is passed');
451 $tester->run(array('--ansi' => true));
452 $this->assertTrue($tester->getOutput()->isDecorated(), '->run() forces color output if --ansi is passed');
454 $tester->run(array('--no-ansi' => true));
455 $this->assertFalse($tester->getOutput()->isDecorated(), '->run() forces color output to be disabled if --no-ansi is passed');
457 $tester->run(array('--version' => true), array('decorated' => false));
458 $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() displays the program version if --version is passed');
460 $tester->run(array('-V' => true), array('decorated' => false));
461 $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() displays the program version if -v is passed');
463 $tester->run(array('command' => 'list', '--quiet' => true));
464 $this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed');
466 $tester->run(array('command' => 'list', '-q' => true));
467 $this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed');
469 $tester->run(array('command' => 'list', '--verbose' => true));
470 $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed');
472 $tester->run(array('command' => 'list', '-v' => true));
473 $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed');
475 $application = new Application();
476 $application->setAutoExit(false);
477 $application->setCatchExceptions(false);
478 $application->add(new \FooCommand());
479 $tester = new ApplicationTester($application);
481 $tester->run(array('command' => 'foo:bar', '--no-interaction' => true), array('decorated' => false));
482 $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if --no-interaction is passed');
484 $tester->run(array('command' => 'foo:bar', '-n' => true), array('decorated' => false));
485 $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if -n is passed');
489 * @expectedException \LogicException
490 * @dataProvider getAddingAlreadySetDefinitionElementData
492 public function testAddingAlreadySetDefinitionElementData($def)
494 $application = new Application();
495 $application->setAutoExit(false);
496 $application->setCatchExceptions(false);
499 ->setDefinition(array($def))
500 ->setCode(function (InputInterface $input, OutputInterface $output) {})
503 $input = new ArrayInput(array('command' => 'foo'));
504 $output = new NullOutput();
505 $application->run($input, $output);
508 public function getAddingAlreadySetDefinitionElementData()
511 array(new InputArgument('command', InputArgument::REQUIRED)),
512 array(new InputOption('quiet', '', InputOption::VALUE_NONE)),
513 array(new InputOption('query', 'q', InputOption::VALUE_NONE)),