Laravel version update

Laravel version update
This commit is contained in:
Manish Verma
2018-08-06 18:48:58 +05:30
parent d143048413
commit 126fbb0255
13678 changed files with 1031482 additions and 778530 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -11,19 +11,20 @@
namespace Symfony\Component\Console\Tests\Command;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\FormatterHelper;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\StringInput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tester\CommandTester;
class CommandTest extends \PHPUnit_Framework_TestCase
class CommandTest extends TestCase
{
protected static $fixturesPath;
@@ -45,7 +46,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase
*/
public function testCommandNameCannotBeEmpty()
{
new Command();
(new Application())->add(new Command());
}
public function testSetApplication()
@@ -54,6 +55,14 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$command = new \TestCommand();
$command->setApplication($application);
$this->assertEquals($application, $command->getApplication(), '->setApplication() sets the current application');
$this->assertEquals($application->getHelperSet(), $command->getHelperSet());
}
public function testSetApplicationNull()
{
$command = new \TestCommand();
$command->setApplication(null);
$this->assertNull($command->getHelperSet());
}
public function testSetGetDefinition()
@@ -84,6 +93,13 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($command->getDefinition()->hasOption('foo'), '->addOption() adds an option to the command');
}
public function testSetHidden()
{
$command = new \TestCommand();
$command->setHidden(true);
$this->assertTrue($command->isHidden());
}
public function testGetNamespaceGetNameSetName()
{
$command = new \TestCommand();
@@ -101,7 +117,12 @@ class CommandTest extends \PHPUnit_Framework_TestCase
*/
public function testInvalidCommandNames($name)
{
$this->setExpectedException('InvalidArgumentException', sprintf('Command name "%s" is invalid.', $name));
if (method_exists($this, 'expectException')) {
$this->expectException('InvalidArgumentException');
$this->expectExceptionMessage(sprintf('Command name "%s" is invalid.', $name));
} else {
$this->setExpectedException('InvalidArgumentException', sprintf('Command name "%s" is invalid.', $name));
}
$command = new \TestCommand();
$command->setName($name);
@@ -156,6 +177,13 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array('name1'), $command->getAliases(), '->setAliases() sets the aliases');
}
public function testSetAliasesNull()
{
$command = new \TestCommand();
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
$command->setAliases(null);
}
public function testGetSynopsis()
{
$command = new \TestCommand();
@@ -164,6 +192,15 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('namespace:name [--foo] [--] [<bar>]', $command->getSynopsis(), '->getSynopsis() returns the synopsis');
}
public function testAddGetUsages()
{
$command = new \TestCommand();
$command->addUsage('foo1');
$command->addUsage('foo2');
$this->assertContains('namespace:name foo1', $command->getUsages());
$this->assertContains('namespace:name foo2', $command->getUsages());
}
public function testGetHelper()
{
$application = new Application();
@@ -257,7 +294,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase
}
/**
* @expectedException Symfony\Component\Console\Exception\InvalidOptionException
* @expectedException \Symfony\Component\Console\Exception\InvalidOptionException
* @expectedExceptionMessage The "--bar" option does not exist.
*/
public function testRunWithInvalidOption()
@@ -273,10 +310,10 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$exitCode = $command->run(new StringInput(''), new NullOutput());
$this->assertSame(0, $exitCode, '->run() returns integer exit code (treats null as 0)');
$command = $this->getMock('TestCommand', array('execute'));
$command = $this->getMockBuilder('TestCommand')->setMethods(array('execute'))->getMock();
$command->expects($this->once())
->method('execute')
->will($this->returnValue('2.3'));
->method('execute')
->will($this->returnValue('2.3'));
$exitCode = $command->run(new StringInput(''), new NullOutput());
$this->assertSame(2, $exitCode, '->run() returns integer exit code (casts numeric to int)');
}
@@ -297,6 +334,20 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$this->assertSame(0, $command->run(new StringInput(''), new NullOutput()));
}
public function testRunWithProcessTitle()
{
$command = new \TestCommand();
$command->setApplication(new Application());
$command->setProcessTitle('foo');
$this->assertSame(0, $command->run(new StringInput(''), new NullOutput()));
if (\function_exists('cli_set_process_title')) {
if (null === @cli_get_process_title() && 'Darwin' === PHP_OS) {
$this->markTestSkipped('Running "cli_get_process_title" as an unprivileged user is not supported on MacOS.');
}
$this->assertEquals('foo', cli_get_process_title());
}
}
public function testSetCode()
{
$command = new \TestCommand();
@@ -334,6 +385,29 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('interact called'.PHP_EOL.$expected.PHP_EOL, $tester->getDisplay());
}
public function testSetCodeWithStaticClosure()
{
$command = new \TestCommand();
$command->setCode(self::createClosure());
$tester = new CommandTester($command);
$tester->execute(array());
if (\PHP_VERSION_ID < 70000) {
// Cannot bind static closures in PHP 5
$this->assertEquals('interact called'.PHP_EOL.'not bound'.PHP_EOL, $tester->getDisplay());
} else {
// Can bind static closures in PHP 7
$this->assertEquals('interact called'.PHP_EOL.'bound'.PHP_EOL, $tester->getDisplay());
}
}
private static function createClosure()
{
return function (InputInterface $input, OutputInterface $output) {
$output->writeln(isset($this) ? 'bound' : 'not bound');
};
}
public function testSetCodeWithNonClosureCallable()
{
$command = new \TestCommand();

View File

@@ -11,12 +11,13 @@
namespace Symfony\Component\Console\Tests\Command;
use Symfony\Component\Console\Tester\CommandTester;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\HelpCommand;
use Symfony\Component\Console\Command\ListCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
class HelpCommandTest extends \PHPUnit_Framework_TestCase
class HelpCommandTest extends TestCase
{
public function testExecuteForCommandAlias()
{

View File

@@ -11,10 +11,11 @@
namespace Symfony\Component\Console\Tests\Command;
use Symfony\Component\Console\Tester\CommandTester;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
class ListCommandTest extends \PHPUnit_Framework_TestCase
class ListCommandTest extends TestCase
{
public function testExecuteListsCommands()
{
@@ -30,7 +31,7 @@ class ListCommandTest extends \PHPUnit_Framework_TestCase
$application = new Application();
$commandTester = new CommandTester($command = $application->get('list'));
$commandTester->execute(array('command' => $command->getName(), '--format' => 'xml'));
$this->assertRegExp('/<command id="list" name="list">/', $commandTester->getDisplay(), '->execute() returns a list of available commands in XML if --xml is passed');
$this->assertRegExp('/<command id="list" name="list" hidden="0">/', $commandTester->getDisplay(), '->execute() returns a list of available commands in XML if --xml is passed');
}
public function testExecuteListsCommandsWithRawOption()

View File

@@ -0,0 +1,67 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Tests\Command;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\Lock\Factory;
use Symfony\Component\Lock\Store\FlockStore;
use Symfony\Component\Lock\Store\SemaphoreStore;
class LockableTraitTest extends TestCase
{
protected static $fixturesPath;
public static function setUpBeforeClass()
{
self::$fixturesPath = __DIR__.'/../Fixtures/';
require_once self::$fixturesPath.'/FooLockCommand.php';
require_once self::$fixturesPath.'/FooLock2Command.php';
}
public function testLockIsReleased()
{
$command = new \FooLockCommand();
$tester = new CommandTester($command);
$this->assertSame(2, $tester->execute(array()));
$this->assertSame(2, $tester->execute(array()));
}
public function testLockReturnsFalseIfAlreadyLockedByAnotherCommand()
{
$command = new \FooLockCommand();
if (SemaphoreStore::isSupported(false)) {
$store = new SemaphoreStore();
} else {
$store = new FlockStore();
}
$lock = (new Factory($store))->createLock($command->getName());
$lock->acquire();
$tester = new CommandTester($command);
$this->assertSame(1, $tester->execute(array()));
$lock->release();
$this->assertSame(2, $tester->execute(array()));
}
public function testMultipleLockCallsThrowLogicException()
{
$command = new \FooLock2Command();
$tester = new CommandTester($command);
$this->assertSame(1, $tester->execute(array()));
}
}

View File

@@ -0,0 +1,61 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Tests\CommandLoader;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
use Symfony\Component\DependencyInjection\ServiceLocator;
class ContainerCommandLoaderTest extends TestCase
{
public function testHas()
{
$loader = new ContainerCommandLoader(new ServiceLocator(array(
'foo-service' => function () { return new Command('foo'); },
'bar-service' => function () { return new Command('bar'); },
)), array('foo' => 'foo-service', 'bar' => 'bar-service'));
$this->assertTrue($loader->has('foo'));
$this->assertTrue($loader->has('bar'));
$this->assertFalse($loader->has('baz'));
}
public function testGet()
{
$loader = new ContainerCommandLoader(new ServiceLocator(array(
'foo-service' => function () { return new Command('foo'); },
'bar-service' => function () { return new Command('bar'); },
)), array('foo' => 'foo-service', 'bar' => 'bar-service'));
$this->assertInstanceOf(Command::class, $loader->get('foo'));
$this->assertInstanceOf(Command::class, $loader->get('bar'));
}
/**
* @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
*/
public function testGetUnknownCommandThrows()
{
(new ContainerCommandLoader(new ServiceLocator(array()), array()))->get('unknown');
}
public function testGetCommandNames()
{
$loader = new ContainerCommandLoader(new ServiceLocator(array(
'foo-service' => function () { return new Command('foo'); },
'bar-service' => function () { return new Command('bar'); },
)), array('foo' => 'foo-service', 'bar' => 'bar-service'));
$this->assertSame(array('foo', 'bar'), $loader->getNames());
}
}

View File

@@ -0,0 +1,60 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Tests\CommandLoader;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\CommandLoader\FactoryCommandLoader;
class FactoryCommandLoaderTest extends TestCase
{
public function testHas()
{
$loader = new FactoryCommandLoader(array(
'foo' => function () { return new Command('foo'); },
'bar' => function () { return new Command('bar'); },
));
$this->assertTrue($loader->has('foo'));
$this->assertTrue($loader->has('bar'));
$this->assertFalse($loader->has('baz'));
}
public function testGet()
{
$loader = new FactoryCommandLoader(array(
'foo' => function () { return new Command('foo'); },
'bar' => function () { return new Command('bar'); },
));
$this->assertInstanceOf(Command::class, $loader->get('foo'));
$this->assertInstanceOf(Command::class, $loader->get('bar'));
}
/**
* @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
*/
public function testGetUnknownCommandThrows()
{
(new FactoryCommandLoader(array()))->get('unknown');
}
public function testGetCommandNames()
{
$loader = new FactoryCommandLoader(array(
'foo' => function () { return new Command('foo'); },
'bar' => function () { return new Command('bar'); },
));
$this->assertSame(array('foo', 'bar'), $loader->getNames());
}
}

View File

@@ -0,0 +1,262 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\TypedReference;
class AddConsoleCommandPassTest extends TestCase
{
/**
* @dataProvider visibilityProvider
*/
public function testProcess($public)
{
$container = new ContainerBuilder();
$container->addCompilerPass(new AddConsoleCommandPass(), PassConfig::TYPE_BEFORE_REMOVING);
$container->setParameter('my-command.class', 'Symfony\Component\Console\Tests\DependencyInjection\MyCommand');
$definition = new Definition('%my-command.class%');
$definition->setPublic($public);
$definition->addTag('console.command');
$container->setDefinition('my-command', $definition);
$container->compile();
$alias = 'console.command.symfony_component_console_tests_dependencyinjection_mycommand';
if ($public) {
$this->assertFalse($container->hasAlias($alias));
$id = 'my-command';
} else {
$id = $alias;
// The alias is replaced by a Definition by the ReplaceAliasByActualDefinitionPass
// in case the original service is private
$this->assertFalse($container->hasDefinition('my-command'));
$this->assertTrue($container->hasDefinition($alias));
}
$this->assertTrue($container->hasParameter('console.command.ids'));
$this->assertSame(array($alias => $id), $container->getParameter('console.command.ids'));
}
public function testProcessRegistersLazyCommands()
{
$container = new ContainerBuilder();
$command = $container
->register('my-command', MyCommand::class)
->setPublic(false)
->addTag('console.command', array('command' => 'my:command'))
->addTag('console.command', array('command' => 'my:alias'))
;
(new AddConsoleCommandPass())->process($container);
$commandLoader = $container->getDefinition('console.command_loader');
$commandLocator = $container->getDefinition((string) $commandLoader->getArgument(0));
$this->assertSame(ContainerCommandLoader::class, $commandLoader->getClass());
$this->assertSame(array('my:command' => 'my-command', 'my:alias' => 'my-command'), $commandLoader->getArgument(1));
$this->assertEquals(array(array('my-command' => new ServiceClosureArgument(new TypedReference('my-command', MyCommand::class)))), $commandLocator->getArguments());
$this->assertSame(array('console.command.symfony_component_console_tests_dependencyinjection_mycommand' => 'my-command'), $container->getParameter('console.command.ids'));
$this->assertSame(array('my-command' => true), $container->getParameter('console.lazy_command.ids'));
$this->assertSame(array(array('setName', array('my:command')), array('setAliases', array(array('my:alias')))), $command->getMethodCalls());
}
public function testProcessFallsBackToDefaultName()
{
$container = new ContainerBuilder();
$container
->register('with-default-name', NamedCommand::class)
->setPublic(false)
->addTag('console.command')
;
$pass = new AddConsoleCommandPass();
$pass->process($container);
$commandLoader = $container->getDefinition('console.command_loader');
$commandLocator = $container->getDefinition((string) $commandLoader->getArgument(0));
$this->assertSame(ContainerCommandLoader::class, $commandLoader->getClass());
$this->assertSame(array('default' => 'with-default-name'), $commandLoader->getArgument(1));
$this->assertEquals(array(array('with-default-name' => new ServiceClosureArgument(new TypedReference('with-default-name', NamedCommand::class)))), $commandLocator->getArguments());
$this->assertSame(array('console.command.symfony_component_console_tests_dependencyinjection_namedcommand' => 'with-default-name'), $container->getParameter('console.command.ids'));
$this->assertSame(array('with-default-name' => true), $container->getParameter('console.lazy_command.ids'));
$container = new ContainerBuilder();
$container
->register('with-default-name', NamedCommand::class)
->setPublic(false)
->addTag('console.command', array('command' => 'new-name'))
;
$pass->process($container);
$this->assertSame(array('new-name' => 'with-default-name'), $container->getDefinition('console.command_loader')->getArgument(1));
}
public function visibilityProvider()
{
return array(
array(true),
array(false),
);
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage The service "my-command" tagged "console.command" must not be abstract.
*/
public function testProcessThrowAnExceptionIfTheServiceIsAbstract()
{
$container = new ContainerBuilder();
$container->setResourceTracking(false);
$container->addCompilerPass(new AddConsoleCommandPass(), PassConfig::TYPE_BEFORE_REMOVING);
$definition = new Definition('Symfony\Component\Console\Tests\DependencyInjection\MyCommand');
$definition->addTag('console.command');
$definition->setAbstract(true);
$container->setDefinition('my-command', $definition);
$container->compile();
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage The service "my-command" tagged "console.command" must be a subclass of "Symfony\Component\Console\Command\Command".
*/
public function testProcessThrowAnExceptionIfTheServiceIsNotASubclassOfCommand()
{
$container = new ContainerBuilder();
$container->setResourceTracking(false);
$container->addCompilerPass(new AddConsoleCommandPass(), PassConfig::TYPE_BEFORE_REMOVING);
$definition = new Definition('SplObjectStorage');
$definition->addTag('console.command');
$container->setDefinition('my-command', $definition);
$container->compile();
}
public function testProcessPrivateServicesWithSameCommand()
{
$container = new ContainerBuilder();
$className = 'Symfony\Component\Console\Tests\DependencyInjection\MyCommand';
$definition1 = new Definition($className);
$definition1->addTag('console.command')->setPublic(false);
$definition2 = new Definition($className);
$definition2->addTag('console.command')->setPublic(false);
$container->setDefinition('my-command1', $definition1);
$container->setDefinition('my-command2', $definition2);
(new AddConsoleCommandPass())->process($container);
$alias1 = 'console.command.symfony_component_console_tests_dependencyinjection_mycommand';
$alias2 = $alias1.'_my-command2';
$this->assertTrue($container->hasAlias($alias1));
$this->assertTrue($container->hasAlias($alias2));
}
public function testProcessOnChildDefinitionWithClass()
{
$container = new ContainerBuilder();
$container->addCompilerPass(new AddConsoleCommandPass(), PassConfig::TYPE_BEFORE_REMOVING);
$className = 'Symfony\Component\Console\Tests\DependencyInjection\MyCommand';
$parentId = 'my-parent-command';
$childId = 'my-child-command';
$parentDefinition = new Definition(/* no class */);
$parentDefinition->setAbstract(true)->setPublic(false);
$childDefinition = new ChildDefinition($parentId);
$childDefinition->addTag('console.command')->setPublic(true);
$childDefinition->setClass($className);
$container->setDefinition($parentId, $parentDefinition);
$container->setDefinition($childId, $childDefinition);
$container->compile();
$command = $container->get($childId);
$this->assertInstanceOf($className, $command);
}
public function testProcessOnChildDefinitionWithParentClass()
{
$container = new ContainerBuilder();
$container->addCompilerPass(new AddConsoleCommandPass(), PassConfig::TYPE_BEFORE_REMOVING);
$className = 'Symfony\Component\Console\Tests\DependencyInjection\MyCommand';
$parentId = 'my-parent-command';
$childId = 'my-child-command';
$parentDefinition = new Definition($className);
$parentDefinition->setAbstract(true)->setPublic(false);
$childDefinition = new ChildDefinition($parentId);
$childDefinition->addTag('console.command')->setPublic(true);
$container->setDefinition($parentId, $parentDefinition);
$container->setDefinition($childId, $childDefinition);
$container->compile();
$command = $container->get($childId);
$this->assertInstanceOf($className, $command);
}
/**
* @expectedException \RuntimeException
* @expectedExceptionMessage The definition for "my-child-command" has no class.
*/
public function testProcessOnChildDefinitionWithoutClass()
{
$container = new ContainerBuilder();
$container->addCompilerPass(new AddConsoleCommandPass(), PassConfig::TYPE_BEFORE_REMOVING);
$parentId = 'my-parent-command';
$childId = 'my-child-command';
$parentDefinition = new Definition();
$parentDefinition->setAbstract(true)->setPublic(false);
$childDefinition = new ChildDefinition($parentId);
$childDefinition->addTag('console.command')->setPublic(true);
$container->setDefinition($parentId, $parentDefinition);
$container->setDefinition($childId, $childDefinition);
$container->compile();
}
}
class MyCommand extends Command
{
}
class NamedCommand extends Command
{
protected static $defaultName = 'default';
}

View File

@@ -11,6 +11,7 @@
namespace Symfony\Component\Console\Tests\Descriptor;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@@ -18,7 +19,7 @@ use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\BufferedOutput;
abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase
abstract class AbstractDescriptorTest extends TestCase
{
/** @dataProvider getDescribeInputArgumentTestData */
public function testDescribeInputArgument(InputArgument $argument, $expectedDescription)
@@ -86,7 +87,7 @@ abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase
abstract protected function getFormat();
private function getDescriptionTestData(array $objects)
protected function getDescriptionTestData(array $objects)
{
$data = array();
foreach ($objects as $name => $object) {
@@ -97,10 +98,10 @@ abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase
return $data;
}
protected function assertDescription($expectedDescription, $describedObject)
protected function assertDescription($expectedDescription, $describedObject, array $options = array())
{
$output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
$this->getDescriptor()->describe($output, $describedObject, array('raw_output' => true));
$this->getDescriptor()->describe($output, $describedObject, $options + array('raw_output' => true));
$this->assertEquals(trim($expectedDescription), trim(str_replace(PHP_EOL, "\n", $output->fetch())));
}
}

View File

@@ -26,10 +26,10 @@ class JsonDescriptorTest extends AbstractDescriptorTest
return 'json';
}
protected function assertDescription($expectedDescription, $describedObject)
protected function assertDescription($expectedDescription, $describedObject, array $options = array())
{
$output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
$this->getDescriptor()->describe($output, $describedObject, array('raw_output' => true));
$this->getDescriptor()->describe($output, $describedObject, $options + array('raw_output' => true));
$this->assertEquals(json_decode(trim($expectedDescription), true), json_decode(trim(str_replace(PHP_EOL, "\n", $output->fetch())), true));
}
}

View File

@@ -12,9 +12,27 @@
namespace Symfony\Component\Console\Tests\Descriptor;
use Symfony\Component\Console\Descriptor\MarkdownDescriptor;
use Symfony\Component\Console\Tests\Fixtures\DescriptorApplicationMbString;
use Symfony\Component\Console\Tests\Fixtures\DescriptorCommandMbString;
class MarkdownDescriptorTest extends AbstractDescriptorTest
{
public function getDescribeCommandTestData()
{
return $this->getDescriptionTestData(array_merge(
ObjectsProvider::getCommands(),
array('command_mbstring' => new DescriptorCommandMbString())
));
}
public function getDescribeApplicationTestData()
{
return $this->getDescriptionTestData(array_merge(
ObjectsProvider::getApplications(),
array('application_mbstring' => new DescriptorApplicationMbString())
));
}
protected function getDescriptor()
{
return new MarkdownDescriptor();

View File

@@ -31,6 +31,8 @@ class ObjectsProvider
'input_argument_2' => new InputArgument('argument_name', InputArgument::IS_ARRAY, 'argument description'),
'input_argument_3' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', 'default_value'),
'input_argument_4' => new InputArgument('argument_name', InputArgument::REQUIRED, "multiline\nargument description"),
'input_argument_with_style' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', '<comment>style</>'),
'input_argument_with_default_inf_value' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', INF),
);
}
@@ -43,6 +45,9 @@ class ObjectsProvider
'input_option_4' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'option description', array()),
'input_option_5' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, "multiline\noption description"),
'input_option_6' => new InputOption('option_name', array('o', 'O'), InputOption::VALUE_REQUIRED, 'option with multiple shortcuts'),
'input_option_with_style' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description', '<comment>style</>'),
'input_option_with_style_array' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'option description', array('<comment>Hello</comment>', '<info>world</info>')),
'input_option_with_default_inf_value' => new InputOption('option_name', 'o', InputOption::VALUE_OPTIONAL, 'option description', INF),
);
}

View File

@@ -12,9 +12,35 @@
namespace Symfony\Component\Console\Tests\Descriptor;
use Symfony\Component\Console\Descriptor\TextDescriptor;
use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication2;
use Symfony\Component\Console\Tests\Fixtures\DescriptorApplicationMbString;
use Symfony\Component\Console\Tests\Fixtures\DescriptorCommandMbString;
class TextDescriptorTest extends AbstractDescriptorTest
{
public function getDescribeCommandTestData()
{
return $this->getDescriptionTestData(array_merge(
ObjectsProvider::getCommands(),
array('command_mbstring' => new DescriptorCommandMbString())
));
}
public function getDescribeApplicationTestData()
{
return $this->getDescriptionTestData(array_merge(
ObjectsProvider::getApplications(),
array('application_mbstring' => new DescriptorApplicationMbString())
));
}
public function testDescribeApplicationWithFilteredNamespace()
{
$application = new DescriptorApplication2();
$this->assertDescription(file_get_contents(__DIR__.'/../Fixtures/application_filtered_namespace.txt'), $application, array('namespace' => 'command4'));
}
protected function getDescriptor()
{
return new TextDescriptor();

View File

@@ -0,0 +1,156 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Tests\EventListener;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Event\ConsoleErrorEvent;
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Symfony\Component\Console\EventListener\ErrorListener;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\Input;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\StringInput;
use Symfony\Component\Console\Output\OutputInterface;
class ErrorListenerTest extends TestCase
{
public function testOnConsoleError()
{
$error = new \TypeError('An error occurred');
$logger = $this->getLogger();
$logger
->expects($this->once())
->method('error')
->with('Error thrown while running command "{command}". Message: "{message}"', array('exception' => $error, 'command' => 'test:run --foo=baz buzz', 'message' => 'An error occurred'))
;
$listener = new ErrorListener($logger);
$listener->onConsoleError(new ConsoleErrorEvent(new ArgvInput(array('console.php', 'test:run', '--foo=baz', 'buzz')), $this->getOutput(), $error, new Command('test:run')));
}
public function testOnConsoleErrorWithNoCommandAndNoInputString()
{
$error = new \RuntimeException('An error occurred');
$logger = $this->getLogger();
$logger
->expects($this->once())
->method('error')
->with('An error occurred while using the console. Message: "{message}"', array('exception' => $error, 'message' => 'An error occurred'))
;
$listener = new ErrorListener($logger);
$listener->onConsoleError(new ConsoleErrorEvent(new NonStringInput(), $this->getOutput(), $error));
}
public function testOnConsoleTerminateForNonZeroExitCodeWritesToLog()
{
$logger = $this->getLogger();
$logger
->expects($this->once())
->method('debug')
->with('Command "{command}" exited with code "{code}"', array('command' => 'test:run', 'code' => 255))
;
$listener = new ErrorListener($logger);
$listener->onConsoleTerminate($this->getConsoleTerminateEvent(new ArgvInput(array('console.php', 'test:run')), 255));
}
public function testOnConsoleTerminateForZeroExitCodeDoesNotWriteToLog()
{
$logger = $this->getLogger();
$logger
->expects($this->never())
->method('debug')
;
$listener = new ErrorListener($logger);
$listener->onConsoleTerminate($this->getConsoleTerminateEvent(new ArgvInput(array('console.php', 'test:run')), 0));
}
public function testGetSubscribedEvents()
{
$this->assertEquals(
array(
'console.error' => array('onConsoleError', -128),
'console.terminate' => array('onConsoleTerminate', -128),
),
ErrorListener::getSubscribedEvents()
);
}
public function testAllKindsOfInputCanBeLogged()
{
$logger = $this->getLogger();
$logger
->expects($this->exactly(3))
->method('debug')
->with('Command "{command}" exited with code "{code}"', array('command' => 'test:run --foo=bar', 'code' => 255))
;
$listener = new ErrorListener($logger);
$listener->onConsoleTerminate($this->getConsoleTerminateEvent(new ArgvInput(array('console.php', 'test:run', '--foo=bar')), 255));
$listener->onConsoleTerminate($this->getConsoleTerminateEvent(new ArrayInput(array('name' => 'test:run', '--foo' => 'bar')), 255));
$listener->onConsoleTerminate($this->getConsoleTerminateEvent(new StringInput('test:run --foo=bar'), 255));
}
public function testCommandNameIsDisplayedForNonStringableInput()
{
$logger = $this->getLogger();
$logger
->expects($this->once())
->method('debug')
->with('Command "{command}" exited with code "{code}"', array('command' => 'test:run', 'code' => 255))
;
$listener = new ErrorListener($logger);
$listener->onConsoleTerminate($this->getConsoleTerminateEvent($this->getMockBuilder(InputInterface::class)->getMock(), 255));
}
private function getLogger()
{
return $this->getMockForAbstractClass(LoggerInterface::class);
}
private function getConsoleTerminateEvent(InputInterface $input, $exitCode)
{
return new ConsoleTerminateEvent(new Command('test:run'), $input, $this->getOutput(), $exitCode);
}
private function getOutput()
{
return $this->getMockBuilder(OutputInterface::class)->getMock();
}
}
class NonStringInput extends Input
{
public function getFirstArgument()
{
}
public function hasParameterOption($values, $onlyParams = false)
{
}
public function getParameterOption($values, $default = false, $onlyParams = false)
{
}
public function parse()
{
}
}

View File

@@ -20,5 +20,7 @@ class DescriptorApplication2 extends Application
parent::__construct('My Symfony application', 'v1.0');
$this->add(new DescriptorCommand1());
$this->add(new DescriptorCommand2());
$this->add(new DescriptorCommand3());
$this->add(new DescriptorCommand4());
}
}

View File

@@ -0,0 +1,24 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Tests\Fixtures;
use Symfony\Component\Console\Application;
class DescriptorApplicationMbString extends Application
{
public function __construct()
{
parent::__construct('MbString åpplicätion');
$this->add(new DescriptorCommandMbString());
}
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Tests\Fixtures;
use Symfony\Component\Console\Command\Command;
class DescriptorCommand3 extends Command
{
protected function configure()
{
$this
->setName('descriptor:command3')
->setDescription('command 3 description')
->setHelp('command 3 help')
->setHidden(true)
;
}
}

View File

@@ -0,0 +1,25 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Tests\Fixtures;
use Symfony\Component\Console\Command\Command;
class DescriptorCommand4 extends Command
{
protected function configure()
{
$this
->setName('descriptor:command4')
->setAliases(array('descriptor:alias_command4', 'command4:descriptor'))
;
}
}

View File

@@ -0,0 +1,32 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Tests\Fixtures;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
class DescriptorCommandMbString extends Command
{
protected function configure()
{
$this
->setName('descriptor:åèä')
->setDescription('command åèä description')
->setHelp('command åèä help')
->addUsage('-o|--option_name <argument_name>')
->addUsage('<argument_name>')
->addArgument('argument_åèä', InputArgument::REQUIRED)
->addOption('option_åèä', 'o', InputOption::VALUE_NONE)
;
}
}

View File

@@ -26,7 +26,7 @@ class DummyOutput extends BufferedOutput
public function getLogs()
{
$logs = array();
foreach (explode("\n", trim($this->fetch())) as $message) {
foreach (explode(PHP_EOL, trim($this->fetch())) as $message) {
preg_match('/^\[(.*)\] (.*)/', $message, $matches);
$logs[] = sprintf('%s %s', $matches[1], $matches[2]);
}

View File

@@ -23,7 +23,7 @@ class Foo3Command extends Command
throw new \Exception('Second exception <comment>comment</comment>', 0, $e);
}
} catch (\Exception $e) {
throw new \Exception('Third exception <fg=blue;bg=red>comment</>', 0, $e);
throw new \Exception('Third exception <fg=blue;bg=red>comment</>', 404, $e);
}
}
}

View File

@@ -0,0 +1,28 @@
<?php
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Command\LockableTrait;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class FooLock2Command extends Command
{
use LockableTrait;
protected function configure()
{
$this->setName('foo:lock2');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
try {
$this->lock();
$this->lock();
} catch (LogicException $e) {
return 1;
}
return 2;
}
}

View File

@@ -0,0 +1,27 @@
<?php
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Command\LockableTrait;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class FooLockCommand extends Command
{
use LockableTrait;
protected function configure()
{
$this->setName('foo:lock');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
if (!$this->lock()) {
return 1;
}
$this->release();
return 2;
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class FooOptCommand extends Command
{
public $input;
public $output;
protected function configure()
{
$this
->setName('foo:bar')
->setDescription('The foo:bar command')
->setAliases(array('afoobar'))
->addOption('fooopt', 'fo', InputOption::VALUE_OPTIONAL, 'fooopt description')
;
}
protected function interact(InputInterface $input, OutputInterface $output)
{
$output->writeln('interact called');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->input = $input;
$this->output = $output;
$output->writeln('called');
$output->writeln($this->input->getOption('fooopt'));
}
}

View File

@@ -0,0 +1,11 @@
<?php
use Symfony\Component\Console\Command\Command;
class FooSameCaseLowercaseCommand extends Command
{
protected function configure()
{
$this->setName('foo:bar')->setDescription('foo:bar command');
}
}

View File

@@ -0,0 +1,11 @@
<?php
use Symfony\Component\Console\Command\Command;
class FooSameCaseUppercaseCommand extends Command
{
protected function configure()
{
$this->setName('foo:BAR')->setDescription('foo:BAR command');
}
}

View File

@@ -2,10 +2,10 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure has single blank line at start when using block element
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->caution('Lorem ipsum dolor sit amet');
};

View File

@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure has single blank line between titles and blocks
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->title('Title');
$output->warning('Lorem ipsum dolor sit amet');
$output->title('Title');

View File

@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure that all lines are aligned to the begin of the first line in a very long line block
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->block(
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
'CUSTOM',

View File

@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
// ensure long words are properly wrapped in blocks
return function (InputInterface $input, OutputInterface $output) {
$word = 'Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon';
$sfStyle = new SymfonyStyleWithForcedLineLength($input, $output);
$sfStyle = new SymfonyStyle($input, $output);
$sfStyle->block($word, 'CUSTOM', 'fg=white;bg=blue', ' § ', false);
};

View File

@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
// ensure that all lines are aligned to the begin of the first one and start with '//' in a very long line comment
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->comment(
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum'
);

View File

@@ -2,7 +2,6 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
// ensure that nested tags have no effect on the color of the '//' prefix

View File

@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
// ensure that block() behaves properly with a prefix and without type
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->block(
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
null,

View File

@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
// ensure that block() behaves properly with a type and without prefix
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->block(
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
'TEST'

View File

@@ -2,12 +2,12 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
// ensure that block() output is properly formatted (even padding lines)
return function (InputInterface $input, OutputInterface $output) {
$output->setDecorated(true);
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->success(
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
'TEST'

View File

@@ -0,0 +1,13 @@
<?php
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure symfony style helper methods handle trailing backslashes properly when decorating user texts
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyle($input, $output);
$output->title('Title ending with \\');
$output->section('Section ending with \\');
};

View File

@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure has single blank line between blocks
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->warning('Warning');
$output->caution('Caution');
$output->error('Error');

View File

@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure has single blank line between two titles
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->title('First title');
$output->title('Second title');
};

View File

@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure has single blank line after any text and a title
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->write('Lorem ipsum dolor sit amet');
$output->title('First title');

View File

@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure has proper line ending before outputing a text block like with SymfonyStyle::listing() or SymfonyStyle::text()
//Ensure has proper line ending before outputting a text block like with SymfonyStyle::listing() or SymfonyStyle::text()
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->writeln('Lorem ipsum dolor sit amet');
$output->listing(array(

View File

@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure has proper blank line after text block when using a block like with SymfonyStyle::success
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->listing(array(
'Lorem ipsum dolor sit amet',

View File

@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure questions do not output anything when input is non-interactive
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->title('Title');
$output->askHidden('Hidden question');
$output->choice('Choice question with default', array('choice1', 'choice2'), 'choice1');

View File

@@ -1,9 +1,9 @@
<?php
use Symfony\Component\Console\Helper\TableCell;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Helper\TableCell;
use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure formatting tables when using multiple headers with TableCell
return function (InputInterface $input, OutputInterface $output) {
@@ -21,6 +21,6 @@ return function (InputInterface $input, OutputInterface $output) {
array('978-0804169127', 'Divine Comedy'),
);
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->table($headers, $rows);
};

View File

@@ -2,10 +2,10 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure that all lines are aligned to the begin of the first line in a multi-line block
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output = new SymfonyStyle($input, $output);
$output->block(array('Custom block', 'Second custom block line'), 'CUSTOM', 'fg=white;bg=green', 'X ', true);
};

View File

@@ -0,0 +1,19 @@
<?php
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure that questions have the expected outputs
return function (InputInterface $input, OutputInterface $output) {
$output = new SymfonyStyle($input, $output);
$stream = fopen('php://memory', 'r+', false);
fwrite($stream, "Foo\nBar\nBaz");
rewind($stream);
$input->setStream($stream);
$output->ask('What\'s your name?');
$output->ask('How are you?');
$output->ask('Where do you come from?');
};

View File

@@ -0,0 +1,7 @@
What's your name?:
>
How are you?:
>
Where do you come from?:
>

View File

@@ -0,0 +1,7 @@
Title ending with \
===================
Section ending with \
---------------------

View File

@@ -0,0 +1,21 @@
<?php
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class TestTiti extends Command
{
protected function configure()
{
$this
->setName('test-titi')
->setDescription('The test:titi command')
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->write('test-titi');
}
}

View File

@@ -0,0 +1,22 @@
<?php
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class TestToto extends Command
{
protected function configure()
{
$this
->setName('test-toto')
->setDescription('The test-toto command')
->setAliases(array('test'))
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->write('test-toto');
}
}

View File

@@ -1 +1,156 @@
{"commands":[{"name":"help","usage":["help [--format FORMAT] [--raw] [--] [<command_name>]"],"description":"Displays help for a command","help":"The <info>help<\/info> command displays help for a given command:\n\n <info>php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the <info>list<\/info> command.","definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"list","usage":["list [--raw] [--format FORMAT] [--] [<namespace>]"],"description":"Lists commands","help":"The <info>list<\/info> command lists all commands:\n\n <info>php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n <info>php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n <info>php app\/console list --raw<\/info>","definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"}}}}],"namespaces":[{"id":"_global","commands":["help","list"]}]}
{
"commands": [
{
"name": "help",
"hidden": false,
"usage": [
"help [--format FORMAT] [--raw] [--] [<command_name>]"
],
"description": "Displays help for a command",
"help": "The <info>help<\/info> command displays help for a given command:\n\n <info>php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the <info>list<\/info> command.",
"definition": {
"arguments": {
"command_name": {
"name": "command_name",
"is_required": false,
"is_array": false,
"description": "The command name",
"default": "help"
}
},
"options": {
"format": {
"name": "--format",
"shortcut": "",
"accept_value": true,
"is_value_required": true,
"is_multiple": false,
"description": "The output format (txt, xml, json, or md)",
"default": "txt"
},
"raw": {
"name": "--raw",
"shortcut": "",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "To output raw command help",
"default": false
},
"help": {
"name": "--help",
"shortcut": "-h",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "Display this help message",
"default": false
},
"quiet": {
"name": "--quiet",
"shortcut": "-q",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "Do not output any message",
"default": false
},
"verbose": {
"name": "--verbose",
"shortcut": "-v|-vv|-vvv",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
"default": false
},
"version": {
"name": "--version",
"shortcut": "-V",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "Display this application version",
"default": false
},
"ansi": {
"name": "--ansi",
"shortcut": "",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "Force ANSI output",
"default": false
},
"no-ansi": {
"name": "--no-ansi",
"shortcut": "",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "Disable ANSI output",
"default": false
},
"no-interaction": {
"name": "--no-interaction",
"shortcut": "-n",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "Do not ask any interactive question",
"default": false
}
}
}
},
{
"name": "list",
"hidden": false,
"usage": [
"list [--raw] [--format FORMAT] [--] [<namespace>]"
],
"description": "Lists commands",
"help": "The <info>list<\/info> command lists all commands:\n\n <info>php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n <info>php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n <info>php app\/console list --raw<\/info>",
"definition": {
"arguments": {
"namespace": {
"name": "namespace",
"is_required": false,
"is_array": false,
"description": "The namespace name",
"default": null
}
},
"options": {
"raw": {
"name": "--raw",
"shortcut": "",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "To output raw command list",
"default": false
},
"format": {
"name": "--format",
"shortcut": "",
"accept_value": true,
"is_value_required": true,
"is_multiple": false,
"description": "The output format (txt, xml, json, or md)",
"default": "txt"
}
}
}
}
],
"namespaces": [
{
"id": "_global",
"commands": [
"help",
"list"
]
}
]
}

View File

@@ -1,181 +1,172 @@
UNKNOWN
=======
Console Tool
============
* help
* list
* [`help`](#help)
* [`list`](#list)
help
----
`help`
------
* Description: Displays help for a command
* Usage:
Displays help for a command
* `help [--format FORMAT] [--raw] [--] [<command_name>]`
### Usage
The <info>help</info> command displays help for a given command:
* `help [--format FORMAT] [--raw] [--] [<command_name>]`
<info>php app/console help list</info>
The help command displays help for a given command:
You can also output the help in other formats by using the <comment>--format</comment> option:
php app/console help list
<info>php app/console help --format=xml list</info>
You can also output the help in other formats by using the --format option:
To display the list of available commands, please use the <info>list</info> command.
php app/console help --format=xml list
### Arguments:
To display the list of available commands, please use the list command.
**command_name:**
### Arguments
#### `command_name`
The command name
* Name: command_name
* Is required: no
* Is array: no
* Description: The command name
* Default: `'help'`
### Options:
### Options
**format:**
#### `--format`
The output format (txt, xml, json, or md)
* Name: `--format`
* Shortcut: <none>
* Accept value: yes
* Is value required: yes
* Is multiple: no
* Description: The output format (txt, xml, json, or md)
* Default: `'txt'`
**raw:**
#### `--raw`
To output raw command help
* Name: `--raw`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: To output raw command help
* Default: `false`
**help:**
#### `--help|-h`
Display this help message
* Name: `--help`
* Shortcut: `-h`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Display this help message
* Default: `false`
**quiet:**
#### `--quiet|-q`
Do not output any message
* Name: `--quiet`
* Shortcut: `-q`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Do not output any message
* Default: `false`
**verbose:**
#### `--verbose|-v|-vv|-vvv`
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Name: `--verbose`
* Shortcut: `-v|-vv|-vvv`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Default: `false`
**version:**
#### `--version|-V`
Display this application version
* Name: `--version`
* Shortcut: `-V`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Display this application version
* Default: `false`
**ansi:**
#### `--ansi`
Force ANSI output
* Name: `--ansi`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Force ANSI output
* Default: `false`
**no-ansi:**
#### `--no-ansi`
Disable ANSI output
* Name: `--no-ansi`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Disable ANSI output
* Default: `false`
**no-interaction:**
#### `--no-interaction|-n`
Do not ask any interactive question
* Name: `--no-interaction`
* Shortcut: `-n`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Do not ask any interactive question
* Default: `false`
list
----
`list`
------
* Description: Lists commands
* Usage:
Lists commands
* `list [--raw] [--format FORMAT] [--] [<namespace>]`
### Usage
The <info>list</info> command lists all commands:
* `list [--raw] [--format FORMAT] [--] [<namespace>]`
<info>php app/console list</info>
The list command lists all commands:
php app/console list
You can also display the commands for a specific namespace:
<info>php app/console list test</info>
php app/console list test
You can also output the information in other formats by using the <comment>--format</comment> option:
You can also output the information in other formats by using the --format option:
<info>php app/console list --format=xml</info>
php app/console list --format=xml
It's also possible to get raw list of commands (useful for embedding command runner):
<info>php app/console list --raw</info>
php app/console list --raw
### Arguments:
### Arguments
**namespace:**
#### `namespace`
The namespace name
* Name: namespace
* Is required: no
* Is array: no
* Description: The namespace name
* Default: `NULL`
### Options:
### Options
**raw:**
#### `--raw`
To output raw command list
* Name: `--raw`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: To output raw command list
* Default: `false`
**format:**
#### `--format`
The output format (txt, xml, json, or md)
* Name: `--format`
* Shortcut: <none>
* Accept value: yes
* Is value required: yes
* Is multiple: no
* Description: The output format (txt, xml, json, or md)
* Default: `'txt'`

View File

@@ -1,4 +1,4 @@
<info>Console Tool</info>
Console Tool
<comment>Usage:</comment>
command [options] [arguments]

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<symfony>
<commands>
<command id="help" name="help">
<command id="help" name="help" hidden="0">
<usages>
<usage>help [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
</usages>
@@ -56,7 +56,7 @@
</option>
</options>
</command>
<command id="list" name="list">
<command id="list" name="list" hidden="0">
<usages>
<usage>list [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
</usages>

File diff suppressed because one or more lines are too long

View File

@@ -1,376 +1,431 @@
My Symfony application
======================
My Symfony application v1.0
===========================
* alias1
* alias2
* help
* list
* [`alias1`](#descriptorcommand1)
* [`alias2`](#descriptorcommand1)
* [`help`](#help)
* [`list`](#list)
**command4:**
* [`command4:descriptor`](#descriptorcommand4)
**descriptor:**
* descriptor:command1
* descriptor:command2
* [`descriptor:alias_command4`](#descriptorcommand4)
* [`descriptor:command1`](#descriptorcommand1)
* [`descriptor:command2`](#descriptorcommand2)
* [`descriptor:command4`](#descriptorcommand4)
help
----
`help`
------
* Description: Displays help for a command
* Usage:
Displays help for a command
* `help [--format FORMAT] [--raw] [--] [<command_name>]`
### Usage
The <info>help</info> command displays help for a given command:
* `help [--format FORMAT] [--raw] [--] [<command_name>]`
<info>php app/console help list</info>
The help command displays help for a given command:
You can also output the help in other formats by using the <comment>--format</comment> option:
php app/console help list
<info>php app/console help --format=xml list</info>
You can also output the help in other formats by using the --format option:
To display the list of available commands, please use the <info>list</info> command.
php app/console help --format=xml list
### Arguments:
To display the list of available commands, please use the list command.
**command_name:**
### Arguments
#### `command_name`
The command name
* Name: command_name
* Is required: no
* Is array: no
* Description: The command name
* Default: `'help'`
### Options:
### Options
**format:**
#### `--format`
The output format (txt, xml, json, or md)
* Name: `--format`
* Shortcut: <none>
* Accept value: yes
* Is value required: yes
* Is multiple: no
* Description: The output format (txt, xml, json, or md)
* Default: `'txt'`
**raw:**
#### `--raw`
To output raw command help
* Name: `--raw`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: To output raw command help
* Default: `false`
**help:**
#### `--help|-h`
Display this help message
* Name: `--help`
* Shortcut: `-h`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Display this help message
* Default: `false`
**quiet:**
#### `--quiet|-q`
Do not output any message
* Name: `--quiet`
* Shortcut: `-q`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Do not output any message
* Default: `false`
**verbose:**
#### `--verbose|-v|-vv|-vvv`
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Name: `--verbose`
* Shortcut: `-v|-vv|-vvv`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Default: `false`
**version:**
#### `--version|-V`
Display this application version
* Name: `--version`
* Shortcut: `-V`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Display this application version
* Default: `false`
**ansi:**
#### `--ansi`
Force ANSI output
* Name: `--ansi`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Force ANSI output
* Default: `false`
**no-ansi:**
#### `--no-ansi`
Disable ANSI output
* Name: `--no-ansi`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Disable ANSI output
* Default: `false`
**no-interaction:**
#### `--no-interaction|-n`
Do not ask any interactive question
* Name: `--no-interaction`
* Shortcut: `-n`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Do not ask any interactive question
* Default: `false`
list
----
`list`
------
* Description: Lists commands
* Usage:
Lists commands
* `list [--raw] [--format FORMAT] [--] [<namespace>]`
### Usage
The <info>list</info> command lists all commands:
* `list [--raw] [--format FORMAT] [--] [<namespace>]`
<info>php app/console list</info>
The list command lists all commands:
php app/console list
You can also display the commands for a specific namespace:
<info>php app/console list test</info>
php app/console list test
You can also output the information in other formats by using the <comment>--format</comment> option:
You can also output the information in other formats by using the --format option:
<info>php app/console list --format=xml</info>
php app/console list --format=xml
It's also possible to get raw list of commands (useful for embedding command runner):
<info>php app/console list --raw</info>
php app/console list --raw
### Arguments:
### Arguments
**namespace:**
#### `namespace`
The namespace name
* Name: namespace
* Is required: no
* Is array: no
* Description: The namespace name
* Default: `NULL`
### Options:
### Options
**raw:**
#### `--raw`
To output raw command list
* Name: `--raw`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: To output raw command list
* Default: `false`
**format:**
#### `--format`
The output format (txt, xml, json, or md)
* Name: `--format`
* Shortcut: <none>
* Accept value: yes
* Is value required: yes
* Is multiple: no
* Description: The output format (txt, xml, json, or md)
* Default: `'txt'`
descriptor:command1
-------------------
`descriptor:command1`
---------------------
* Description: command 1 description
* Usage:
command 1 description
* `descriptor:command1`
* `alias1`
* `alias2`
### Usage
* `descriptor:command1`
* `alias1`
* `alias2`
command 1 help
### Options:
### Options
**help:**
#### `--help|-h`
Display this help message
* Name: `--help`
* Shortcut: `-h`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Display this help message
* Default: `false`
**quiet:**
#### `--quiet|-q`
Do not output any message
* Name: `--quiet`
* Shortcut: `-q`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Do not output any message
* Default: `false`
**verbose:**
#### `--verbose|-v|-vv|-vvv`
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Name: `--verbose`
* Shortcut: `-v|-vv|-vvv`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Default: `false`
**version:**
#### `--version|-V`
Display this application version
* Name: `--version`
* Shortcut: `-V`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Display this application version
* Default: `false`
**ansi:**
#### `--ansi`
Force ANSI output
* Name: `--ansi`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Force ANSI output
* Default: `false`
**no-ansi:**
#### `--no-ansi`
Disable ANSI output
* Name: `--no-ansi`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Disable ANSI output
* Default: `false`
**no-interaction:**
#### `--no-interaction|-n`
Do not ask any interactive question
* Name: `--no-interaction`
* Shortcut: `-n`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Do not ask any interactive question
* Default: `false`
descriptor:command2
-------------------
`descriptor:command2`
---------------------
* Description: command 2 description
* Usage:
command 2 description
* `descriptor:command2 [-o|--option_name] [--] <argument_name>`
* `descriptor:command2 -o|--option_name <argument_name>`
* `descriptor:command2 <argument_name>`
### Usage
* `descriptor:command2 [-o|--option_name] [--] <argument_name>`
* `descriptor:command2 -o|--option_name <argument_name>`
* `descriptor:command2 <argument_name>`
command 2 help
### Arguments:
### Arguments
**argument_name:**
#### `argument_name`
* Name: argument_name
* Is required: yes
* Is array: no
* Description: <none>
* Default: `NULL`
### Options:
### Options
**option_name:**
#### `--option_name|-o`
* Name: `--option_name`
* Shortcut: `-o`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: <none>
* Default: `false`
**help:**
#### `--help|-h`
Display this help message
* Name: `--help`
* Shortcut: `-h`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Display this help message
* Default: `false`
**quiet:**
#### `--quiet|-q`
Do not output any message
* Name: `--quiet`
* Shortcut: `-q`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Do not output any message
* Default: `false`
**verbose:**
#### `--verbose|-v|-vv|-vvv`
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Name: `--verbose`
* Shortcut: `-v|-vv|-vvv`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Default: `false`
**version:**
#### `--version|-V`
Display this application version
* Name: `--version`
* Shortcut: `-V`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Display this application version
* Default: `false`
**ansi:**
#### `--ansi`
Force ANSI output
* Name: `--ansi`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Force ANSI output
* Default: `false`
**no-ansi:**
#### `--no-ansi`
Disable ANSI output
* Name: `--no-ansi`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Disable ANSI output
* Default: `false`
**no-interaction:**
#### `--no-interaction|-n`
Do not ask any interactive question
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
`descriptor:command4`
---------------------
### Usage
* `descriptor:command4`
* `descriptor:alias_command4`
* `command4:descriptor`
### Options
#### `--help|-h`
Display this help message
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--quiet|-q`
Do not output any message
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--verbose|-v|-vv|-vvv`
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--version|-V`
Display this application version
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--ansi`
Force ANSI output
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--no-ansi`
Disable ANSI output
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--no-interaction|-n`
Do not ask any interactive question
* Name: `--no-interaction`
* Shortcut: `-n`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: Do not ask any interactive question
* Default: `false`

View File

@@ -1,4 +1,4 @@
<info>My Symfony application</info> version <comment>v1.0</comment>
My Symfony application <info>v1.0</info>
<comment>Usage:</comment>
command [options] [arguments]
@@ -13,10 +13,9 @@
<info>-v|vv|vvv, --verbose</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
<comment>Available commands:</comment>
<info>alias1</info> command 1 description
<info>alias2</info> command 1 description
<info>help</info> Displays help for a command
<info>list</info> Lists commands
<comment>descriptor</comment>
<info>descriptor:command1</info> command 1 description
<info>descriptor:command1</info> [alias1|alias2] command 1 description
<info>descriptor:command2</info> command 2 description
<info>descriptor:command4</info> [descriptor:alias_command4|command4:descriptor]

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<symfony name="My Symfony application" version="v1.0">
<commands>
<command id="help" name="help">
<command id="help" name="help" hidden="0">
<usages>
<usage>help [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
</usages>
@@ -56,7 +56,7 @@
</option>
</options>
</command>
<command id="list" name="list">
<command id="list" name="list" hidden="0">
<usages>
<usage>list [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
</usages>
@@ -94,7 +94,7 @@
</option>
</options>
</command>
<command id="descriptor:command1" name="descriptor:command1">
<command id="descriptor:command1" name="descriptor:command1" hidden="0">
<usages>
<usage>descriptor:command1</usage>
<usage>alias1</usage>
@@ -127,7 +127,7 @@
</option>
</options>
</command>
<command id="descriptor:command2" name="descriptor:command2">
<command id="descriptor:command2" name="descriptor:command2" hidden="0">
<usages>
<usage>descriptor:command2 [-o|--option_name] [--] &lt;argument_name&gt;</usage>
<usage>descriptor:command2 -o|--option_name &lt;argument_name&gt;</usage>
@@ -168,6 +168,70 @@
</option>
</options>
</command>
<command id="descriptor:command3" name="descriptor:command3" hidden="1">
<usages>
<usage>descriptor:command3</usage>
</usages>
<description>command 3 description</description>
<help>command 3 help</help>
<arguments/>
<options>
<option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
<description>Display this help message</description>
</option>
<option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
<description>Do not output any message</description>
</option>
<option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
<description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
</option>
<option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
<description>Display this application version</description>
</option>
<option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>Force ANSI output</description>
</option>
<option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>Disable ANSI output</description>
</option>
<option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
<description>Do not ask any interactive question</description>
</option>
</options>
</command>
<command id="descriptor:command4" name="descriptor:command4" hidden="0">
<usages>
<usage>descriptor:command4</usage>
<usage>descriptor:alias_command4</usage>
<usage>command4:descriptor</usage>
</usages>
<description></description>
<help></help>
<arguments/>
<options>
<option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
<description>Display this help message</description>
</option>
<option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
<description>Do not output any message</description>
</option>
<option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
<description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
</option>
<option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
<description>Display this application version</description>
</option>
<option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>Force ANSI output</description>
</option>
<option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>Disable ANSI output</description>
</option>
<option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
<description>Do not ask any interactive question</description>
</option>
</options>
</command>
</commands>
<namespaces>
<namespace id="_global">
@@ -176,9 +240,15 @@
<command>help</command>
<command>list</command>
</namespace>
<namespace id="command4">
<command>command4:descriptor</command>
</namespace>
<namespace id="descriptor">
<command>descriptor:alias_command4</command>
<command>descriptor:command1</command>
<command>descriptor:command2</command>
<command>descriptor:command3</command>
<command>descriptor:command4</command>
</namespace>
</namespaces>
</symfony>

View File

@@ -1,4 +1,4 @@
<info>Console Tool</info>
My Symfony application <info>v1.0</info>
<comment>Usage:</comment>
command [options] [arguments]
@@ -12,5 +12,5 @@
<info>-n, --no-interaction</info> Do not ask any interactive question
<info>-v|vv|vvv, --verbose</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
<comment>Available commands for the "foo" namespace:</comment>
<info>foo:bar</info> The foo:bar command
<comment>Available commands for the "command4" namespace:</comment>
<info>command4:descriptor</info>

View File

@@ -1 +1 @@
<info>Console Tool</info>
Console Tool

View File

@@ -0,0 +1,269 @@
MbString åpplicätion
====================
* [`help`](#help)
* [`list`](#list)
**descriptor:**
* [`descriptor:åèä`](#descriptoråèä)
`help`
------
Displays help for a command
### Usage
* `help [--format FORMAT] [--raw] [--] [<command_name>]`
The help command displays help for a given command:
php app/console help list
You can also output the help in other formats by using the --format option:
php app/console help --format=xml list
To display the list of available commands, please use the list command.
### Arguments
#### `command_name`
The command name
* Is required: no
* Is array: no
* Default: `'help'`
### Options
#### `--format`
The output format (txt, xml, json, or md)
* Accept value: yes
* Is value required: yes
* Is multiple: no
* Default: `'txt'`
#### `--raw`
To output raw command help
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--help|-h`
Display this help message
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--quiet|-q`
Do not output any message
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--verbose|-v|-vv|-vvv`
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--version|-V`
Display this application version
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--ansi`
Force ANSI output
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--no-ansi`
Disable ANSI output
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--no-interaction|-n`
Do not ask any interactive question
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
`list`
------
Lists commands
### Usage
* `list [--raw] [--format FORMAT] [--] [<namespace>]`
The list command lists all commands:
php app/console list
You can also display the commands for a specific namespace:
php app/console list test
You can also output the information in other formats by using the --format option:
php app/console list --format=xml
It's also possible to get raw list of commands (useful for embedding command runner):
php app/console list --raw
### Arguments
#### `namespace`
The namespace name
* Is required: no
* Is array: no
* Default: `NULL`
### Options
#### `--raw`
To output raw command list
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--format`
The output format (txt, xml, json, or md)
* Accept value: yes
* Is value required: yes
* Is multiple: no
* Default: `'txt'`
`descriptor:åèä`
----------------
command åèä description
### Usage
* `descriptor:åèä [-o|--option_åèä] [--] <argument_åèä>`
* `descriptor:åèä -o|--option_name <argument_name>`
* `descriptor:åèä <argument_name>`
command åèä help
### Arguments
#### `argument_åèä`
* Is required: yes
* Is array: no
* Default: `NULL`
### Options
#### `--option_åèä|-o`
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--help|-h`
Display this help message
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--quiet|-q`
Do not output any message
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--verbose|-v|-vv|-vvv`
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--version|-V`
Display this application version
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--ansi`
Force ANSI output
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--no-ansi`
Disable ANSI output
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`
#### `--no-interaction|-n`
Do not ask any interactive question
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`

View File

@@ -1,4 +1,4 @@
<info>Console Tool</info>
MbString åpplicätion
<comment>Usage:</comment>
command [options] [arguments]
@@ -13,8 +13,7 @@
<info>-v|vv|vvv, --verbose</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
<comment>Available commands:</comment>
<info>afoobar</info> The foo:bar command
<info>help</info> Displays help for a command
<info>list</info> Lists commands
<comment>foo</comment>
<info>foo:bar</info> The foo:bar command
<info>help</info> Displays help for a command
<info>list</info> Lists commands
<comment>descriptor</comment>
<info>descriptor:åèä</info> command åèä description

View File

@@ -1,6 +1,5 @@
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "foo" is not defined.
Command "foo" is not defined.

View File

@@ -1,8 +1,7 @@
[Symfony\Component\Console\Exception\InvalidOptionException]
The "--foo" option does not exist.
The "--foo" option does not exist.
list [--raw] [--format FORMAT] [--] [<namespace>]

View File

@@ -1,16 +1,16 @@
[Exception]
Third exception comment
In Foo3Command.php line 26:
Third exception <fg=blue;bg=red>comment</>
[Exception]
Second exception comment
In Foo3Command.php line 23:
Second exception <comment>comment</comment>
In Foo3Command.php line 21:
[Exception]
First exception <p>this is html</p>

View File

@@ -1,17 +1,17 @@
 
 [Exception] 
 Third exception comment 
 
In Foo3Command.php line 26:
 
 Third exception <fg=blue;bg=red>comment</> 
 
 
 [Exception] 
 Second exception comment 
 
In Foo3Command.php line 23:
 
 Second exception <comment>comment</comment> 
 
In Foo3Command.php line 21:
 
 [Exception] 
 First exception <p>this is html</p> 
 First exception <p>this is html</p> 
 
foo3:bar

View File

@@ -1,7 +1,6 @@
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "foo" is not define
d.
Command "foo" is not define
d.

View File

@@ -1,6 +1,6 @@
In ApplicationTest.php line %d:
[Exception]
エラーメッセージ

View File

@@ -1,6 +1,6 @@
In ApplicationTest.php line %d:
 
 [Exception] 
 エラーメッセージ 
 

View File

@@ -1,6 +1,6 @@
In ApplicationTest.php line %d:
[Exception]
コマンドの実行中にエラーが
発生しました。

View File

@@ -0,0 +1,9 @@
In ApplicationTest.php line %d:
dont break here <
info>!</info>
foo

View File

@@ -0,0 +1,11 @@
In ApplicationTest.php line %d:
line 1 with extra spaces
line 2
line 4
foo

View File

@@ -1,28 +1,26 @@
Usage:
help [options] [--] [<command_name>]
list [options] [--] [<namespace>]
Arguments:
command The command to execute
command_name The command name [default: "help"]
namespace The namespace name
Options:
--format=FORMAT The output format (txt, xml, json, or md) [default: "txt"]
--raw To output raw command help
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
--raw To output raw command list
--format=FORMAT The output format (txt, xml, json, or md) [default: "txt"]
Help:
The help command displays help for a given command:
php app/console help list
You can also output the help in other formats by using the --format option:
php app/console help --format=xml list
To display the list of available commands, please use the list command.
The list command lists all commands:
php app/console list
You can also display the commands for a specific namespace:
php app/console list test
You can also output the information in other formats by using the --format option:
php app/console list --format=xml
It's also possible to get raw list of commands (useful for embedding command runner):
php app/console list --raw

View File

@@ -9,18 +9,18 @@ Options:
--format=FORMAT The output format (txt, xml, json, or md) [default: "txt"]
Help:
The list command lists all commands:
php app/console list
You can also display the commands for a specific namespace:
php app/console list test
You can also output the information in other formats by using the --format option:
php app/console list --format=xml
It's also possible to get raw list of commands (useful for embedding command runner):
php app/console list --raw
The list command lists all commands:
php app/console list
You can also display the commands for a specific namespace:
php app/console list test
You can also output the information in other formats by using the --format option:
php app/console list --format=xml
It's also possible to get raw list of commands (useful for embedding command runner):
php app/console list --raw

View File

@@ -1 +1,15 @@
{"name":"descriptor:command1","usage":["descriptor:command1", "alias1", "alias2"],"description":"command 1 description","help":"command 1 help","definition":{"arguments":[],"options":[]}}
{
"name": "descriptor:command1",
"hidden": false,
"usage": [
"descriptor:command1",
"alias1",
"alias2"
],
"description": "command 1 description",
"help": "command 1 help",
"definition": {
"arguments": [],
"options": []
}
}

View File

@@ -1,11 +1,12 @@
descriptor:command1
-------------------
`descriptor:command1`
---------------------
* Description: command 1 description
* Usage:
command 1 description
* `descriptor:command1`
* `alias1`
* `alias2`
### Usage
* `descriptor:command1`
* `alias1`
* `alias2`
command 1 help

View File

@@ -4,4 +4,4 @@
alias2
<comment>Help:</comment>
command 1 help
command 1 help

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<command id="descriptor:command1" name="descriptor:command1">
<command id="descriptor:command1" name="descriptor:command1" hidden="0">
<usages>
<usage>descriptor:command1</usage>
<usage>alias1</usage>

View File

@@ -1 +1,33 @@
{"name":"descriptor:command2","usage":["descriptor:command2 [-o|--option_name] [--] <argument_name>", "descriptor:command2 -o|--option_name <argument_name>", "descriptor:command2 <argument_name>"],"description":"command 2 description","help":"command 2 help","definition":{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}}}}
{
"name": "descriptor:command2",
"hidden": false,
"usage": [
"descriptor:command2 [-o|--option_name] [--] <argument_name>",
"descriptor:command2 -o|--option_name <argument_name>",
"descriptor:command2 <argument_name>"
],
"description": "command 2 description",
"help": "command 2 help",
"definition": {
"arguments": {
"argument_name": {
"name": "argument_name",
"is_required": true,
"is_array": false,
"description": "",
"default": null
}
},
"options": {
"option_name": {
"name": "--option_name",
"shortcut": "-o",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "",
"default": false
}
}
}
}

View File

@@ -1,33 +1,29 @@
descriptor:command2
-------------------
`descriptor:command2`
---------------------
* Description: command 2 description
* Usage:
command 2 description
* `descriptor:command2 [-o|--option_name] [--] <argument_name>`
* `descriptor:command2 -o|--option_name <argument_name>`
* `descriptor:command2 <argument_name>`
### Usage
* `descriptor:command2 [-o|--option_name] [--] <argument_name>`
* `descriptor:command2 -o|--option_name <argument_name>`
* `descriptor:command2 <argument_name>`
command 2 help
### Arguments:
### Arguments
**argument_name:**
#### `argument_name`
* Name: argument_name
* Is required: yes
* Is array: no
* Description: <none>
* Default: `NULL`
### Options:
### Options
**option_name:**
#### `--option_name|-o`
* Name: `--option_name`
* Shortcut: `-o`
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: <none>
* Default: `false`

View File

@@ -1,7 +1,7 @@
<comment>Usage:</comment>
descriptor:command2 [options] [--] <argument_name>
descriptor:command2 -o|--option_name <argument_name>
descriptor:command2 <argument_name>
descriptor:command2 [options] [--] \<argument_name>
descriptor:command2 -o|--option_name \<argument_name>
descriptor:command2 \<argument_name>
<comment>Arguments:</comment>
<info>argument_name</info>
@@ -10,4 +10,4 @@
<info>-o, --option_name</info>
<comment>Help:</comment>
command 2 help
command 2 help

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<command id="descriptor:command2" name="descriptor:command2">
<command id="descriptor:command2" name="descriptor:command2" hidden="0">
<usages>
<usage>descriptor:command2 [-o|--option_name] [--] &lt;argument_name&gt;</usage>
<usage>descriptor:command2 -o|--option_name &lt;argument_name&gt;</usage>

View File

@@ -1,18 +0,0 @@
<comment>Usage:</comment>
namespace:name
name
<comment>Arguments:</comment>
<info>command</info> The command to execute
<comment>Options:</comment>
<info>-h, --help</info> Display this help message
<info>-q, --quiet</info> Do not output any message
<info>-V, --version</info> Display this application version
<info> --ansi</info> Force ANSI output
<info> --no-ansi</info> Disable ANSI output
<info>-n, --no-interaction</info> Do not ask any interactive question
<info>-v|vv|vvv, --verbose</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
<comment>Help:</comment>
help

View File

@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<command id="namespace:name" name="namespace:name">
<usages>
<usage>namespace:name</usage>
<usage>name</usage>
</usages>
<description>description</description>
<help>help</help>
<arguments>
<argument name="command" is_required="1" is_array="0">
<description>The command to execute</description>
<defaults/>
</argument>
</arguments>
<options>
<option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
<description>Display this help message</description>
</option>
<option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
<description>Do not output any message</description>
</option>
<option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
<description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
</option>
<option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
<description>Display this application version</description>
</option>
<option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>Force ANSI output</description>
</option>
<option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>Disable ANSI output</description>
</option>
<option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
<description>Do not ask any interactive question</description>
</option>
</options>
</command>

View File

@@ -0,0 +1,29 @@
`descriptor:åèä`
----------------
command åèä description
### Usage
* `descriptor:åèä [-o|--option_åèä] [--] <argument_åèä>`
* `descriptor:åèä -o|--option_name <argument_name>`
* `descriptor:åèä <argument_name>`
command åèä help
### Arguments
#### `argument_åèä`
* Is required: yes
* Is array: no
* Default: `NULL`
### Options
#### `--option_åèä|-o`
* Accept value: no
* Is value required: no
* Is multiple: no
* Default: `false`

View File

@@ -0,0 +1,13 @@
<comment>Usage:</comment>
descriptor:åèä [options] [--] \<argument_åèä>
descriptor:åèä -o|--option_name \<argument_name>
descriptor:åèä \<argument_name>
<comment>Arguments:</comment>
<info>argument_åèä</info>
<comment>Options:</comment>
<info>-o, --option_åèä</info>
<comment>Help:</comment>
command åèä help

View File

@@ -1,11 +0,0 @@
<comment>Arguments:</comment>
<info>foo</info> The foo argument
<info>baz</info> The baz argument<comment> [default: true]</comment>
<info>bar</info> The bar argument<comment> [default: ["http://foo.com/"]]</comment>
<comment>Options:</comment>
<info>-f, --foo=FOO</info> The foo option
<info> --baz[=BAZ]</info> The baz option<comment> [default: false]</comment>
<info>-b, --bar[=BAR]</info> The bar option<comment> [default: "bar"]</comment>
<info> --qux[=QUX]</info> The qux option<comment> [default: ["http://foo.com/","bar"]]</comment><comment> (multiple values allowed)</comment>
<info> --qux2[=QUX2]</info> The qux2 option<comment> [default: {"foo":"bar"}]</comment><comment> (multiple values allowed)</comment>

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<definition>
<arguments>
<argument name="foo" is_required="0" is_array="0">
<description>The foo argument</description>
<defaults/>
</argument>
<argument name="baz" is_required="0" is_array="0">
<description>The baz argument</description>
<defaults>
<default>true</default>
</defaults>
</argument>
<argument name="bar" is_required="0" is_array="1">
<description>The bar argument</description>
<defaults>
<default>bar</default>
</defaults>
</argument>
</arguments>
<options>
<option name="--foo" shortcut="-f" accept_value="1" is_value_required="1" is_multiple="0">
<description>The foo option</description>
<defaults/>
</option>
<option name="--baz" shortcut="" accept_value="1" is_value_required="0" is_multiple="0">
<description>The baz option</description>
<defaults>
<default>false</default>
</defaults>
</option>
<option name="--bar" shortcut="-b" accept_value="1" is_value_required="0" is_multiple="0">
<description>The bar option</description>
<defaults>
<default>bar</default>
</defaults>
</option>
</options>
</definition>

View File

@@ -1 +1,7 @@
{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}
{
"name": "argument_name",
"is_required": true,
"is_array": false,
"description": "",
"default": null
}

View File

@@ -1,7 +1,5 @@
**argument_name:**
#### `argument_name`
* Name: argument_name
* Is required: yes
* Is array: no
* Description: <none>
* Default: `NULL`

View File

@@ -1 +1,7 @@
{"name":"argument_name","is_required":false,"is_array":true,"description":"argument description","default":[]}
{
"name": "argument_name",
"is_required": false,
"is_array": true,
"description": "argument description",
"default": []
}

View File

@@ -1,7 +1,7 @@
**argument_name:**
#### `argument_name`
argument description
* Name: argument_name
* Is required: no
* Is array: yes
* Description: argument description
* Default: `array ()`

View File

@@ -1 +1,7 @@
{"name":"argument_name","is_required":false,"is_array":false,"description":"argument description","default":"default_value"}
{
"name": "argument_name",
"is_required": false,
"is_array": false,
"description": "argument description",
"default": "default_value"
}

View File

@@ -1,7 +1,7 @@
**argument_name:**
#### `argument_name`
argument description
* Name: argument_name
* Is required: no
* Is array: no
* Description: argument description
* Default: `'default_value'`

View File

@@ -1 +1,7 @@
{"name":"argument_name","is_required":true,"is_array":false,"description":"multiline argument description","default":null}
{
"name": "argument_name",
"is_required": true,
"is_array": false,
"description": "multiline argument description",
"default": null
}

View File

@@ -1,8 +1,8 @@
**argument_name:**
#### `argument_name`
multiline
argument description
* Name: argument_name
* Is required: yes
* Is array: no
* Description: multiline
argument description
* Default: `NULL`

View File

@@ -1,2 +1,2 @@
<info>argument_name</info> multiline
argument description
argument description

View File

@@ -0,0 +1,7 @@
{
"name": "argument_name",
"is_required": false,
"is_array": false,
"description": "argument description",
"default": "INF"
}

View File

@@ -0,0 +1,7 @@
#### `argument_name`
argument description
* Is required: no
* Is array: no
* Default: `INF`

View File

@@ -0,0 +1 @@
<info>argument_name</info> argument description<comment> [default: INF]</comment>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<argument name="argument_name" is_required="0" is_array="0">
<description>argument description</description>
<defaults>
<default>INF</default>
</defaults>
</argument>

Some files were not shown because too many files have changed in this diff Show More