Closed (fixed)
Project:
Drush
Version:
All-Versions-2.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
24 Dec 2009 at 03:26 UTC
Updated:
12 Jan 2010 at 17:20 UTC
Jump to comment: Most recent file
Problem:
1) When adding a variable to db via drush, you get prompted as to whether to create a new variable
2) --yes option does not work in the case where the new variable has the same beginning of another variable.
Example, on a new site:
a) run "drush --yes vset site_offline 1" on the command line
b) you get the following choices:
0) Cancel
1) site_offline (new variable)
2) site_offline_message
c) in this case --yes has no effect. The user still gets prompted. This is bad when drush runs within a script because it causes the script to halt.
Attached is a patch for this edge case which creates a new --force option to be used with vset.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | variable-set-667082.patch | 1.6 KB | greg.1.anderson |
| #1 | force-667082.patch | 3.62 KB | greg.1.anderson |
| force_variable.patch | 2.7 KB | Steve Dondley |
Comments
Comment #1
greg.1.anderson commentedBeautiful. Works just the way I would want it to.
I did make a couple of minor adjustments. I removed '-f' as a synonym for '--force'; you must use '--force'. I was worried that introducing a new global '-f' might conflict with existing drush commands. I also made '--force' imply '--yes'.
Seems to be working nicely now, but since this touches a global option, it should have another set of eyes on it before going in.
Comment #2
greg.1.anderson commentedComment #3
moshe weitzman commentedI'd just as soon make this a local option for vset and not a global option. Lets add to global when more needs arise. Also, lets add an example to vset that uses this.
Comment #4
Steve Dondley commentedGreg, can you please handle Moshe's suggestion to make it a local option for vset? I'm not very familiar with the module. Thanks.
Comment #5
greg.1.anderson commentedYes, I'll take this; no problem.
Comment #6
greg.1.anderson commentedHere you go. I used '--always-set' instead of '--force' so that a user could set this in their drushrc file if they wanted to stipulate this should be the default behavior.
Comment #7
greg.1.anderson commentedComment #8
greg.1.anderson commentedI need this at work; is it okay to commit it?
Comment #9
moshe weitzman commentedsure, go ahead.
Comment #10
greg.1.anderson commentedCommitted; thanks.