Currently drush features-list outputs a very verbose table that is intended for human consumption. This output is rather cumbersome to use in scripts. It would be very helpful if it would support the global --pipe option, so we can do cool stuff:

# Send an e-mail informing the admin about overridden features.
drush fl --pipe --status=enabled | xargs drush fd | mail admin@example.com

Comments

pfrenssen’s picture

Status: Active » Needs review
StatusFileSize
new1.83 KB
pfrenssen’s picture

Checking my patches that are more than a year old to see if they need to be rerolled. This one still applies :)

cdmo’s picture

Status: Needs review » Reviewed & tested by the community

I just applied this patch and it did apply cleanly. I used it on Features 7.x-2.7.

I love the example you provided, and I'd really like to implement it. I did have to tweak the xargs piece, adding the -L flag, so it looked like this:

drush fl --pipe --status=enabled | xargs -L 1 drush fd | mail admin@example.com

The problem was that xargs doesn't seem to handle the output correctly. I just got "Feature is in its default state. No diff needed. " output when I ran the command.

Thanks, I'm setting to RTBC, for what that's worth.

  • mpotter committed e849185 on 7.x-2.x authored by pfrenssen
    Issue #2340841 by pfrenssen: Add a --pipe option to drush features-list
    
mpotter’s picture

Status: Reviewed & tested by the community » Fixed

Committed to e849185.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Cyclodex’s picture

Just wanted to mention that I was running an old drush version (5.9) and this did not work out.

I think this change makes it require Drush 6.x at least, where I think the output formats were introduced.