Title says it all. Sometimes the list of choices can be long, and although you can send along defaults, having to (de)select them one by one is kinda hard. We found that out the hard way while working on selecting exportables through ctools' new drush export commands.
If we could get an extra (optional?) select/deselect all option, that could potentially speed up things.

[0] : cancel
[1] : deselect all
[2] : ...
...
[10] : done

I'll be posting a patch soon for this.

Comments

swentel’s picture

Status: Active » Needs review
StatusFileSize
new2.24 KB

Here's a patch. Tested it with the patch at http://drupal.org/node/1498986 (could be applied to ctools dev as well instead of that sandbox).

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. I'll wait a bit for more feedback.

Can anyone think if a way to test this function?

damiankloip’s picture

Looks good to me too, but that's a biased opinion :)

swentel’s picture

To anyone who'd like to test this patch but doesn't want to write their own drush functions:

  1. Get the latest ctools from git
  2. Grab the patch at http://drupal.org/node/1498986#comment-5786882 and apply it to the ctools repository
  3. Apply this patch to your Drush checkout
  4. Than run 'drush ctools-export' in a Drupal installation which has exportables (views should be fine) and select the 'Make selection' option that is presented.
  5. Select the views and there you should be able to (de)select all views
moshe weitzman’s picture

Status: Reviewed & tested by the community » Needs work

We need a test or an implementation in drush core. At first look it seems like drush_field_delete() could use the 'select all' feature instead of --all

drzraf’s picture

StatusFileSize
new991 bytes

Here's another implementation.
It simply allows "*" and "-*" value in order to select All / None option.

greg.1.anderson’s picture

I like "*", but not "-*". It would be better if "*" selected all options, unless everything is already selected, in which case everything should be deselected.

drzraf’s picture

Version: » All-versions-4.x-dev

-* is only an (unusual) shorthand
either case is ok for me, feel free to commit as you prefer.

greg.1.anderson’s picture

Version: All-versions-4.x-dev » 8.x-6.x-dev
Status: Needs work » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.