Bug 2172881

Summary: RFE: please stop printing usage information when an invalid option is given
Product: [Fedora] Fedora Reporter: Zbigniew JÄ™drzejewski-Szmek <zbyszek>
Component: dnf5Assignee: rpm-software-management
Status: CLOSED RAWHIDE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jkolarik, nsella, pkratoch, rpm-software-management
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-06-29 13:43:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Zbigniew Jędrzejewski-Szmek 2023-02-23 11:53:24 UTC
Description of problem:
I'm filing this an "RFE", because it's a matter of opinion, but I'm pretty sure that changing the behaviour would be beneficial to users.

Right now dnf5 prints full --help output when it encounters an invalid option. This means that the actual useful part that the user needs to look at (the error message) is obscured by a few pages of output about all possible options. This is only going to get worse as the more functionality is implemented and the length of --help output grows. (In particular, this was clearly visible in the excellent talk about dnf5 at FOSDEM: during the demo one of the presenters made a typo and had to scroll up quite a bit to figure out what went wrong.)  Please just stop doing this. The user knows they can use --help or man or google if they want to learn about all available options.

(There's also the additional issue that the --help output is written to stdout, which is wrong, see rhbz#2172868.)

Version-Release number of selected component (if applicable):
dnf5-5.0.6-1.fc39.x86_64

Actual results:
~40 lines of output after a typo

Expected results:
Just the error message.

Comment 1 Pavla Kratochvilova 2023-06-29 13:43:33 UTC
I believe this is fixed by https://github.com/rpm-software-management/dnf5/commit/93bf7fa260ac95f075fa9de9a26507627a7d02bc which should already be in rawhide, so I'm closing this.