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
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to