use case :
drush dl views
Project views contains 3 modules: views_export, views_ui, views.
paste and copy :
drush en views_export, views_ui, views
results in errors ... views_ui, was not found and will not be enabled.
i love the way the modules are shown, but it would help a lot to be able to copy the list directly, wouldnt it ?
thanks :)
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | drush-clean-up-commas-3.patch | 4.82 KB | greg.1.anderson |
| #3 | drush-clean-up-commas-2.patch | 2.77 KB | greg.1.anderson |
| #1 | drush-973102.patch | 1.89 KB | jonhattan |
Comments
Comment #1
jonhattanI had a proposal for the opposite: allow commas in drush pm-enable, etc.
Note: it allow commas in addition to spaces.
Comment #2
greg.1.anderson commented#1 is good, but perhaps it should be something along the lines of this (untested):
Might need to remove empty items from the result. The basic idea is that your $args might be a single item with commas in it, such as "a,b,c", or it might be three different items with commas at the end, such as "a," "b," "c,", so we first merge the array together by ','. The first case is unchanged, but the second case gives you "a,,b,,c,". When we explode the result, we get a list with "a", "b" and "c" in it; in the second case we also have some empty elements. Remove those, and the list should be clean.
Comment #3
greg.1.anderson commentedHere is a patch with my suggestion from #2. I broke the utility function out into drush.inc, as it might be useful in other circumstances.
Comment #4
jonhattanAwesome. While reviewing to update some help strings I hit
_drush_pm_expand_projects()perhaps we can hook_convert_csv_to_array()there.Comment #5
greg.1.anderson commented_drush_pm_expand_projects() is not an appropriate place to call _convert_csv_to_array because the args to _drush_pm_expand_projects have already been passed through _convert_csv_to_array.
Here's a patch with more consistent use of _convert_csv_to_array throughout the pm_* commands. I also considered other places in drush where it might be used, but rejected them all. The "field" commands expect some of its args to have commas, so it would break things to expand there. Variable set takes a key and a value, so it's not a good candidate. Variable get -could- use it, but I did not for consistency with variable set. Core status isn't good, because its args can contain spaces, and that seemed too confusing. Help could use _convert_csv_to_array, but I skipped this one because it is not used anywhere else in core.
Comment #6
jonhattanOk. Commited #5 along with some changes to help strings.
http://drupal.org/cvs?commit=453950
Comment #7
greg.1.anderson commentedLooks like you only committed your help text changes, so I committed #5.
http://drupal.org/cvs?commit=453984
Comment #8
jonhattanWhoops. I did work on other directory. Definitely need git for local branches !
Comment #9
mojzis commentedthanks :) it works nice now