8000 [Console] application/command as text/xml/whatever decoupling by jfsimon · Pull Request #7454 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] application/command as text/xml/whatever decoupling #7454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
da67c12
[Console] added descriptor & refactored description commands
jfsimon Mar 22, 2013
f239b1c
[Console] added JSON descriptors
jfsimon Apr 1, 2013
bebf1eb
[Console] added markdown descriptors
jfsimon Apr 3, 2013
43b5e5c
[Console] added forgotten headers
jfsimon Apr 3, 2013
acc7414
[Console] removed unused methods (tests broken)
jfsimon Apr 3, 2013
774794c
[Console] fixed tests
jfsimon Apr 3, 2013
2066a9b
[Console] added XML descriptors
jfsimon Apr 6, 2013
47fa194
[Console] started text derciptors
jfsimon Apr 6, 2013
8b56eb1
[Console] finished text descriptors
jfsimon Apr 8, 2013
27aa872
[Console] repaired tests
jfsimon Apr 10, 2013
30d8807
[Console] re-introduced asText & asXml methods to avoid BC break
jfsimon Apr 14, 2013
9964838
[Console] added command definition merge be fore description
jfsimon Apr 14, 2013
ef6d8ba
[Console] simplified description commands
jfsimon Apr 14, 2013
389101a
[Console] re-introduced --xml option to avoid BC break
jfsimon Apr 14, 2013
84be8de
[Console] simplified mardown descriptors
jfsimon Apr 14, 2013
ce5c0fd
[Console] applied comments from github
jfsimon Apr 14, 2013
49a4612
[Console] applied comments from github
jfsimon Apr 14, 2013
20c10a5
[Console] added provider injection to descriptors
jfsimon Apr 14, 2013
9c7b358
[Console] simplified descriptors
jfsimon Apr 23, 2013
d3ec073
[Console] applied advices from github comments
jfsimon Apr 23, 2013
d70e086
[Console] removed proxy
jfsimon Apr 23, 2013
ce60fb7
[Console] simplified descriptor interface
jfsimon Apr 23, 2013
28f082e
[Console] removed changes
jfsimon Apr 23, 2013
cbb8105
[Console] moved commands arguments
jfsimon Apr 23, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8000
Prev Previous commit
Next Next commit
[Console] removed changes
  • Loading branch information
jfsimon committed Apr 23, 2013
commit 28f082e2178bf21a8cda3f443c0255d63112e95f
2 changes: 2 additions & 0 deletions src/Symfony/Component/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,8 @@ private function getAbbreviationSuggestions($abbrevs)
/**
* Returns the namespace part of the command name.
*
* This method is not part of public API and should not be used directly.
*
* @param string $name The full name of the command
* @param string $limit The maximum number of parts of the namespace
*
Expand Down
4 changes: 4 additions & 0 deletions src/Symfony/Component/Console/Command/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ public function setCode($code)
/**
* Merges the application definition with the command definition.
*
* This method is not part of public API and should not be used directly.
*
* @param Boolean $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments
*/
public function mergeApplicationDefinition($mergeArgs = true)
Expand Down Expand Up @@ -334,6 +336,8 @@ public function getDefinition()
* Can be overridden to provide the original command representation when it would otherwise
* be changed by merging with the application InputDefinition.
*
* This method is not part of public API and should not be used directly.
*
* @return InputDefinition An InputDefinition instance
*/
public function getNativeDefinition()
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/Console/Command/HelpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ protected function configure()

$this
->setName('help')
->setDescription('Displays help for a command')
->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, 'To output help in other formats.'),
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help.'),
new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML.'),
new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'),
))
->setDescription('Displays help for a command')
->setHelp(<<<EOF
The <info>%command.name%</info> command displays help for a given command:

Expand Down
30 changes: 15 additions & 15 deletions src/Symfony/Component/Console/Command/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

use Symfony\Component\Console\Helper\DescriptorHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputDefinition;

/**
* ListCommand displays the list of all available commands for the application.
Expand All @@ -32,8 +32,8 @@ protected function configure()
{
$this
->setName('list')
->setDescription('Lists commands')
->setDefinition($this->createDefinition())
->setDescription('Lists commands')
->setHelp(<<<EOF
The <info>%command.name%</info> command lists all commands:

Expand All @@ -55,19 +55,6 @@ protected function configure()
;
}

/**
* {@inheritdoc}
*/
private function createDefinition()
{
return new InputDefinition(array(
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'To output list in other formats.'),
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list.'),
new InputOption('xml', null, InputOption::VALUE_NONE, 'To output list as XML.'),
new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'),
));
}

/**
* {@inheritdoc}
*/
Expand All @@ -88,4 +75,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
$helper = new DescriptorHelper();
$helper->describe($output, $this->getApplication(), $input->getOption('format'), $input->getOption('raw'));
}

/**
* {@inheritdoc}
*/
private function createDefinition()
{
return new InputDefinition(array(
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'To output list in other formats.'),
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list.'),
new InputOption('xml', null, InputOption::VALUE_NONE, 'To output list as XML.'),
new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'),
));
}
}
0