Closed enolfc closed 3 years ago
We could improve all-site options in several ways (or all):
Add better (simpler, more intuitive) keywords for all-sites operation, e.g. --site all, --site ALL, and better documentation for the keywords. Multiple keywords can be supported at the same time (e.g. all, ALL, ALL_SITES) if needed.
Set default value for --site option as "ALL_SITES" (or "all", "ALL"), so if the user doesn't specify a site, all-sites operation is automatically activated. That may be little risky for operations that may do some changes at a site (e.g. deleting VMs) and user forget to add --site option.
Explicitly add --all-sites option as mentioned above.
The first two ones can be quickly added, the third may need little changes in parameter checking.
I added the magic value "ALL_SITES" to the help text in PR #60
Option 2 is indeed risky, so unless we will have confirmation for commands that change/delete stuff when all sites are targeted (needs work in all modules), I would avoid this. But maybe we can create a new issue/enhancement that proposes this together with the checks on all non-informative commands.
Option 3 is a design/usability nightmare. Two options that control the same setting, you must make them work exclusively, etc. I would avoid this too.
Option 3 does require some extra work for the parameter checking (we are doing that anyway, no?), but it would simplify checks in the long run and possible naming issues (what if a site comes named "ALL"?).
We could use one of the libs based on click
These libs can
I do think EGI has a say in how sites are named and can prevent having new sites being named ALL_SITES. About the rhetorical question of whether we are checking that the site param does not select all sites for commands where this makes no sense, I added some checks to a few commands in the last PR (hopefully to all relevant commands). But we will revise/improve that in the future, I guess.
The --site ALL_SITES is not very intuitive and not properly documented. It's easy to forget after some time without using it, so better be explicit with something like --all-sites option that avoids mispellings or confusions