Closed (duplicate)
Project:
Drush
Component:
PM (dl, en, up ...)
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Dec 2011 at 18:00 UTC
Updated:
8 Dec 2011 at 16:47 UTC
Rather, the list has one entry per line. The list should be space delimited; drush help pm-list shows for --pipe:
"Returns a space delimited list of the names of the resulting extensions."
A space-delimited list is desired for directly inputting the list to other drush commands (e.g. pm-enable).
Comments
Comment #1
threexk commented(I assume "space" isn't interpreted liberally to mean any whitespace.)
Comment #2
greg.1.anderson commentedThe shell will automatically convert whitespace (e.g. line breaks) into spaces as necessary; for example, try
echo $(drush pm-list --pipe)and you will see that the --pipe output is already well-suited for use with pm-enable & c.Outputting the list newline-delimited instead of space-delimited makes it easier to further process the output with grep, etc.
Comment #3
greg.1.anderson commentedOh, and yes, "space" was interpreted liberally to mean any whitespace. I changed the documentation to say "whitespace" instead of "space" for the avoidance of doubt. Committed to master and 7.x-4.x.
Comment #4
raelianer commentedOn Windows it's not converted to space. Can't you just change this?
Comment #5
greg.1.anderson commentedChanging this is out of the question for drush-4.x, as it could break scripts that depend on the output being on separate lines.
We could change this for drush-5.x; I am of mixed minds about this. Using a reasonable shell, such as bash, msysgit (which has bash), cygwin, etc., it is more convenient to convert line-separated output to space-separated output (per #2) than to go the other way around. On the other hand, I don't want to simply say "don't use Powershell / DOS".
I've tagged this issue as "Windows"; perhaps @kulov or @beltofte could chime in on the utility of this change for Windows, or other alternatives.
Is anyone from the Linux/bash camp opposed to making this change?
Comment #6
beltofteIn PowerShell is "echo $(drush pm-list --pipe)" working fine, it's returning the project list separated by newline though. Using write-host instead e.g. "write-host $(drush pm-list --pipe)" returns the list space separated in PowerShell :-) See more details about write-host on http://ss64.com/ps/write-host.html.
write-host is not available in CMD, and "echo $(drush pm-list --pipe)" is not executing the command in CMD, but just outputting "drush pm-list --pipe".
Comment #7
jonhattanWill be addressed in #1364808: Proposal for an output formats engine