You are here

function drush_hacked_drush_command_validate in Hacked! 7.2

Same name and namespace in other branches
  1. 8.2 hacked.drush.inc \drush_hacked_drush_command_validate()
  2. 6.2 hacked.drush.inc \drush_hacked_drush_command_validate()

Generic validator for hacked drush commands.

Parameters

string $short_name: The name of the project in question.

Return value

null|boolean Return FALSE if there's an error.

2 calls to drush_hacked_drush_command_validate()
drush_hacked_details_validate in ./hacked.drush.inc
Validate hook for the hacked_details drush command.
drush_hacked_diff_validate in ./hacked.drush.inc
Validation callback for drush hacked_diff.

File

./hacked.drush.inc, line 313

Code

function drush_hacked_drush_command_validate($short_name = '') {
  hacked_load_drush_dependencies();
  if (empty($short_name)) {
    return drush_set_error('HACKED_PROJECT_NOT_FOUND', dt('You must specify the name of a project.'));
  }
  $project = hacked_project_load($short_name);
  $project
    ->identify_project();
  if (!$project->project_identified) {
    return drush_set_error('HACKED_PROJECT_NOT_FOUND', dt('Unable to find "@project".', array(
      '@project' => $short_name,
    )));
  }
}