Removed deprecated stuff from the Console component

This commit is contained in:
Diego Saint Esteben 2015-06-09 19:14:18 -03:00
parent 2b858be7c4
commit a2a449cc07
13 changed files with 14 additions and 88 deletions

View File

@ -37,7 +37,6 @@ class HelpCommand extends Command
->setName('help')
->setDefinition(array(
new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'),
new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'),
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'),
))
@ -76,12 +75,6 @@ EOF
$this->command = $this->getApplication()->find($input->getArgument('command_name'));
}
if ($input->getOption('xml')) {
@trigger_error('The --xml option was deprecated in version 2.7 and will be removed in version 3.0. Use the --format option instead.', E_USER_DEPRECATED);
$input->setOption('format', 'xml');
}
$helper = new DescriptorHelper();
$helper->describe($output, $this->command, array(
'format' => $input->getOption('format'),

View File

@ -68,12 +68,6 @@ EOF
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
if ($input->getOption('xml')) {
@trigger_error('The --xml option was deprecated in version 2.7 and will be removed in version 3.0. Use the --format option instead.', E_USER_DEPRECATED);
$input->setOption('format', 'xml');
}
$helper = new DescriptorHelper();
$helper->describe($output, $this->getApplication(), array(
'format' => $input->getOption('format'),
@ -89,7 +83,6 @@ EOF
{
return new InputDefinition(array(
new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'),
new InputOption('xml', null, InputOption::VALUE_NONE, 'To output list as XML'),
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'),
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
));

View File

@ -64,7 +64,7 @@ class HelpCommandTest extends \PHPUnit_Framework_TestCase
$application = new Application();
$commandTester = new CommandTester($application->get('help'));
$commandTester->execute(array('command_name' => 'list', '--format' => 'xml'));
$this->assertContains('list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
$this->assertContains('list [--raw] [--format FORMAT] [--] [<namespace>]', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
$this->assertContains('<command', $commandTester->getDisplay(), '->execute() returns an XML help text if --format=xml is passed');
}
}

View File

@ -1 +1 @@
{"commands":[{"name":"help","usage":["help [--xml] [--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":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","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"},"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 [--xml] [--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":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"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","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"]}]}

View File

@ -10,7 +10,7 @@ help
* Description: Displays help for a command
* Usage:
* `help [--xml] [--format FORMAT] [--raw] [--] [<command_name>]`
* `help [--format FORMAT] [--raw] [--] [<command_name>]`
The <info>help</info> command displays help for a given command:
@ -34,16 +34,6 @@ To display the list of available commands, please use the <info>list</info> comm
### Options:
**xml:**
* Name: `--xml`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: To output help as XML
* Default: `false`
**format:**
* Name: `--format`
@ -140,7 +130,7 @@ list
* Description: Lists commands
* Usage:
* `list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]`
* `list [--raw] [--format FORMAT] [--] [<namespace>]`
The <info>list</info> command lists all commands:
@ -170,16 +160,6 @@ It's also possible to get raw list of commands (useful for embedding command run
### Options:
**xml:**
* Name: `--xml`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: To output list as XML
* Default: `false`
**raw:**
* Name: `--raw`

View File

@ -3,7 +3,7 @@
<commands>
<command id="help" name="help">
<usages>
<usage>help [--xml] [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
<usage>help [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
</usages>
<description>Displays help for a command</description>
<help>The &lt;info&gt;help&lt;/info&gt; command displays help for a given command:
@ -24,9 +24,6 @@
</argument>
</arguments>
<options>
<option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>To output help as XML</description>
</option>
<option name="--format" shortcut="" accept_value="1" is_value_required="1" is_multiple="0">
<description>The output format (txt, xml, json, or md)</description>
<defaults>
@ -61,7 +58,7 @@
</command>
<command id="list" name="list">
<usages>
<usage>list [--xml] [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
<usage>list [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
</usages>
<description>Lists commands</description>
<help>The &lt;info&gt;list&lt;/info&gt; command lists all commands:
@ -86,9 +83,6 @@
</argument>
</arguments>
<options>
<option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>To output list as XML</description>
</option>
<option name="--raw" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>To output raw command list</description>
</option>

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,7 @@ help
* Description: Displays help for a command
* Usage:
* `help [--xml] [--format FORMAT] [--raw] [--] [<command_name>]`
* `help [--format FORMAT] [--raw] [--] [<command_name>]`
The <info>help</info> command displays help for a given command:
@ -41,16 +41,6 @@ To display the list of available commands, please use the <info>list</info> comm
### Options:
**xml:**
* Name: `--xml`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: To output help as XML
* Default: `false`
**format:**
* Name: `--format`
@ -147,7 +137,7 @@ list
* Description: Lists commands
* Usage:
* `list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]`
* `list [--raw] [--format FORMAT] [--] [<namespace>]`
The <info>list</info> command lists all commands:
@ -177,16 +167,6 @@ It's also possible to get raw list of commands (useful for embedding command run
### Options:
**xml:**
* Name: `--xml`
* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
* Description: To output list as XML
* Default: `false`
**raw:**
* Name: `--raw`

View File

@ -3,7 +3,7 @@
<commands>
<command id="help" name="help">
<usages>
<usage>help [--xml] [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
<usage>help [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
</usages>
<description>Displays help for a command</description>
<help>The &lt;info&gt;help&lt;/info&gt; command displays help for a given command:
@ -24,9 +24,6 @@
</argument>
</arguments>
<options>
<option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>To output help as XML</description>
</option>
<option name="--format" shortcut="" accept_value="1" is_value_required="1" is_multiple="0">
<description>The output format (txt, xml, json, or md)</description>
<defaults>
@ -61,7 +58,7 @@
</command>
<command id="list" name="list">
<usages>
<usage>list [--xml] [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
<usage>list [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
</usages>
<description>Lists commands</description>
<help>The &lt;info&gt;list&lt;/info&gt; command lists all commands:
@ -86,9 +83,6 @@
</argument>
</arguments>
<options>
<option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>To output list as XML</description>
</option>
<option name="--raw" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>To output raw command list</description>
</option>

View File

@ -3,7 +3,7 @@
<commands>
<command id="help" name="help">
<usages>
<usage>help [--xml] [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
<usage>help [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
</usages>
<description>Displays help for a command</description>
<help>The &lt;info&gt;help&lt;/info&gt; command displays help for a given command:
@ -24,9 +24,6 @@
</argument>
</arguments>
<options>
<option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>To output help as XML</description>
</option>
<option name="--format" shortcut="" accept_value="1" is_value_required="1" is_multiple="0">
<description>The output format (txt, xml, json, or md)</description>
<defaults>
@ -61,7 +58,7 @@
</command>
<command id="list" name="list">
<usages>
<usage>list [--xml] [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
<usage>list [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
</usages>
<description>Lists commands</description>
<help>The &lt;info&gt;list&lt;/info&gt; command lists all commands:
@ -86,9 +83,6 @@
</argument>
</arguments>
<options>
<option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>To output list as XML</description>
</option>
<option name="--raw" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>To output raw command list</description>
</option>

View File

@ -6,6 +6,6 @@
list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]
list [--raw] [--format FORMAT] [--] [<namespace>]

View File

@ -6,7 +6,6 @@ Arguments:
command_name The command name [default: "help"]
Options:
--xml To output help as XML
--format=FORMAT The output format (txt, xml, json, or md) [default: "txt"]
--raw To output raw command help
-h, --help Display this help message

View File

@ -5,7 +5,6 @@ Arguments:
namespace The namespace name
Options:
--xml To output list as XML
--raw To output raw command list
--format=FORMAT The output format (txt, xml, json, or md) [default: "txt"]