Closed (fixed)
Project:
Drush
Component:
Base system (internal API)
Priority:
Minor
Category:
Feature request
Assigned:
Reporter:
Created:
25 Dec 2010 at 06:01 UTC
Updated:
8 Jan 2011 at 21:00 UTC
Jump to comment: Most recent file
This patch adds support for --yes, --no, --pipe and --backend to drush_choice and drush_print_file. Not too common, but important for consistency.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | drush-noninteractive-2.patch | 3.86 KB | greg.1.anderson |
| drush-noninteractive.patch | 2.24 KB | greg.1.anderson |
Comments
Comment #1
greg.1.anderson commentedComment #2
moshe weitzman commentedFound a missing word or typo " but in backend and modes we will return the first option. "
i had not thought of using topic via --backend but thats perfectly reasonable. I wonder if drush_choice should return the list of choices instead of picking the first choice. That might be more handy when you don't know the list of topics that are available.
Comment #3
greg.1.anderson commentedI started this so that topics could be viewed with --pipe to subvert the 'less' behavior, and put in --backend for consistency. Having drush_choice print the options in --backend mode is a good idea, particularly if coupled with a global --choice option to be able to select an item on the second pass.
Comment #4
greg.1.anderson commentedNow it works as it should. --choice can be either numeric, or one of the symbolic identifiers from $options. --backend just prints the list of selections and exist; --pipe prints only the array keys (symbolic identifiers) from $options.
Comment #5
moshe weitzman commentedTypo persists: "// but in backend and modes we will return the first option."
I think --choice belongs in the new !$brief branch of global_options()
Otherwise, looks good.
Comment #6
greg.1.anderson commentedCommitted.