When you use the following command, in some cases a confirmation message appears, making it impossible to automate.

drush [@site.alias] vdel maintenance_mode
Enter a number to choose which variable to delete.
 [0]  :  Cancel                   
 [1]  :  maintenance_mode         
 [2]  :  maintenance_mode_message

Is there a way to make drush not try to be helpful when an exact match exists to a variable name?

Comments

moshe weitzman’s picture

Title: How to use vdel without confirmation » Add --always-set option to vdel
Version: All-versions-4.x-dev »
Category: support » feature

Not possible yet. I suggest adding a --always-delete option which does this. That name matches --always-set in vset command.

msonnabaum’s picture

Does -y not work here? I know I have this line in my deployment script and it works:

drush -r /var/www/drupal/docroot vset -y site_offline 0

moshe weitzman’s picture

@msonnabaum - that only works if there is one match, Look at the example moonray posted.

msonnabaum’s picture

Yeah, I'd be ok with never prompting unless there isn't an exact match. It's always felt odd to me the way it works now.

greg.1.anderson’s picture

Version: » 8.x-6.x-dev
Status: Active » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.