[Rpm-maint] [rpm-software-management/rpm] command line help: option -q is not mentioned (#1473)
Michal Domonkos
notifications at github.com
Wed Feb 24 16:09:14 UTC 2021
This is a bit more complicated than one would think. The `--query` option is deliberately hidden from the usage/help output because there simply isn't a good help section to house it:
```
$ rpm --help
[...]
Query/Verify package selection options:
Query/Verify file selection options:
Query options (with -q or --query):
Verify options (with -V or --verify):
Install/Upgrade/Erase options:
Common options for all rpm modes and executables:
Options implemented via popt alias/exec:
Help options:
```
Intuitively, it should probably go under "Query options", however, `--query` acts as a _mode selector_ and all the other options in that section are only relevant in that specific mode. So putting it amongst them wouldn't capture this "hierarchy" relationship well.
Now, one could argue that `--install`, `--erase` etc. are also listed together with their options (under "Install/Upgrade/Erase options"), so we would at least make things more consistent - but IMO, this wouldn't really be an improvement, as it would make the "Query options" section even more confusing, not less.
Another way to solve this, perhaps more consistently, would be to break out `--install`, `--erase`, `--query` (and all the other mode selectors) into a separate help section called something like "Mode options". The problem with that is, we would have to reorganize the popt option tables, the associated `lib/popt*.c` files and the popt callback functions quite a bit. Since this is a critical piece of code (where all the option parsing takes place), I'd rather avoid doing such changes for such little gains.
If we ever want to make the help page better (which I'm all for), I think we should start by reorganizing the option tables and parsing routines first. From that, a good help format would naturally "emerge".
BTW, the above also applies to the `--verify` option which is also hidden.
With that said, I'm closing this issue. If you have an idea how to solve this in a less intrusive way, please reopen or file a new one.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1473#issuecomment-785186122
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20210224/1fbb080c/attachment.html>
More information about the Rpm-maint
mailing list