Commit 55f808b4 authored by gbyte.co's avatar gbyte.co

Issue #3017036 by mitrpaka, gbyte.co: Drush command naming and aliases (prior to Drush 9)

parent 0dd61d19
......@@ -9,16 +9,18 @@
* Implements hook_drush_command().
*/
function simple_sitemap_drush_command() {
$items['simple_sitemap-generate'] = [
$items['simple-sitemap-generate'] = [
'description' => 'Regenerate the XML sitemaps according to the module settings.',
'callback' => 'drush_simple_sitemap_generate',
'drupal dependencies' => ['simple_sitemap'],
'aliases' => ['ssg'],
];
$items['simple_sitemap-rebuild-queue'] = [
$items['simple-sitemap-rebuild-queue'] = [
'description' => 'Rebuild the sitemap queue for all sitemap variants.',
'callback' => 'drush_simple_sitemap_rebuild_queue',
'drupal dependencies' => ['simple_sitemap'],
'aliases' => ['ssr'],
];
return $items;
......@@ -27,7 +29,7 @@ function simple_sitemap_drush_command() {
/**
* Callback function for hook_drush_command().
*
* Regenerate the XML sitemaps.
* Regenerate the XML sitemaps according to the module settings.
*/
function drush_simple_sitemap_generate() {
\Drupal::service('simple_sitemap.generator')->generateSitemap('drush');
......
......@@ -28,8 +28,13 @@ class SimplesitemapCommands extends DrushCommands {
* Regenerate the XML sitemaps according to the module settings.
*
* @command simple-sitemap:generate
*
* @usage drush simple-sitemap:generate
* Regenerate the XML sitemaps according to the module settings.
*
* @validate-module-enabled simple_sitemap
* @aliases ss:generate, ssg, simple_sitemap:generate, simple_sitemap-generate
*
* @aliases ssg, simple-sitemap-generate
*/
public function generate() {
$this->generator->generateSitemap('drush');
......@@ -39,8 +44,13 @@ class SimplesitemapCommands extends DrushCommands {
* Rebuild the sitemap queue for all sitemap variants.
*
* @command simple-sitemap:rebuild-queue
*
* @usage drush simple-sitemap:rebuild-queue
* Rebuild the sitemap queue for all sitemap variants.
*
* @validate-module-enabled simple_sitemap
* @aliases ss:rebuild-queue, ssr, simple_sitemap:rebuild-queue, simple_sitemap-rebuild-queue
*
* @aliases ssr, simple-sitemap-rebuild-queue
*/
public function rebuildQueue() {
$this->generator->rebuildQueue();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment