I find myself constantly updating and reverting many features at once in specific packages. It can be frustrating specifying all of the feature names on the command line when calling drush up feature1 feature2 [feature3] over and over and over again. I've addressed this in the included patch. This is my first contribution to any Drupal project, so if something is amiss, definitely point it out and I'll address it (or someone else can, woot for open source).

Added the following commands:

  • features-list-packages (flp)
    • Lists all feature packages. Specify --reg to see the human-readable names.
  • features-update-packages (fup)
    • Updates all features in specific packages. Use a space-separated list of feature machine names.
  • features-revert-packages (frp)
    • Reverts all listed feature packages. Use a space-separated list of feature machine names.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lpeabody’s picture

FileSize
5.16 KB

Reattached patch with proper name.

lpeabody’s picture

Status: Active » Needs review

Updating to needs review. Been using for over a week now without issue.

hefox’s picture

Issue summary: View changes
Status: Needs review » Needs work

This is a good idea, but instead of new commands perhaps instead argument to fua/fra/etc?

undertext’s picture

Status: Needs work » Needs review
FileSize
5.05 KB

I have added '--packages' option to fl/fua/fra drush commands.

lpeabody’s picture

Thanks undertext for enhancing this. I haven't had the opportunity to work on this for a while now. Gotta love the community.

lpeabody’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
155.37 KB

Looks good, one point though...

When running drush fua --features=Features, should this list should be equivalent to the list when having run drush fra --pacakages=Features? Ultimately it will just abort for each feature that doesn't need to be updated, but it would be cleaner if features that did not need to be updated were just skipped in this list. Honestly, I don't even remember if this is how it worked for me originally, it's just an afterthought.

Ultimately, this patch is sound and works as advertised. Thanks undertext.

m1r1k’s picture

Issue tags: +#ams2014contest
hefox’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -

I'm fairly certain packages can have spaces in them, so space delimited won't really work tmk.

lpeabody’s picture

Space delimited isn't accurate, I think @undertext misspoke. He collects the options via drush_get_option_list, which collects options that are comma separated, not space separated, so the help text needs to be updated. So it's sort of a non-issue/documentation issue I believe.

In addition, I don't think the feature revert process is correctly invoked on each features in the package, as I get the following error when attempting to revert all.

Unknown option: --packages. See `drush help features-revert` for available options. To suppress this error, add the option --strict=0.

My original code didn't have this problem. I'll look at adjusting the revert command invocation and re-roll.