Bug #16225
openAllowed combinations of expanded options aren't obvious
Description
When hammer automatically expands options for an action (typically index action) it doesn't mark what combinations of options are allowed. This is very confusing in combination with the fact that additional parameters are just ignored silently.
An example is listing errata (in hammer-cli-katello), where api allows either to list all errata or scope by repository. Hammer expands the repository scope to multiple options including --organization and --product. It evokes false idea that the command should be able to filter also by organization or product.
Usage: hammer erratum list [OPTIONS] Options: --by BY Field to sort the results on --content-view CONTENT_VIEW_NAME Content view name to search by --content-view-filter CONTENT_VIEW_FILTER_NAME Name to search by --content-view-filter-id CONTENT_VIEW_FILTER_ID filter identifier --content-view-id CONTENT_VIEW_ID content view numeric identifier --content-view-version CONTENT_VIEW_VERSION_VERSION Content view version number --content-view-version-id CONTENT_VIEW_VERSION_ID Content view version identifier --cve CVE CVE identifier --environment ENVIRONMENT_NAME Name to search by --environment-id ENVIRONMENT_ID --errata-restrict-applicable ERRATA_RESTRICT_APPLICABLE show only errata with one or more applicable hosts One of true/false, yes/no, 1/0. --errata-restrict-installable ERRATA_RESTRICT_INSTALLABLE show only errata with one or more installable hosts One of true/false, yes/no, 1/0. --full-results FULL_RESULTS Whether or not to show all results One of true/false, yes/no, 1/0. --order ORDER Sort field and order, eg. 'name DESC' --organization ORGANIZATION_NAME Organization name to search by --organization-id ORGANIZATION_ID organization ID --organization-label ORGANIZATION_LABEL Organization label to search by --page PAGE Page number, starting at 1 --per-page PER_PAGE Number of results per page to return --product PRODUCT_NAME Product name to search by --product-id PRODUCT_ID product numeric identifier --repository REPOSITORY_NAME Repository name to search by --repository-id REPOSITORY_ID repository ID --search SEARCH Search string -h, --help print help
This issue is spread in commands across all hammer commands with option expansion. The key is to give users more information about what combinations are allowed. It can be also in form of feedback from error message.
Even though the simplest solution might be to deal with the issue on per-command basis in option validation, it's worth investigating if there is a good enough generic solution. If we decide to go the per-command way this issue should become a tracker.