We add an extra newline at the end of pipe'd output, which seems fine, but then we pass it to drush_print_r which adds another newline.
#1659668: variable-get outputs in single line when using --pipe introduced a test failure because we do an assertEmpty on a --pipe'd output that should be empty, but it fails because it's \n instead of empty.
This also creates what I consider a bug when you do something like:
drush pml --status=enabled --pipe|wc -l
That'll tell you you have one more module enabled than your actually do.
I think the best fix is to give drush_print_r the same newline option as drush_print, and set it to false when we print piped output.
Comment | File | Size | Author |
---|---|---|---|
#3 | drush_pipe_no_extra_newline-3.patch | 964 bytes | msonnabaum |
drush_pipe_no_extra_newline.patch | 761 bytes | msonnabaum |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedLooks reasonable to me.
Comment #2
greg.1.anderson CreditAttribution: greg.1.anderson commentedI don't think that the patch is quite right. I think you meant this instead:
Untested.
Comment #3
msonnabaum CreditAttribution: msonnabaum commentedOops. Uploaded the wrong patch.
Comment #4
greg.1.anderson CreditAttribution: greg.1.anderson commentedLooks good.
Comment #5
msonnabaum CreditAttribution: msonnabaum commentedCommitted.