Skip to content

Commit 304e13d

Browse files
committed
replaced command names with supported placeholders in help texts
1 parent 69fc07a commit 304e13d

20 files changed

+89
-174
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,33 @@ class AssetsInstallCommand extends ContainerAwareCommand
3131
protected function configure()
3232
{
3333
$this
34+
->setName('assets:install')
3435
->setDefinition(array(
3536
new InputArgument('target', InputArgument::REQUIRED, 'The target directory (usually "web")'),
3637
))
3738
->addOption('symlink', null, InputOption::VALUE_NONE, 'Symlinks the assets instead of copying it')
3839
->addOption('relative', null, InputOption::VALUE_NONE, 'Make relative symlinks')
3940
->setDescription('Installs bundles web assets under a public web directory')
4041
->setHelp(<<<EOT
41-
The <info>assets:install</info> command installs bundle assets into a given
42+
The <info>%command.name%</info> command installs bundle assets into a given
4243
directory (e.g. the web directory).
4344
44-
<info>php app/console assets:install web</info>
45+
<info>php %command.full_name% web</info>
4546
4647
A "bundles" directory will be created inside the target directory, and the
4748
"Resources/public" directory of each bundle will be copied into it.
4849
4950
To create a symlink to each bundle instead of copying its assets, use the
5051
<info>--symlink</info> option:
5152
52-
<info>php app/console assets:install web --symlink</info>
53+
<info>php %command.full_name% web --symlink</info>
5354
5455
To make symlink relative, add the <info>--relative</info> option:
5556
56-
<info>php app/console assets:install web --symlink --relative</info>
57+
<info>php %command.full_name% web --symlink --relative</info>
5758
5859
EOT
5960
)
60-
->setName('assets:install')
6161
;
6262
}
6363

src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ protected function configure()
4040
))
4141
->setDescription('Clears the cache')
4242
->setHelp(<<<EOF
43-
The <info>cache:clear</info> command clears the application cache for a given environment
43+
The <info>%command.name%</info> command clears the application cache for a given environment
4444
and debug mode:
4545
46-
<info>php app/console cache:clear --env=dev</info>
47-
<info>php app/console cache:clear --env=prod --no-debug</info>
46+
<info>php %command.full_name% --env=dev</info>
47+
<info>php %command.full_name% --env=prod --no-debug</info>
4848
EOF
4949
)
5050
;

src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function configure()
3434
))
3535
->setDescription('Warms up an empty cache')
3636
->setHelp(<<<EOF
37-
The <info>cache:warmup</info> command warms up the cache.
37+
The <info>%command.name%</info> command warms up the cache.
3838
3939
Before running this command, the cache must be empty.
4040
EOF

src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,23 @@ class ConfigDumpReferenceCommand extends ContainerDebugCommand
3333
protected function configure()
3434
{
3535
$this
36+
->setName('config:dump-reference')
3637
->setDefinition(array(
3738
new InputArgument('name', InputArgument::REQUIRED, 'The Bundle or extension alias')
3839
))
39-
->setName('config:dump-reference')
40-
->setDescription('Dumps default configuration for an extension.')
40+
->setDescription('Dumps default configuration for an extension')
4141
->setHelp(<<<EOF
42-
The <info>config:dump-reference</info> command dumps the default configuration for an extension/bundle.
42+
The <info>%command.name%</info> command dumps the default configuration for an extension/bundle.
4343
4444
The extension alias or bundle name can be used:
4545
4646
Example:
4747
48-
<info>%command.name% framework</info>
48+
<info>php %command.full_name% framework</info>
4949
5050
or
5151
52-
<info>%command.name% FrameworkBundle</info>
53-
52+
<info>php %command.full_name% FrameworkBundle</info>
5453
EOF
5554
)
5655
;

src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,25 @@ class ContainerDebugCommand extends ContainerAwareCommand
4040
protected function configure()
4141
{
4242
$this
43+
->setName('container:debug')
4344
->setDefinition(array(
4445
new InputArgument('name', InputArgument::OPTIONAL, 'A service name (foo)'),
4546
new InputOption('show-private', null, InputOption::VALUE_NONE, 'Use to show public *and* private services'),
4647
))
47-
->setName('container:debug')
4848
->setDescription('Displays current services for an application')
4949
->setHelp(<<<EOF
50-
The <info>container:debug</info> command displays all configured <comment>public</comment> services:
50+
The <info>%command.name%</info> command displays all configured <comment>public</comment> services:
5151
52-
<info>container:debug</info>
52+
<info>php %command.full_name%</info>
5353
5454
To get specific information about a service, specify its name:
5555
56-
<info>container:debug validator</info>
56+
<info>php %command.full_name% validator</info>
5757
5858
By default, private services are hidden. You can display all services by
5959
using the --show-private flag:
6060
61-
<info>container:debug --show-private</info>
61+
<info>php %command.full_name% --show-private</info>
6262
EOF
6363
)
6464
;

src/Symfony/Bundle/FrameworkBundle/Command/RouterApacheDumperCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ public function isEnabled()
4747
protected function configure()
4848
{
4949
$this
50+
->setName('router:dump-apache')
5051
->setDefinition(array(
5152
new InputArgument('script_name', InputArgument::OPTIONAL, 'The script name of the application\'s front controller.'),
5253
new InputOption('base-uri', null, InputOption::VALUE_REQUIRED, 'The base URI'),
5354
))
54-
->setName('router:dump-apache')
5555
->setDescription('Dumps all routes as Apache rewrite rules')
5656
->setHelp(<<<EOF
57-
The <info>router:dump-apache</info> dumps all routes as Apache rewrite rules.
57+
The <info>%command.name%</info> dumps all routes as Apache rewrite rules.
5858
These can then be used with the ApacheUrlMatcher to use Apache for route
5959
matching.
6060
61-
<info>router:dump-apache</info>
61+
<info>php %command.full_name%</info>
6262
EOF
6363
)
6464
;

src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ public function isEnabled()
4646
protected function configure()
4747
{
4848
$this
49+
->setName('router:debug')
4950
->setDefinition(array(
5051
new InputArgument('name', InputArgument::OPTIONAL, 'A route name'),
5152
))
52-
->setName('router:debug')
5353
->setDescription('Displays current routes for an application')
5454
->setHelp(<<<EOF
55-
The <info>router:debug</info> displays the configured routes:
55+
The <info>%command.name%</info> displays the configured routes:
5656
57-
<info>router:debug</info>
57+
<info>php %command.full_name%</info>
5858
EOF
5959
)
6060
;

src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ public function isEnabled()
4646
protected function configure()
4747
{
4848
$this
49+
->setName('router:match')
4950
->setDefinition(array(
5051
new InputArgument('path_info', InputArgument::REQUIRED, 'A path info'),
5152
))
52-
->setName('router:match')
5353
->setDescription('Helps debug routes by simulating a path info match')
5454
->setHelp(<<<EOF
55-
The <info>router:match</info> simulates a path info match:
55+
The <info>%command.name%</info> simulates a path info match:
5656
57-
<info>router:match /foo</info>
57+
<info>php %command.full_name% /foo</info>
5858
EOF
5959
)
6060
;

src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ protected function configure()
4040
{
4141
$this
4242
->setName('translation:update')
43-
->setDescription('Update the translation file')
4443
->setDefinition(array(
4544
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
4645
new InputArgument('bundle', InputArgument::REQUIRED, 'The bundle where to load the messages'),
@@ -61,16 +60,18 @@ protected function configure()
6160
'Should the update be done'
6261
)
6362
))
63+
->setDescription('Update the translation file')
6464
->setHelp(<<<EOF
65-
The <info>translation:update</info> command extract translation strings from templates
65+
The <info>%command.name%</info> command extract translation strings from templates
6666
of a given bundle. It can display them or merge the new ones into the translation files.
6767
When new translation strings are found it can automatically add a prefix to the translation
6868
message.
6969
70-
<info>php app/console translation:update --dump-messages en AcmeBundle</info>
71-
<info>php app/console translation:update --force --prefix="new_" fr AcmeBundle</info>
70+
<info>php %command.full_name% --dump-messages en AcmeBundle</info>
71+
<info>php %command.full_name% --force --prefix="new_" fr AcmeBundle</info>
7272
EOF
73-
);
73+
)
74+
;
7475
}
7576

7677
/**

src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,19 @@ protected function configure()
3232
$this
3333
->setName('init:acl')
3434
->setDescription('Mounts ACL tables in the database')
35-
->setHelp(<<<EOT
36-
The <info>init:acl</info> command mounts ACL tables in the database.
35+
->setHelp(<<<EOF
36+
The <info>%command.name%</info> command mounts ACL tables in the database.
3737
38-
<info>php app/console init:acl</info>
38+
<info>php %command.full_name%</info>
3939
4040
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.
4141
4242
<info>security:
4343
acl:
4444
connection: default</info>
45-
EOT
46-
);
45+
EOF
46+
)
47+
;
4748
}
4849

4950
/**

src/Symfony/Component/Console/Command/HelpCommand.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,23 @@ protected function configure()
3535
$this->ignoreValidationErrors();
3636

3737
$this
38+
->setName('help')
3839
->setDefinition(array(
3940
new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'),
4041
new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'),
4142
))
42-
->setName('help')
4343
->setDescription('Displays help for a command')
4444
->setHelp(<<<EOF
45-
The <info>help</info> command displays help for a given command:
45+
The <info>%command.name%</info> command displays help for a given command:
4646
47-
<info>php app/console help list</info>
47+
<info>php %command.full_name% list</info>
4848
4949
You can also output the help as XML by using the <comment>--xml</comment> option:
5050
51-
<info>php app/console help --xml list</info>
51+
<info>php %command.full_name% --xml list</info>
5252
EOF
53-
);
53+
)
54+
;
5455
}
5556

5657
/**

src/Symfony/Component/Console/Command/ListCommand.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,28 @@ class ListCommand extends Command
3232
protected function configure()
3333
{
3434
$this
35-
->setDefinition($this->createDefinition())
3635
->setName('list')
36+
->setDefinition($this->createDefinition())
3737
->setDescription('Lists commands')
3838
->setHelp(<<<EOF
39-
The <info>list</info> command lists all commands:
39+
The <info>%command.name%</info> command lists all commands:
4040
41-
<info>php app/console list</info>
41+
<info>php %command.full_name%</info>
4242
4343
You can also display the commands for a specific namespace:
4444
45-
<info>php app/console list test</info>
45+
<info>php %command.full_name% test</info>
4646
4747
You can also output the information as XML by using the <comment>--xml</comment> option:
4848
49-
<info>php app/console list --xml</info>
49+
<info>php %command.full_name% --xml</info>
5050
5151
It's also possible to get raw list of commands (useful for embedding command runner):
5252
53-
<info>php app/console list --raw</info>
53+
<info>php %command.full_name% --raw</info>
5454
EOF
55-
);
55+
)
56+
;
5657
}
5758

5859
/**

src/Symfony/Component/Console/Output/Output.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,8 @@ abstract class Output implements OutputInterface
4343
*/
4444
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
4545
{
46-
if (null === $formatter) {
47-
$formatter = new OutputFormatter();
48-
}
49-
5046
$this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity;
51-
$this->formatter = $formatter;
47+
$this->formatter = null === $formatter ? new OutputFormatter() : $formatter;
5248
$this->formatter->setDecorated((Boolean) $decorated);
5349
}
5450

src/Symfony/Component/Console/Tester/ApplicationTester.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
use Symfony\Component\Console\Application;
1515
use Symfony\Component\Console\Input\ArrayInput;
16+
use Symfony\Component\Console\Input\InputInterface;
17+
use Symfony\Component\Console\Output\OutputInterface;
1618
use Symfony\Component\Console\Output\StreamOutput;
1719

1820
/**

0 commit comments

Comments
 (0)