Yes, that's right, there is a default action. There are also real
options: --upgrade does something in addition to the default or
sub-commands, likewise --http. It is only --pristine, --patch-index, and
--disable-patch-index, that are mutually exclusive, as well as
--compress and --uncompress. Furthermore, the first three sub-commands
do respect --upgrade and --http, but do *not* respect --reorder,
--compress, --uncompress, or --relink. I have no idea why this is so.
The current behavior can be mapped to a command tree like this:
optimize:
options: --upgrade, --http, --reorder, --relink
subcommands:
pristine,
patch-index,
no-patch-index:
options: --upgrade, --http
compress,
uncompress:
options: --upgrade, --http, --reorder, --relink
This strikes me as much more complicated than necessary. A much simpler
solution would be to allow mixing everything as much as possible.
Particularly, each option will do something in addition to the default
and the other options. There would be only two mutually exclusive cases:
--patch-index vs. --no-patch-index, and --compress vs. --uncompress.
Both are easily recognized as opposite option pairs.
This will make both the UI and the implementation much clearer. I think
I'll send a patch for the details rather than paste the code here.
|