[Console] Remove "php" invokation from help messages.

This commit is contained in:
Rodrigo Aguilera 2020-10-03 15:57:06 +02:00
parent 2be67879b9
commit e036c30e7a
14 changed files with 53 additions and 52 deletions

View File

@ -12,6 +12,7 @@ CHANGELOG
* Added `Application::getSignalRegistry()` and `Application::setSignalsToDispatchEvent()` methods * Added `Application::getSignalRegistry()` and `Application::setSignalsToDispatchEvent()` methods
* Added `SignalableCommandInterface` interface * Added `SignalableCommandInterface` interface
* Added `TableCellStyle` class to customize table cell * Added `TableCellStyle` class to customize table cell
* Removed `php ` prefix invocation from help messages.
5.1.0 5.1.0
----- -----

View File

@ -44,11 +44,11 @@ class HelpCommand extends Command
->setHelp(<<<'EOF' ->setHelp(<<<'EOF'
The <info>%command.name%</info> command displays help for a given command: The <info>%command.name%</info> command displays help for a given command:
<info>php %command.full_name% list</info> <info>%command.full_name% list</info>
You can also output the help in other formats by using the <comment>--format</comment> option: You can also output the help in other formats by using the <comment>--format</comment> option:
<info>php %command.full_name% --format=xml list</info> <info>%command.full_name% --format=xml list</info>
To display the list of available commands, please use the <info>list</info> command. To display the list of available commands, please use the <info>list</info> command.
EOF EOF

View File

@ -40,19 +40,19 @@ class ListCommand extends Command
->setHelp(<<<'EOF' ->setHelp(<<<'EOF'
The <info>%command.name%</info> command lists all commands: The <info>%command.name%</info> command lists all commands:
<info>php %command.full_name%</info> <info>%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 %command.full_name% test</info> <info>%command.full_name% test</info>
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 <comment>--format</comment> option:
<info>php %command.full_name% --format=xml</info> <info>%command.full_name% --format=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 %command.full_name% --raw</info> <info>%command.full_name% --raw</info>
EOF EOF
) )
; ;

View File

@ -153,7 +153,7 @@ class CommandTest extends TestCase
public function testGetProcessedHelp() public function testGetProcessedHelp()
{ {
$command = new \TestCommand(); $command = new \TestCommand();
$command->setHelp('The %command.name% command does... Example: php %command.full_name%.'); $command->setHelp('The %command.name% command does... Example: %command.full_name%.');
$this->assertStringContainsString('The namespace:name command does...', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.name% correctly'); $this->assertStringContainsString('The namespace:name command does...', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.name% correctly');
$this->assertStringNotContainsString('%command.full_name%', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.full_name%'); $this->assertStringNotContainsString('%command.full_name%', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.full_name%');
@ -162,7 +162,7 @@ class CommandTest extends TestCase
$this->assertStringContainsString('description', $command->getProcessedHelp(), '->getProcessedHelp() falls back to the description'); $this->assertStringContainsString('description', $command->getProcessedHelp(), '->getProcessedHelp() falls back to the description');
$command = new \TestCommand(); $command = new \TestCommand();
$command->setHelp('The %command.name% command does... Example: php %command.full_name%.'); $command->setHelp('The %command.name% command does... Example: %command.full_name%.');
$application = new Application(); $application = new Application();
$application->add($command); $application->add($command);
$application->setDefaultCommand('namespace:name', true); $application->setDefaultCommand('namespace:name', true);

View File

@ -7,7 +7,7 @@
"help [--format FORMAT] [--raw] [--] [<command_name>]" "help [--format FORMAT] [--raw] [--] [<command_name>]"
], ],
"description": "Displays help for a command", "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.", "help": "The <info>help<\/info> command displays help for a given command:\n\n <info>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>app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the <info>list<\/info> command.",
"definition": { "definition": {
"arguments": { "arguments": {
"command_name": { "command_name": {
@ -110,7 +110,7 @@
"list [--raw] [--format FORMAT] [--] [<namespace>]" "list [--raw] [--format FORMAT] [--] [<namespace>]"
], ],
"description": "Lists commands", "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>", "help": "The <info>list<\/info> command lists all commands:\n\n <info>app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n <info>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>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>app\/console list --raw<\/info>",
"definition": { "definition": {
"arguments": { "arguments": {
"namespace": { "namespace": {

View File

@ -15,11 +15,11 @@ Displays help for a command
The help command displays help for a given command: The help command displays help for a given command:
php app/console help list app/console help list
You can also output the help in other formats by using the --format option: You can also output the help in other formats by using the --format option:
php app/console help --format=xml list app/console help --format=xml list
To display the list of available commands, please use the list command. To display the list of available commands, please use the list command.
@ -127,19 +127,19 @@ Lists commands
The list command lists all commands: The list command lists all commands:
php app/console list app/console list
You can also display the commands for a specific namespace: You can also display the commands for a specific namespace:
php app/console list test app/console list test
You can also output the information in other formats by using the --format option: You can also output the information in other formats by using the --format option:
php app/console list --format=xml app/console list --format=xml
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):
php app/console list --raw app/console list --raw
### Arguments ### Arguments

View File

@ -8,11 +8,11 @@
<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;help&lt;/info&gt; command displays help for a given command:
&lt;info&gt;php app/console help list&lt;/info&gt; &lt;info&gt;app/console help list&lt;/info&gt;
You can also output the help in other formats by using the &lt;comment&gt;--format&lt;/comment&gt; option: You can also output the help in other formats by using the &lt;comment&gt;--format&lt;/comment&gt; option:
&lt;info&gt;php app/console help --format=xml list&lt;/info&gt; &lt;info&gt;app/console help --format=xml list&lt;/info&gt;
To display the list of available commands, please use the &lt;info&gt;list&lt;/info&gt; command.</help> To display the list of available commands, please use the &lt;info&gt;list&lt;/info&gt; command.</help>
<arguments> <arguments>
@ -63,19 +63,19 @@
<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;list&lt;/info&gt; command lists all commands:
&lt;info&gt;php app/console list&lt;/info&gt; &lt;info&gt;app/console list&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;app/console list test&lt;/info&gt;
You can also output the information in other formats by using the &lt;comment&gt;--format&lt;/comment&gt; option: You can also output the information in other formats by using the &lt;comment&gt;--format&lt;/comment&gt; option:
&lt;info&gt;php app/console list --format=xml&lt;/info&gt; &lt;info&gt;app/console list --format=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;app/console list --raw&lt;/info&gt;</help>
<arguments> <arguments>
<argument name="namespace" is_required="0" is_array="0"> <argument name="namespace" is_required="0" is_array="0">
<description>The namespace name</description> <description>The namespace name</description>

View File

@ -11,7 +11,7 @@
"help [--format FORMAT] [--raw] [--] [<command_name>]" "help [--format FORMAT] [--raw] [--] [<command_name>]"
], ],
"description": "Displays help for a command", "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.", "help": "The <info>help<\/info> command displays help for a given command:\n\n <info>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>app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the <info>list<\/info> command.",
"definition": { "definition": {
"arguments": { "arguments": {
"command_name": { "command_name": {
@ -114,7 +114,7 @@
"list [--raw] [--format FORMAT] [--] [<namespace>]" "list [--raw] [--format FORMAT] [--] [<namespace>]"
], ],
"description": "Lists commands", "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>", "help": "The <info>list<\/info> command lists all commands:\n\n <info>app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n <info>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>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>app\/console list --raw<\/info>",
"definition": { "definition": {
"arguments": { "arguments": {
"namespace": { "namespace": {

View File

@ -28,11 +28,11 @@ Displays help for a command
The help command displays help for a given command: The help command displays help for a given command:
php app/console help list app/console help list
You can also output the help in other formats by using the --format option: You can also output the help in other formats by using the --format option:
php app/console help --format=xml list app/console help --format=xml list
To display the list of available commands, please use the list command. To display the list of available commands, please use the list command.
@ -140,19 +140,19 @@ Lists commands
The list command lists all commands: The list command lists all commands:
php app/console list app/console list
You can also display the commands for a specific namespace: You can also display the commands for a specific namespace:
php app/console list test app/console list test
You can also output the information in other formats by using the --format option: You can also output the information in other formats by using the --format option:
php app/console list --format=xml app/console list --format=xml
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):
php app/console list --raw app/console list --raw
### Arguments ### Arguments

View File

@ -8,11 +8,11 @@
<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;help&lt;/info&gt; command displays help for a given command:
&lt;info&gt;php app/console help list&lt;/info&gt; &lt;info&gt;app/console help list&lt;/info&gt;
You can also output the help in other formats by using the &lt;comment&gt;--format&lt;/comment&gt; option: You can also output the help in other formats by using the &lt;comment&gt;--format&lt;/comment&gt; option:
&lt;info&gt;php app/console help --format=xml list&lt;/info&gt; &lt;info&gt;app/console help --format=xml list&lt;/info&gt;
To display the list of available commands, please use the &lt;info&gt;list&lt;/info&gt; command.</help> To display the list of available commands, please use the &lt;info&gt;list&lt;/info&gt; command.</help>
<arguments> <arguments>
@ -63,19 +63,19 @@
<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;list&lt;/info&gt; command lists all commands:
&lt;info&gt;php app/console list&lt;/info&gt; &lt;info&gt;app/console list&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;app/console list test&lt;/info&gt;
You can also output the information in other formats by using the &lt;comment&gt;--format&lt;/comment&gt; option: You can also output the information in other formats by using the &lt;comment&gt;--format&lt;/comment&gt; option:
&lt;info&gt;php app/console list --format=xml&lt;/info&gt; &lt;info&gt;app/console list --format=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;app/console list --raw&lt;/info&gt;</help>
<arguments> <arguments>
<argument name="namespace" is_required="0" is_array="0"> <argument name="namespace" is_required="0" is_array="0">
<description>The namespace name</description> <description>The namespace name</description>

View File

@ -19,11 +19,11 @@ Displays help for a command
The help command displays help for a given command: The help command displays help for a given command:
php app/console help list app/console help list
You can also output the help in other formats by using the --format option: You can also output the help in other formats by using the --format option:
php app/console help --format=xml list app/console help --format=xml list
To display the list of available commands, please use the list command. To display the list of available commands, please use the list command.
@ -131,19 +131,19 @@ Lists commands
The list command lists all commands: The list command lists all commands:
php app/console list app/console list
You can also display the commands for a specific namespace: You can also display the commands for a specific namespace:
php app/console list test app/console list test
You can also output the information in other formats by using the --format option: You can also output the information in other formats by using the --format option:
php app/console list --format=xml app/console list --format=xml
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):
php app/console list --raw app/console list --raw
### Arguments ### Arguments

View File

@ -21,16 +21,16 @@ Options:
Help: Help:
The list command lists all commands: The list command lists all commands:
php app/console list app/console list
You can also display the commands for a specific namespace: You can also display the commands for a specific namespace:
php app/console list test app/console list test
You can also output the information in other formats by using the --format option: You can also output the information in other formats by using the --format option:
php app/console list --format=xml app/console list --format=xml
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):
php app/console list --raw app/console list --raw

View File

@ -21,16 +21,16 @@ Options:
Help: Help:
The list command lists all commands: The list command lists all commands:
php app/console list app/console list
You can also display the commands for a specific namespace: You can also display the commands for a specific namespace:
php app/console list test app/console list test
You can also output the information in other formats by using the --format option: You can also output the information in other formats by using the --format option:
php app/console list --format=xml app/console list --format=xml
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):
php app/console list --raw app/console list --raw

View File

@ -21,10 +21,10 @@ Options:
Help: Help:
The help command displays help for a given command: The help command displays help for a given command:
php app/console help list app/console help list
You can also output the help in other formats by using the --format option: You can also output the help in other formats by using the --format option:
php app/console help --format=xml list app/console help --format=xml list
To display the list of available commands, please use the list command. To display the list of available commands, please use the list command.