You are here

function sweaver_drush_verify in Sweaver 6

Same name and namespace in other branches
  1. 7 drush/sweaver.drush.inc \sweaver_drush_verify()

Verify arguments.

Parameters

$args: A collection of arguments passed by cli.

$type: Whether we need to verify styles or variables.

Return value

$string Which action to undertake.

2 calls to sweaver_drush_verify()
sweaver_drush_style in drush/sweaver.drush.inc
Edit a style via drush.
sweaver_drush_variables in drush/sweaver.drush.inc
Set Sweaver variables via Drush.

File

drush/sweaver.drush.inc, line 330
Sweaver Drush functions.

Code

function sweaver_drush_verify($args, $type = 'styles') {
  if (empty($args)) {
    return 'list';
  }
  if ($type == 'styles' && isset($args[0]) && is_numeric($args[0])) {
    return 'edit';
  }
  if ($type == 'variables' && isset($args[0]) && is_string($args[0]) && isset($args[1]) && is_string($args[1])) {
    return 'save';
  }
  else {
    drush_print(dt('Wrong variables supplied.'));
  }
}