diff --git a/composer.json b/composer.json index 1be448552e..facce5030a 100644 --- a/composer.json +++ b/composer.json @@ -39,8 +39,8 @@ "symfony/yaml": "~2.3|~3.0", "symfony/var-dumper": "~2.7|~3.0", "league/container": "~2", - "consolidation/robo": "dev-container-config", - "consolidation/annotated-command": "~2", + "consolidation/robo": "dev-hook-apis", + "consolidation/annotated-command": "dev-master", "consolidation/output-formatters": "~2", "symfony/console": "2.7.*", "symfony/event-dispatcher": "2.7.*", diff --git a/composer.lock b/composer.lock index bf525b7d94..69940617de 100644 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "ca598000c36e7c121133891dbf83902f", - "content-hash": "d0605041388d0a0d94fdc0631f25581b", + "hash": "7c8ff550e69be005380ad22e03aae15f", + "content-hash": "4757820550d13367962900b56f0db53a", "packages": [ { "name": "consolidation/annotated-command", - "version": "2.0.0-rc6", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "70b9a3db9438e23560ef29bc7c931de24214d37b" + "reference": "534a4a4fadf3d8a48ac95bae88d131b8d6712806" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/70b9a3db9438e23560ef29bc7c931de24214d37b", - "reference": "70b9a3db9438e23560ef29bc7c931de24214d37b", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/534a4a4fadf3d8a48ac95bae88d131b8d6712806", + "reference": "534a4a4fadf3d8a48ac95bae88d131b8d6712806", "shasum": "" }, "require": { @@ -57,7 +57,7 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2016-09-28 04:44:03" + "time": "2016-09-30 18:36:17" }, { "name": "consolidation/log", @@ -156,20 +156,20 @@ }, { "name": "consolidation/robo", - "version": "dev-container-config", + "version": "dev-hook-apis", "source": { "type": "git", "url": "https://github.com/consolidation/Robo.git", - "reference": "0ff0c43601254a819cdbbb941f7884c92c50a86a" + "reference": "38b11bab144a492d9ab26c5d23cc761bfd2d79b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/Robo/zipball/0ff0c43601254a819cdbbb941f7884c92c50a86a", - "reference": "0ff0c43601254a819cdbbb941f7884c92c50a86a", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/38b11bab144a492d9ab26c5d23cc761bfd2d79b8", + "reference": "38b11bab144a492d9ab26c5d23cc761bfd2d79b8", "shasum": "" }, "require": { - "consolidation/annotated-command": "^2.0.0-rc2", + "consolidation/annotated-command": "dev-master", "consolidation/log": "~1", "consolidation/output-formatters": "^2.0.0-rc1", "league/container": "^2.2", @@ -226,7 +226,7 @@ } ], "description": "Modern task runner", - "time": "2016-09-28 17:34:57" + "time": "2016-09-30 20:23:46" }, { "name": "container-interop/container-interop", @@ -2164,7 +2164,8 @@ "aliases": [], "minimum-stability": "beta", "stability-flags": { - "consolidation/robo": 20 + "consolidation/robo": 20, + "consolidation/annotated-command": 20 }, "prefer-stable": true, "prefer-lowest": false, diff --git a/lib/Drush/CommandFiles/ExampleCommandFile.php b/lib/Drush/CommandFiles/ExampleCommandFile.php index 8e53aacca4..5529473296 100644 --- a/lib/Drush/CommandFiles/ExampleCommandFile.php +++ b/lib/Drush/CommandFiles/ExampleCommandFile.php @@ -10,6 +10,8 @@ use Consolidation\AnnotatedCommand\AnnotationData; use Consolidation\OutputFormatters\StructuredData\RowsOfFields; +use Consolidation\AnnotatedCommand\CommandData; + class ExampleCommandFile { /** @@ -46,9 +48,9 @@ public function exampleTable($options = ['format' => 'table', 'fields' => '']) * @option $french Add a row with French numbers. * @usage example:formatters --french */ - public function alterFormatters($result, array $args, AnnotationData $annotationData) + public function alterFormatters($result, CommandData $commandData) { - if ($args['options']['french']) { + if ($commandData->input()->getOption('french')) { $result['fr'] = [ 'first' => 'Un', 'second' => 'Deux', 'third' => 'Trois' ]; } diff --git a/lib/Drush/CommandFiles/core/DrupliconCommands.php b/lib/Drush/CommandFiles/core/DrupliconCommands.php index 92b6b42659..525947d06a 100644 --- a/lib/Drush/CommandFiles/core/DrupliconCommands.php +++ b/lib/Drush/CommandFiles/core/DrupliconCommands.php @@ -1,7 +1,10 @@ printed) { + return; + } + $this->printed = true; + $annotationData = $commandData->annotationData(); + $commandName = $annotationData['command']; + // For some reason, Drush help uses drush_invoke_process to call helpsingle + if ($commandName == 'helpsingle') { + return; + } + drush_log(dt('Displaying Druplicon for "!command" command.', array('!command' => $commandName))); + if ($commandData->input()->getOption('druplicon')) { $misc_dir = DRUSH_BASE_PATH . '/misc'; if (drush_get_context('DRUSH_NOCOLOR')) { $content = file_get_contents($misc_dir . '/druplicon-no_color.txt');