replaced command names with supported placeholders in help texts

This commit is contained in:
Tobias Schultze 2012-02-12 16:37:55 +01:00
parent 69fc07a21c
commit 304e13daa3
20 changed files with 89 additions and 174 deletions

View File

@ -31,6 +31,7 @@ class AssetsInstallCommand extends ContainerAwareCommand
protected function configure() protected function configure()
{ {
$this $this
->setName('assets:install')
->setDefinition(array( ->setDefinition(array(
new InputArgument('target', InputArgument::REQUIRED, 'The target directory (usually "web")'), new InputArgument('target', InputArgument::REQUIRED, 'The target directory (usually "web")'),
)) ))
@ -38,10 +39,10 @@ class AssetsInstallCommand extends ContainerAwareCommand
->addOption('relative', null, InputOption::VALUE_NONE, 'Make relative symlinks') ->addOption('relative', null, InputOption::VALUE_NONE, 'Make relative symlinks')
->setDescription('Installs bundles web assets under a public web directory') ->setDescription('Installs bundles web assets under a public web directory')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>assets:install</info> command installs bundle assets into a given The <info>%command.name%</info> command installs bundle assets into a given
directory (e.g. the web directory). directory (e.g. the web directory).
<info>php app/console assets:install web</info> <info>php %command.full_name% web</info>
A "bundles" directory will be created inside the target directory, and the A "bundles" directory will be created inside the target directory, and the
"Resources/public" directory of each bundle will be copied into it. "Resources/public" directory of each bundle will be copied into it.
@ -49,15 +50,14 @@ A "bundles" directory will be created inside the target directory, and the
To create a symlink to each bundle instead of copying its assets, use the To create a symlink to each bundle instead of copying its assets, use the
<info>--symlink</info> option: <info>--symlink</info> option:
<info>php app/console assets:install web --symlink</info> <info>php %command.full_name% web --symlink</info>
To make symlink relative, add the <info>--relative</info> option: To make symlink relative, add the <info>--relative</info> option:
<info>php app/console assets:install web --symlink --relative</info> <info>php %command.full_name% web --symlink --relative</info>
EOT EOT
) )
->setName('assets:install')
; ;
} }

View File

@ -40,11 +40,11 @@ class CacheClearCommand extends ContainerAwareCommand
)) ))
->setDescription('Clears the cache') ->setDescription('Clears the cache')
->setHelp(<<<EOF ->setHelp(<<<EOF
The <info>cache:clear</info> command clears the application cache for a given environment The <info>%command.name%</info> command clears the application cache for a given environment
and debug mode: and debug mode:
<info>php app/console cache:clear --env=dev</info> <info>php %command.full_name% --env=dev</info>
<info>php app/console cache:clear --env=prod --no-debug</info> <info>php %command.full_name% --env=prod --no-debug</info>
EOF EOF
) )
; ;

View File

@ -34,7 +34,7 @@ class CacheWarmupCommand extends ContainerAwareCommand
)) ))
->setDescription('Warms up an empty cache') ->setDescription('Warms up an empty cache')
->setHelp(<<<EOF ->setHelp(<<<EOF
The <info>cache:warmup</info> command warms up the cache. The <info>%command.name%</info> command warms up the cache.
Before running this command, the cache must be empty. Before running this command, the cache must be empty.
EOF EOF

View File

@ -33,24 +33,23 @@ class ConfigDumpReferenceCommand extends ContainerDebugCommand
protected function configure() protected function configure()
{ {
$this $this
->setName('config:dump-reference')
->setDefinition(array( ->setDefinition(array(
new InputArgument('name', InputArgument::REQUIRED, 'The Bundle or extension alias') new InputArgument('name', InputArgument::REQUIRED, 'The Bundle or extension alias')
)) ))
->setName('config:dump-reference') ->setDescription('Dumps default configuration for an extension')
->setDescription('Dumps default configuration for an extension.')
->setHelp(<<<EOF ->setHelp(<<<EOF
The <info>config:dump-reference</info> command dumps the default configuration for an extension/bundle. The <info>%command.name%</info> command dumps the default configuration for an extension/bundle.
The extension alias or bundle name can be used: The extension alias or bundle name can be used:
Example: Example:
<info>%command.name% framework</info> <info>php %command.full_name% framework</info>
or or
<info>%command.name% FrameworkBundle</info> <info>php %command.full_name% FrameworkBundle</info>
EOF EOF
) )
; ;

View File

@ -40,25 +40,25 @@ class ContainerDebugCommand extends ContainerAwareCommand
protected function configure() protected function configure()
{ {
$this $this
->setName('container:debug')
->setDefinition(array( ->setDefinition(array(
new InputArgument('name', InputArgument::OPTIONAL, 'A service name (foo)'), new InputArgument('name', InputArgument::OPTIONAL, 'A service name (foo)'),
new InputOption('show-private', null, InputOption::VALUE_NONE, 'Use to show public *and* private services'), new InputOption('show-private', null, InputOption::VALUE_NONE, 'Use to show public *and* private services'),
)) ))
->setName('container:debug')
->setDescription('Displays current services for an application') ->setDescription('Displays current services for an application')
->setHelp(<<<EOF ->setHelp(<<<EOF
The <info>container:debug</info> command displays all configured <comment>public</comment> services: The <info>%command.name%</info> command displays all configured <comment>public</comment> services:
<info>container:debug</info> <info>php %command.full_name%</info>
To get specific information about a service, specify its name: To get specific information about a service, specify its name:
<info>container:debug validator</info> <info>php %command.full_name% validator</info>
By default, private services are hidden. You can display all services by By default, private services are hidden. You can display all services by
using the --show-private flag: using the --show-private flag:
<info>container:debug --show-private</info> <info>php %command.full_name% --show-private</info>
EOF EOF
) )
; ;

View File

@ -47,18 +47,18 @@ class RouterApacheDumperCommand extends ContainerAwareCommand
protected function configure() protected function configure()
{ {
$this $this
->setName('router:dump-apache')
->setDefinition(array( ->setDefinition(array(
new InputArgument('script_name', InputArgument::OPTIONAL, 'The script name of the application\'s front controller.'), new InputArgument('script_name', InputArgument::OPTIONAL, 'The script name of the application\'s front controller.'),
new InputOption('base-uri', null, InputOption::VALUE_REQUIRED, 'The base URI'), new InputOption('base-uri', null, InputOption::VALUE_REQUIRED, 'The base URI'),
)) ))
->setName('router:dump-apache')
->setDescription('Dumps all routes as Apache rewrite rules') ->setDescription('Dumps all routes as Apache rewrite rules')
->setHelp(<<<EOF ->setHelp(<<<EOF
The <info>router:dump-apache</info> dumps all routes as Apache rewrite rules. The <info>%command.name%</info> dumps all routes as Apache rewrite rules.
These can then be used with the ApacheUrlMatcher to use Apache for route These can then be used with the ApacheUrlMatcher to use Apache for route
matching. matching.
<info>router:dump-apache</info> <info>php %command.full_name%</info>
EOF EOF
) )
; ;

View File

@ -46,15 +46,15 @@ class RouterDebugCommand extends ContainerAwareCommand
protected function configure() protected function configure()
{ {
$this $this
->setName('router:debug')
->setDefinition(array( ->setDefinition(array(
new InputArgument('name', InputArgument::OPTIONAL, 'A route name'), new InputArgument('name', InputArgument::OPTIONAL, 'A route name'),
)) ))
->setName('router:debug')
->setDescription('Displays current routes for an application') ->setDescription('Displays current routes for an application')
->setHelp(<<<EOF ->setHelp(<<<EOF
The <info>router:debug</info> displays the configured routes: The <info>%command.name%</info> displays the configured routes:
<info>router:debug</info> <info>php %command.full_name%</info>
EOF EOF
) )
; ;

View File

@ -46,15 +46,15 @@ class RouterMatchCommand extends ContainerAwareCommand
protected function configure() protected function configure()
{ {
$this $this
->setName('router:match')
->setDefinition(array( ->setDefinition(array(
new InputArgument('path_info', InputArgument::REQUIRED, 'A path info'), new InputArgument('path_info', InputArgument::REQUIRED, 'A path info'),
)) ))
->setName('router:match')
->setDescription('Helps debug routes by simulating a path info match') ->setDescription('Helps debug routes by simulating a path info match')
->setHelp(<<<EOF ->setHelp(<<<EOF
The <info>router:match</info> simulates a path info match: The <info>%command.name%</info> simulates a path info match:
<info>router:match /foo</info> <info>php %command.full_name% /foo</info>
EOF EOF
) )
; ;

View File

@ -40,7 +40,6 @@ class TranslationUpdateCommand extends ContainerAwareCommand
{ {
$this $this
->setName('translation:update') ->setName('translation:update')
->setDescription('Update the translation file')
->setDefinition(array( ->setDefinition(array(
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'), new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
new InputArgument('bundle', InputArgument::REQUIRED, 'The bundle where to load the messages'), new InputArgument('bundle', InputArgument::REQUIRED, 'The bundle where to load the messages'),
@ -61,16 +60,18 @@ class TranslationUpdateCommand extends ContainerAwareCommand
'Should the update be done' 'Should the update be done'
) )
)) ))
->setDescription('Update the translation file')
->setHelp(<<<EOF ->setHelp(<<<EOF
The <info>translation:update</info> command extract translation strings from templates The <info>%command.name%</info> command extract translation strings from templates
of a given bundle. It can display them or merge the new ones into the translation files. of a given bundle. It can display them or merge the new ones into the translation files.
When new translation strings are found it can automatically add a prefix to the translation When new translation strings are found it can automatically add a prefix to the translation
message. message.
<info>php app/console translation:update --dump-messages en AcmeBundle</info> <info>php %command.full_name% --dump-messages en AcmeBundle</info>
<info>php app/console translation:update --force --prefix="new_" fr AcmeBundle</info> <info>php %command.full_name% --force --prefix="new_" fr AcmeBundle</info>
EOF EOF
); )
;
} }
/** /**

View File

@ -32,18 +32,19 @@ class InitAclCommand extends ContainerAwareCommand
$this $this
->setName('init:acl') ->setName('init:acl')
->setDescription('Mounts ACL tables in the database') ->setDescription('Mounts ACL tables in the database')
->setHelp(<<<EOT ->setHelp(<<<EOF
The <info>init:acl</info> command mounts ACL tables in the database. The <info>%command.name%</info> command mounts ACL tables in the database.
<info>php app/console init:acl</info> <info>php %command.full_name%</info>
The name of the DBAL connection must be configured in your <info>app/config/security.yml</info> configuration file in the <info>security.acl.connection</info> variable. The name of the DBAL connection must be configured in your <info>app/config/security.yml</info> configuration file in the <info>security.acl.connection</info> variable.
<info>security: <info>security:
acl: acl:
connection: default</info> connection: default</info>
EOT EOF
); )
;
} }
/** /**

View File

@ -35,22 +35,23 @@ class HelpCommand extends Command
$this->ignoreValidationErrors(); $this->ignoreValidationErrors();
$this $this
->setName('help')
->setDefinition(array( ->setDefinition(array(
new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'),
new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'), new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'),
)) ))
->setName('help')
->setDescription('Displays help for a command') ->setDescription('Displays help for a command')
->setHelp(<<<EOF ->setHelp(<<<EOF
The <info>help</info> command displays help for a given command: The <info>%command.name%</info> command displays help for a given command:
<info>php app/console help list</info> <info>php %command.full_name% list</info>
You can also output the help as XML by using the <comment>--xml</comment> option: You can also output the help as XML by using the <comment>--xml</comment> option:
<info>php app/console help --xml list</info> <info>php %command.full_name% --xml list</info>
EOF EOF
); )
;
} }
/** /**

View File

@ -32,27 +32,28 @@ class ListCommand extends Command
protected function configure() protected function configure()
{ {
$this $this
->setDefinition($this->createDefinition())
->setName('list') ->setName('list')
->setDefinition($this->createDefinition())
->setDescription('Lists commands') ->setDescription('Lists commands')
->setHelp(<<<EOF ->setHelp(<<<EOF
The <info>list</info> command lists all commands: The <info>%command.name%</info> command lists all commands:
<info>php app/console list</info> <info>php %command.full_name%</info>
You can also display the commands for a specific namespace: You can also display the commands for a specific namespace:
<info>php app/console list test</info> <info>php %command.full_name% test</info>
You can also output the information as XML by using the <comment>--xml</comment> option: You can also output the information as XML by using the <comment>--xml</comment> option:
<info>php app/console list --xml</info> <info>php %command.full_name% --xml</info>
It's also possible to get raw list of commands (useful for embedding command runner): It's also possible to get raw list of commands (useful for embedding command runner):
<info>php app/console list --raw</info> <info>php %command.full_name% --raw</info>
EOF EOF
); )
;
} }
/** /**

View File

@ -43,12 +43,8 @@ abstract class Output implements OutputInterface
*/ */
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null) public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
{ {
if (null === $formatter) {
$formatter = new OutputFormatter();
}
$this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity; $this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity;
$this->formatter = $formatter; $this->formatter = null === $formatter ? new OutputFormatter() : $formatter;
$this->formatter->setDecorated((Boolean) $decorated); $this->formatter->setDecorated((Boolean) $decorated);
} }

View File

@ -13,6 +13,8 @@ namespace Symfony\Component\Console\Tester;
use Symfony\Component\Console\Application; use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Console\Output\StreamOutput;
/** /**

View File

@ -12,12 +12,13 @@
namespace Symfony\Tests\Component\Console; namespace Symfony\Tests\Component\Console;
use Symfony\Component\Console\Application; use Symfony\Component\Console\Application;
use Symfony\Component\Console\Output\Output; use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Tester\ApplicationTester; use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Output\Output;
use Symfony\Component\Console\Tester\ApplicationTester;
class ApplicationTest extends \PHPUnit_Framework_TestCase class ApplicationTest extends \PHPUnit_Framework_TestCase
{ {
@ -317,7 +318,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $this->normalize($tester->getDisplay()), '->renderException() renders a pretty exception'); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $this->normalize($tester->getDisplay()), '->renderException() renders a pretty exception');
$tester->run(array('command' => 'foo'), array('decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE)); $tester->run(array('command' => 'foo'), array('decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE));
$this->assertRegExp('/Exception trace/', $this->normalize($tester->getDisplay()), '->renderException() renders a pretty exception with a stack trace when verbosity is verbose'); $this->assertContains('Exception trace', $this->normalize($tester->getDisplay()), '->renderException() renders a pretty exception with a stack trace when verbosity is verbose');
$tester->run(array('command' => 'list', '--foo' => true), array('decorated' => false)); $tester->run(array('command' => 'list', '--foo' => true), array('decorated' => false));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception2.txt', $this->normalize($tester->getDisplay()), '->renderException() renders the command synopsis when an exception occurs in the context of a command'); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception2.txt', $this->normalize($tester->getDisplay()), '->renderException() renders the command synopsis when an exception occurs in the context of a command');
@ -341,82 +342,66 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$application->run(); $application->run();
ob_end_clean(); ob_end_clean();
$this->assertEquals('Symfony\Component\Console\Input\ArgvInput', get_class($command->input), '->run() creates an ArgvInput by default if none is given'); $this->assertSame('Symfony\Component\Console\Input\ArgvInput', get_class($command->input), '->run() creates an ArgvInput by default if none is given');
$this->assertEquals('Symfony\Component\Console\Output\ConsoleOutput', get_class($command->output), '->run() creates a ConsoleOutput by default if none is given'); $this->assertSame('Symfony\Component\Console\Output\ConsoleOutput', get_class($command->output), '->run() creates a ConsoleOutput by default if none is given');
$formatter = new OutputFormatter(false);
$application = new Application(); $application = new Application();
$application->setAutoExit(false); $application->setAutoExit(false);
$application->setCatchExceptions(false); $application->setCatchExceptions(false);
$tester = new ApplicationTester($application); $tester = new ApplicationTester($application);
$tester->run(array(), array('decorated' => false)); $tester->run(array(), array('decorated' => false));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run1.txt', $this->normalize($tester->getDisplay()), '->run() runs the list command if no argument is passed'); $this->assertSame($formatter->format($application->asText()).PHP_EOL, $tester->getDisplay(), '->run() runs the list command if no argument is passed');
$tester->run(array('--help' => true), array('decorated' => false)); $tester->run(array('--help' => true), array('decorated' => false));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $this->normalize($tester->getDisplay()), '->run() runs the help command if --help is passed'); $this->assertSame($formatter->format($application->get('help')->asText()).PHP_EOL, $tester->getDisplay(), '->run() runs the help command if --help is passed');
$tester->run(array('-h' => true), array('decorated' => false)); $tester->run(array('-h' => true), array('decorated' => false));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $this->normalize($tester->getDisplay()), '->run() runs the help command if -h is passed'); $this->assertSame($formatter->format($application->get('help')->asText()).PHP_EOL, $tester->getDisplay(), '->run() runs the help command if -h is passed');
$application = new Application();
$application->setAutoExit(false);
$application->setCatchExceptions(false);
$tester = new ApplicationTester($application);
$tester->run(array('command' => 'list', '--help' => true), array('decorated' => false)); $tester->run(array('command' => 'list', '--help' => true), array('decorated' => false));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $this->normalize($tester->getDisplay()), '->run() displays the help if --help is passed'); $this->assertSame($formatter->format($application->get('list')->asText()).PHP_EOL, $tester->getDisplay(), '->run() displays the help if --help is passed');
$tester->run(array('command' => 'list', '-h' => true), array('decorated' => false)); $tester->run(array('command' => 'list', '-h' => true), array('decorated' => false));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $this->normalize($tester->getDisplay()), '->run() displays the help if -h is passed'); $this->assertSame($formatter->format($application->get('list')->asText()).PHP_EOL, $tester->getDisplay(), '->run() displays the help if -h is passed');
$application = new Application();
$application->setAutoExit(false);
$application->setCatchExceptions(false);
$tester = new ApplicationTester($application);
$tester->run(array('--ansi' => true)); $tester->run(array('--ansi' => true));
$this->assertTrue($tester->getOutput()->isDecorated(), '->run() forces color output if --ansi is passed'); $this->assertTrue($tester->getOutput()->isDecorated(), '->run() forces color output if --ansi is passed');
$tester->run(array('--no-ansi' => true)); $tester->run(array('--no-ansi' => true));
$this->assertFalse($tester->getOutput()->isDecorated(), '->run() forces color output to be disabled if --no-ansi is passed'); $this->assertFalse($tester->getOutput()->isDecorated(), '->run() forces color output to be disabled if --no-ansi is passed');
$application = new Application();
$application->setAutoExit(false);
$application->setCatchExceptions(false);
$tester = new ApplicationTester($application);
$tester->run(array('--version' => true), array('decorated' => false)); $tester->run(array('--version' => true), array('decorated' => false));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $this->normalize($tester->getDisplay()), '->run() displays the program version if --version is passed'); $this->assertSame($formatter->format($application->getLongVersion()).PHP_EOL, $tester->getDisplay(), '->run() displays the program version if --version is passed');
$tester->run(array('-V' => true), array('decorated' => false)); $tester->run(array('-V' => true), array('decorated' => false));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $this->normalize($tester->getDisplay()), '->run() displays the program version if -v is passed'); $this->assertSame($formatter->format($application->getLongVersion()).PHP_EOL, $tester->getDisplay(), '->run() displays the program version if -V is passed');
$application = new Application();
$application->setAutoExit(false);
$application->setCatchExceptions(false);
$tester = new ApplicationTester($application);
$tester->run(array('command' => 'list', '--quiet' => true)); $tester->run(array('command' => 'list', '--quiet' => true));
$this->assertEquals('', $this->normalize($tester->getDisplay()), '->run() removes all output if --quiet is passed'); $this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed');
$tester->run(array('command' => 'list', '-q' => true)); $tester->run(array('command' => 'list', '-q' => true));
$this->assertEquals('', $this->normalize($tester->getDisplay()), '->run() removes all output if -q is passed'); $this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed');
$application = new Application();
$application->setAutoExit(false);
$application->setCatchExceptions(false);
$tester = new ApplicationTester($application);
$tester->run(array('command' => 'list', '--verbose' => true)); $tester->run(array('command' => 'list', '--verbose' => true));
$this->assertEquals(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose is --verbose is passed'); $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed');
$tester->run(array('command' => 'list', '-v' => true)); $tester->run(array('command' => 'list', '-v' => true));
$this->assertEquals(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose is -v is passed'); $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed');
$application = new Application(); $application = new Application();
$application->setAutoExit(false); $application->setAutoExit(false);
$application->setCatchExceptions(false); $application->setCatchExceptions(false);
$application->add(new \FooCommand()); $application->add(new \FooCommand());
$tester = new ApplicationTester($application); $tester = new ApplicationTester($application);
$tester->run(array('command' => 'foo:bar', '--no-interaction' => true), array('decorated' => false)); $tester->run(array('command' => 'foo:bar', '--no-interaction' => true), array('decorated' => false));
$this->assertEquals("called\n", $this->normalize($tester->getDisplay()), '->run() does not called interact() if --no-interaction is passed'); $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if --no-interaction is passed');
$tester->run(array('command' => 'foo:bar', '-n' => true), array('decorated' => false)); $tester->run(array('command' => 'foo:bar', '-n' => true), array('decorated' => false));
$this->assertEquals("called\n", $this->normalize($tester->getDisplay()), '->run() does not called interact() if -n is passed'); $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if -n is passed');
} }
/** /**

View File

@ -4,13 +4,13 @@
<command id="help" name="help"> <command id="help" name="help">
<usage>help [--xml] [command_name]</usage> <usage>help [--xml] [command_name]</usage>
<description>Displays help for a command</description> <description>Displays help for a command</description>
<help>The &lt;info&gt;help&lt;/info&gt; command displays help for a given command: <help>The &lt;info&gt;%command.name%&lt;/info&gt; command displays help for a given command:
&lt;info&gt;php app/console help list&lt;/info&gt; &lt;info&gt;php %command.full_name% list&lt;/info&gt;
You can also output the help as XML by using the &lt;comment&gt;--xml&lt;/comment&gt; option: You can also output the help as XML by using the &lt;comment&gt;--xml&lt;/comment&gt; option:
&lt;info&gt;php app/console help --xml list&lt;/info&gt;</help> &lt;info&gt;php %command.full_name% --xml list&lt;/info&gt;</help>
<aliases /> <aliases />
<arguments> <arguments>
<argument name="command_name" is_required="0" is_array="0"> <argument name="command_name" is_required="0" is_array="0">
@ -29,21 +29,21 @@
<command id="list" name="list"> <command id="list" name="list">
<usage>list [--xml] [--raw] [namespace]</usage> <usage>list [--xml] [--raw] [namespace]</usage>
<description>Lists commands</description> <description>Lists commands</description>
<help>The &lt;info&gt;list&lt;/info&gt; command lists all commands: <help>The &lt;info&gt;%command.name%&lt;/info&gt; command lists all commands:
&lt;info&gt;php app/console list&lt;/info&gt; &lt;info&gt;php %command.full_name%&lt;/info&gt;
You can also display the commands for a specific namespace: You can also display the commands for a specific namespace:
&lt;info&gt;php app/console list test&lt;/info&gt; &lt;info&gt;php %command.full_name% test&lt;/info&gt;
You can also output the information as XML by using the &lt;comment&gt;--xml&lt;/comment&gt; option: You can also output the information as XML by using the &lt;comment&gt;--xml&lt;/comment&gt; option:
&lt;info&gt;php app/console list --xml&lt;/info&gt; &lt;info&gt;php %command.full_name% --xml&lt;/info&gt;
It's also possible to get raw list of commands (useful for embedding command runner): It's also possible to get raw list of commands (useful for embedding command runner):
&lt;info&gt;php app/console list --raw&lt;/info&gt;</help> &lt;info&gt;php %command.full_name% --raw&lt;/info&gt;</help>
<aliases/> <aliases/>
<arguments> <arguments>
<argument name="namespace" is_required="0" is_array="0"> <argument name="namespace" is_required="0" is_array="0">

View File

@ -1,17 +0,0 @@
Console Tool
Usage:
[options] command [arguments]
Options:
--help -h Display this help message.
--quiet -q Do not output any message.
--verbose -v Increase verbosity of messages.
--version -V Display this application version.
--ansi Force ANSI output.
--no-ansi Disable ANSI output.
--no-interaction -n Do not ask any interactive question.
Available commands:
help Displays help for a command
list Lists commands

View File

@ -1,26 +0,0 @@
Usage:
help [--xml] [command_name]
Arguments:
command The command to execute
command_name The command name (default: 'help')
Options:
--xml To output help as XML
--help (-h) Display this help message.
--quiet (-q) Do not output any message.
--verbose (-v) Increase verbosity of messages.
--version (-V) Display this application version.
--ansi Force ANSI output.
--no-ansi Disable ANSI output.
--no-interaction (-n) Do not ask any interactive question.
Help:
The help command displays help for a given command:
php app/console help list
You can also output the help as XML by using the --xml option:
php app/console help --xml list

View File

@ -1,27 +0,0 @@
Usage:
list [--xml] [--raw] [namespace]
Arguments:
namespace The namespace name
Options:
--xml To output help as XML
--raw To output raw command list
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 as XML by using the --xml option:
php app/console list --xml
It's also possible to get raw list of commands (useful for embedding command runner):
php app/console list --raw