Bug 1212693 - dnf does not consistently exit immediately when an invalid option is given
Summary: dnf does not consistently exit immediately when an invalid option is given
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf   
(Show other bugs)
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Fedora Extras Quality Assurance
Keywords: Reopened, Triaged
: 1233845 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2015-04-17 06:31 UTC by James Patterson
Modified: 2016-10-04 19:14 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-07-22 09:33:13 UTC
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Bugzilla 1215208 None None None Never

Internal Trackers: 1215208

Description James Patterson 2015-04-17 06:31:38 UTC
Description of problem:
dnf should exit immediately if an option is given that does not exist.

This does the right thing:
# dnf -a
as does this:
# dnf -a upgrade

This does not work:
# dnf upgrade -a
Using metadata from Wed Apr 15 14:35:15 2015
No match for argument: -a
Error: No packages marked for upgrade.
nor does this:
# dnf list -z

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:

Actual results:

Expected results:

Additional info:

Comment 1 Radek Holy 2015-04-17 10:10:14 UTC
Hello, thank you for the report.

Actually, this is something that you should expect because according to the man pages, the synopsis is "dnf [options] <command> [<args>...]". So, anything passed after a "<command>" should be handled as an argument of the command.

So, if we are going to officially support putting global options after the "<command>", we should document it as well.

Comment 2 James Patterson 2015-04-17 10:18:24 UTC
Yes I understand that, but if an invalid option is passed, you want dnf to exit.

Comment 3 Radek Holy 2015-06-22 07:22:30 UTC
*** Bug 1233845 has been marked as a duplicate of this bug. ***

Comment 4 Davide Repetto 2015-06-22 08:11:51 UTC
(In reply to James Patterson from comment #2)
> Yes I understand that, but if an invalid option is passed, you want dnf to
> exit.

Which is basically what every other Linux program does. Including yum BTW.

Comment 5 Honza Silhan 2015-07-22 09:14:08 UTC
Will be fixed along with argparsing DNF refactoring.

Comment 6 Davide Repetto 2015-10-09 14:28:53 UTC
Any idea of the time frame?

Comment 7 Michael Mráka 2016-05-26 07:22:39 UTC
Fixed as a part of DNF 2.0 argument parser rewrite

Comment 8 Fedora End Of Life 2016-07-19 13:45:25 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 9 Igor Gnatenko 2016-07-22 09:33:13 UTC
as Michael said.

Note You need to log in before you can comment on or make changes to this bug.