Skip to content

Commit

Permalink
Use @allow-additional-options in sql-sync
Browse files Browse the repository at this point in the history
sql-sync no longer shows sanitize since that requires full bootstrap. @todo - fix that.

also fix small bug when @allow-additional-optoins has no value in an Annotated command.
  • Loading branch information
weitzman committed Aug 4, 2017
1 parent 5a9badb commit 8d7443e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions includes/annotationcommand_adapter.inc
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,9 @@ function annotationcommand_adapter_get_commands_for_commandhandler($commandhandl
if (isset($returnType)) {
$command['return-type'] = $returnType;
}
if ($additional = $commandinfo->getAnnotation('allow-additional-options')) {
$command['allow-additional-options'] = StringUtils::csvToArray($additional);
if ($commandinfo->hasAnnotation('allow-additional-options')) {
$additional = $commandinfo->getAnnotation('allow-additional-options');
$command['allow-additional-options'] = empty($additional) ? true : StringUtils::csvToArray($additional);
}
if ($dependencies = $commandinfo->getAnnotation('drupal-dependencies')) {
$command['drupal dependencies'] = StringUtils::csvToArray($dependencies);
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/sql/SqlSyncCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class SqlSyncCommands extends DrushCommands
* @option create-db Create a new database before importing the database dump on the target machine.
* @option db-su Account to use when creating a new database (e.g. root).
* @option db-su-pw Password for the db-su account.
* @allow-additional-options sql-sanitize
* # We cannot list sql-sanitize below since it bootstraps higher - to FULL.
* @allow-additional-options
* @option sanitize Obscure email addresses and reset passwords in the user table post-sync.
* @option confirm-sanitizations Prompt yes/no after importing the database, but before running the sanitizations.
* @usage drush sql-sync @source @target
Expand Down

0 comments on commit 8d7443e

Please sign in to comment.