You are here

function drush_node_revision_delete_nrd_delete_cron_run_validate in Node Revision Delete 8

Same name and namespace in other branches
  1. 7.3 node_revision_delete.drush.inc \drush_node_revision_delete_nrd_delete_cron_run_validate()

Implements drush_hook_COMMAND_validate().

File

./node_revision_delete.drush.inc, line 198
Drush commands related to the Node Revision Delete module.

Code

function drush_node_revision_delete_nrd_delete_cron_run_validate() {
  $args = func_get_args();

  // If we don't have arguments we will return the config values.
  if (!count($args)) {
    return;
  }

  // Check for only one argument.
  if (count($args) > 1) {
    return drush_set_error('NODE_REVISION_DELETE_INVALID_ARGUMENT', dt('This command use only one argument as quantity.'));
  }

  // Check for integer quantity.
  if (!ctype_digit($args[0])) {
    return drush_set_error('NODE_REVISION_DELETE_INVALID_ARGUMENT', dt('You must specify digits for the quantity.'));
  }
}