Bug 1266680

Summary: UX: when --help on plugin is executed the options of plugin and DNF itself should be separated
Product: [Fedora] Fedora Reporter: Bastien Nocera <bnocera>
Component: dnf-plugins-coreAssignee: Michael Mráka <mmraka>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 26CC: jmracek, jskarvad, mluscon, packaging-team-maint, pnemade, RadekHolyPublic, tim.lauridsen, vmukhame
Target Milestone: ---Keywords: Triaged, UserExperience
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-08 13:49:26 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 Bastien Nocera 2015-09-26 13:12:28 UTC
I don't know how to use "dnf copr". How to enable it is linked from the COPR web pages. Not how to disable it.

Typing "dnf copr --help" gives out the dnf general help, nothing copr related. Typing "dnf copr garbage" actually gives out the help. There also seems to be nothing to list the locally enabled copr repos, so I could disable them.

Comment 1 Parag Nemade 2015-09-26 13:28:18 UTC
For dnf, help is used as
dnf help <cmd> 

so use "dnf help copr", you can even get help as
man dnf.plugin.copr

also see bug 1158548

Comment 2 Michal Luscon 2015-10-13 13:01:33 UTC
This could be fixed after merging of jsilhan's PR (https://github.com/rpm-software-management/dnf/pull/348/commits). The pull request also contains some plugin migration examples.

Comment 3 Michal Luscon 2016-07-18 11:20:48 UTC
*** Bug 1356920 has been marked as a duplicate of this bug. ***

Comment 4 Igor Gnatenko 2016-07-22 09:30:41 UTC
Michael, on nightly of DNF 2.0 it's still reproducible, partially.

It doesn't return real help of COPR plugin, but it returns options from main dnf cmd. Could you take a look?

Comment 5 Fedora End Of Life 2016-11-24 12:36:59 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Michael Mráka 2016-11-30 09:13:50 UTC
We can use option grouping in argparse to separate main vs. plugin options.

Comment 7 Fedora End Of Life 2017-02-28 09:49:30 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 8 Jaroslav Mracek 2017-06-08 13:49:26 UTC
I tried it with dnf-2.5.0 and I got separation of command option with general option. First there is usage of command, then summary of command, then command/plugin options (optional arguments:), then general option (Optional arguments:). In the usage you can see that you can use key words {help,enable,disable,remove,list,search}. Additional information can be also found in documentation. I think that it is exactly what you requested, therefore I am closing it. But if you think that the output should be different, please don't hesitate to reopen the bug report with additional information.

sudo dnf copr --help
usage: dnf copr [-c [config file]] [-q] [-v] [--version]
                [--installroot [path]] [--nodocs] [--noplugins]
                [--enableplugin [plugin]] [--disableplugin [plugin]]
                [--releasever RELEASEVER] [--setopt SETOPTS] [--skip-broken]
                [-h] [--allowerasing] [-b] [-C] [-R [minutes]]
                [-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}]
                {help,enable,disable,remove,list,search} [arg [arg ...]]

Interact with Copr repositories.

optional arguments:
  --disablerepo [repo]
  --repo [repo], --repoid [repo]
                        enable just specific repositories by an id or a glob,
                        can be specified multiple times

Optional arguments:
  -c [config file], --config [config file]
                        config file location
  -q, --quiet           quiet operation
  -v, --verbose         verbose operation
  --version             show DNF version and exit
  --installroot [path]  set install root
  --nodocs              do not install documentations
  --noplugins           disable all plugins
  --enableplugin [plugin]
                        enable plugins by name
  --disableplugin [plugin]
                        disable plugins by name
  --releasever RELEASEVER
                        override the value of $releasever in config and repo
                        files
  --setopt SETOPTS      set arbitrary config and repo options
  --skip-broken         resolve depsolve problems by skipping packages
  -h, --help, --help-cmd
                        show command help
  --allowerasing        allow erasing of installed packages to resolve
                        dependencies
  -b, --best            try the best available package versions in
                        transactions.
  -C, --cacheonly       run entirely from system cache, don't update cache
  -R [minutes], --randomwait [minutes]
                        maximum command wait time
  -d [debug level], --debuglevel [debug level]
                        debugging output level
  --debugsolver         dumps detailed solving results into files
  --showduplicates      show duplicates, in repos, in list/search commands
  -e ERRORLEVEL, --errorlevel ERRORLEVEL
                        error output level
  --obsoletes           enables dnf's obsoletes processing logic for upgrade
                        or display capabilities that the package obsoletes for
                        info, list and repoquery
  --rpmverbosity [debug level name]
                        debugging output level for rpm
  -y, --assumeyes       automatically answer yes for all questions
  --assumeno            automatically answer no for all questions
  --enablerepo [repo]
  -x [package], --exclude [package], --excludepkgs [package]
                        exclude packages by name or glob
  --disableexcludes [repo], --disableexcludepkgs [repo]
                        disable excludepkgs
  --repofrompath [repo,path]
                        label and path to additional repository, can be
                        specified multiple times.
  --nogpgcheck          disable gpg signature checking
  --color COLOR         control whether color is used
  --refresh             set metadata as expired before running the command
  -4                    resolve to IPv4 addresses only
  -6                    resolve to IPv6 addresses only
  --downloadonly        only download packages
  --bugfix              Include bugfix relevant packages, in updates
  --enhancement         Include enhancement relevant packages, in updates
  --newpackage          Include newpackage relevant packages, in updates
  --security            Include security relevant packages, in updates
  --advisory ADVISORY, --advisories ADVISORY
                        Include packages needed to fix the given advisory, in
                        updates
  --bzs BUGZILLA        Include packages needed to fix the given BZ, in
                        updates
  --cves CVES           Include packages needed to fix the given CVE, in
                        updates
  --sec-severity {Critical,Important,Moderate,Low}, --secseverity {Critical,Important,Moderate,Low}
                        Include security relevant packages matching the
                        severity, in updates