Bug 1428015

Summary: dnf repoquery --duplicates --latest-limit -1 errors with "expected one argument"
Product: [Fedora] Fedora Reporter: Vedran Miletić <vedran>
Component: dnfAssignee: rpm-software-management
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 26CC: jmracek, packaging-team-maint, rpm-software-management, vedran, vmukhame
Target Milestone: ---Keywords: Regression, 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: 2017-05-04 10:06:47 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 Vedran Miletić 2017-03-01 17:27:58 UTC
$ dnf --version
2.1.0
  Installed: dnf-0:2.1.0-1.fc26.noarch at 2017-02-22 00:45
  Built    : Fedora Project at 2017-02-16 08:41

  Installed: rpm-0:4.13.0.1-3.fc26.x86_64 at 2017-02-27 12:43
  Built    : Fedora Project at 2017-02-24 13:10

$ sudo dnf repoquery --duplicates --latest-limit -1
usage: dnf repoquery [-c [config file]] [-q] [-v] [--version]
                     [--installroot [path]] [--noplugins]
                     [--disableplugin [plugin]] [--releasever RELEASEVER]
                     [--setopt SETOPTS] [--skip-broken] [-h] [--allowerasing]
                     [-b] [-C] [-d [debug level]] [--debugsolver]
                     [--showduplicates] [-e ERRORLEVEL] [--obsoletes]
                     [--rpmverbosity [debug level name]] [-y] [--assumeno]
                     [--enablerepo [repo]] [--disablerepo [repo] | --repo
                     [repo]] [-x [package]] [--disableexcludes [repo]]
                     [--repofrompath [repo,path]] [--nogpgcheck]
                     [--color COLOR] [--refresh] [-4] [-6] [--downloadonly]
                     [--bugfix] [--enhancement] [--newpackage] [--security]
                     [--advisory ADVISORY] [--bzs BUGZILLA] [--cves CVES]
                     [--sec-severity {Critical,Important,Moderate,Low}]
                     [--arch ARCH] [-f FILE [FILE ...]] [--whatprovides REQ]
                     [--whatrequires REQ] [--whatrecommends REQ]
                     [--whatenhances REQ] [--whatsuggests REQ]
                     [--whatsupplements REQ] [--alldeps | --exactdeps]
                     [--deplist] [--querytags] [--resolve] [--tree] [--srpm]
                     [--latest-limit LATEST_LIMIT]
                     [-i | -l | -s | --qf QUERYFORMAT]
                     [--duplicates | --installonly | --unsatisfied]
                     [--conflicts | --enhances | --provides | --recommends | --requires | --requires-pre | --suggests | --supplements]
                     [--available]
                     [--installed | --extras | --upgrades | --unneeded]
                     [--recent]
                     [key [key ...]]
Command line error: argument --latest-limit: expected one argument

This worked in Fedora 25.

Comment 1 Igor Gnatenko 2017-03-01 17:29:31 UTC
what if you remove `-1` and replace it with `1`?

We had to break some things in DNF 2.0...

Comment 2 Vedran Miletić 2017-03-02 13:41:08 UTC
(In reply to Igor Gnatenko from comment #1)
> what if you remove `-1` and replace it with `1`?
> 
> We had to break some things in DNF 2.0...

1 works as expected, but that's the opposite of what I need.

Comment 3 Vedran Miletić 2017-03-07 10:10:12 UTC
Igor, any update on this? I care about this feature enough that I might look into the issue myself, just let me know if this would help.

Comment 4 Vedran Miletić 2017-03-13 18:48:00 UTC
The problem  is that -1 is treated as a separate parameter, not as a value for --latest-limit. I looked into dnf/cli/option_parser.py for a few minutes and there is -4 and -6 which have a meaning, but it's not immediately obvious how -1 is handled.

Comment 5 Jaroslav Mracek 2017-05-04 10:06:47 UTC

*** This bug has been marked as a duplicate of bug 1446641 ***