You are here

function drush_hacked_drush_command_validate in Hacked! 6.2

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

Validate hook for the hacked drush commands that need a project.

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
Validate hook for the hacked_diff drush command.

File

./hacked.drush.inc, line 262
Hacked drush command.

Code

function drush_hacked_drush_command_validate($short_name = '') {
  if (empty($short_name)) {
    return drush_set_error('HACKED_PROJECT_NOT_FOUND', dt('A valid project must be specified', array(
      '@project' => $short_name,
    )));
  }
  $project = hacked_project_load($short_name);
  $project
    ->identify_project();
  if (!$project->project_identified) {
    return drush_set_error('HACKED_PROJECT_NOT_FOUND', dt('Could not find project: @project', array(
      '@project' => $short_name,
    )));
  }
  $project = NULL;
}