X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fother%2Fdrush-command.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fother%2Fdrush-command.twig;h=257b073bbf7328562b63a3de5199d364f2ca0559;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/chi-teck/drupal-code-generator/templates/other/drush-command.twig b/vendor/chi-teck/drupal-code-generator/templates/other/drush-command.twig new file mode 100644 index 000000000..257b073bb --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/other/drush-command.twig @@ -0,0 +1,55 @@ + '{{ description }}', + 'arguments' => [ + '{{ argument }}' => 'Argument description', + ], + 'required-arguments' => TRUE, + 'options' => [ + '{{ option }}' => 'Option description', + ], + 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, + 'aliases' => ['{{ alias }}'], + 'examples' => [ + 'drush {{ alias }} {{ argument }} --{{ option }}' => 'It does something with this argument', + ], + ]; + + return $items; +} + +/** + * Callback function for {{ command_name }} command. + */ +function drush_{{ command_callback_suffix | h2u }}($argument) { + + $option = drush_get_option('{{ option }}', 'default'); + drush_print(dt('Argument value is "@argument".', ['@argument' => $argument])); + drush_print(dt('Option value is "@option".', ['@option' => $option])); + + drush_set_error(dt('Error text here.')); + drush_log(dt('Log text here')); + +}