From c93305a80548bf04650d8c05c98803b95dada90e Mon Sep 17 00:00:00 2001 From: SofHad Date: Fri, 26 Dec 2014 00:07:49 +0100 Subject: [PATCH] To show instead of open the repository or homepage URL --- src/Composer/Command/HomeCommand.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Composer/Command/HomeCommand.php b/src/Composer/Command/HomeCommand.php index 5b0e32244..fe7929839 100644 --- a/src/Composer/Command/HomeCommand.php +++ b/src/Composer/Command/HomeCommand.php @@ -40,12 +40,14 @@ class HomeCommand extends Command ->setDefinition(array( new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'Package(s) to browse to.'), new InputOption('homepage', 'H', InputOption::VALUE_NONE, 'Open the homepage instead of the repository URL.'), + new InputOption('show', 's', InputOption::VALUE_NONE, 'Only show the homepage or repository URL.'), )) ->setHelp(<<openBrowser($url); + if ($input->getOption('show')) { + $output->writeln(sprintf('%s: %s', $input->getOption('homepage') ? 'Homepage URL' : 'Repository URL', $url).' '); + } else { + $this->openBrowser($url); + } } return $return;