X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrush%2Fdrush%2Flib%2FDrush%2FCommandFiles%2FExampleCommandFile.php;fp=vendor%2Fdrush%2Fdrush%2Flib%2FDrush%2FCommandFiles%2FExampleCommandFile.php;h=ec764dd6f4a795df9bdf5561dd61d5e78eda3ed0;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/drush/drush/lib/Drush/CommandFiles/ExampleCommandFile.php b/vendor/drush/drush/lib/Drush/CommandFiles/ExampleCommandFile.php new file mode 100644 index 000000000..ec764dd6f --- /dev/null +++ b/vendor/drush/drush/lib/Drush/CommandFiles/ExampleCommandFile.php @@ -0,0 +1,59 @@ + 'table', 'fields' => '']) + { + $outputData = [ + 'en' => [ 'first' => 'One', 'second' => 'Two', 'third' => 'Three' ], + 'de' => [ 'first' => 'Eins', 'second' => 'Zwei', 'third' => 'Drei' ], + 'jp' => [ 'first' => 'Ichi', 'second' => 'Ni', 'third' => 'San' ], + 'es' => [ 'first' => 'Uno', 'second' => 'Dos', 'third' => 'Tres' ], + ]; + return new RowsOfFields($outputData); + } + + /** + * Demonstrate an alter hook with an option + * + * @hook alter example:table + * @option french Add a row with French numbers. + * @usage example:formatters --french + */ + public function alterFormatters($result, CommandData $commandData) + { + if ($commandData->input()->getOption('french')) { + $result['fr'] = [ 'first' => 'Un', 'second' => 'Deux', 'third' => 'Trois' ]; + } + + return $result; + } +}