You are here

function drush_l10n_update_validate in Localization update 7

Same name and namespace in other branches
  1. 6 l10n_update.drush.inc \drush_l10n_update_validate()
  2. 7.2 l10n_update.drush.inc \drush_l10n_update_validate()

Validate command l10n-update.

File

./l10n_update.drush.inc, line 100
Drush interface to l10n-update functionalities.

Code

function drush_l10n_update_validate() {
  _drush_l10n_update_validate_languages();

  // Check provided update mode is valid.
  $mode = drush_get_option('mode', 'keep');
  if (!in_array($mode, array(
    'keep',
    'replace',
    'overwrite',
  ))) {
    return drush_set_error('L10N_UPDATE_INVALID_MODE', dt('Invalid update mode. Valid options are keep, replace, overwrite.'));
  }
}