From 247f237f93d36b3120b3ac77c15c906034c6bd28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Bj=C3=B8rnskov?= Date: Mon, 7 Nov 2011 14:19:15 +0100 Subject: [PATCH] HelpCommand Simple HelpCommand that displays the same information about Composer that is availible in the README.md file. --- src/Composer/Command/HelpCommand.php | 45 ++++++++++++++++++++++++++++ src/Composer/Console/Application.php | 1 + 2 files changed, 46 insertions(+) create mode 100644 src/Composer/Command/HelpCommand.php diff --git a/src/Composer/Command/HelpCommand.php b/src/Composer/Command/HelpCommand.php new file mode 100644 index 000000000..0f8d7a4d3 --- /dev/null +++ b/src/Composer/Command/HelpCommand.php @@ -0,0 +1,45 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Command; + +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * @author Jordi Boggiano + */ +class HelpCommand extends Command +{ + protected function configure() + { + $this + ->setName('help') + ->setDescription('') + ->setHelp(<<php composer.phar help +EOT + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $output->writeln(<<Composer - Package Management for PHP +Composer is a package manager tracking local dependencies of your projects and libraries. +See the "about page" on packagist.org for more information. +EOT + ); + + } +} diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index b34607eee..034845b91 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -63,6 +63,7 @@ class Application extends BaseApplication */ protected function registerCommands() { + $this->add(new Command\HelpCommand()); $this->add(new Command\InstallCommand()); $this->add(new Command\UpdateCommand()); $this->add(new Command\DebugPackagesCommand());