Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnf help: simplify usage message line #1870

Open
esdnm opened this issue Dec 15, 2022 · 2 comments
Open

dnf help: simplify usage message line #1870

esdnm opened this issue Dec 15, 2022 · 2 comments

Comments

@esdnm
Copy link

esdnm commented Dec 15, 2022

Currently the usage message line of dnf help <command is a long string, e.g. for remove it is (line number added)

 1 usage: dnf remove [-c [config file]] [-q] [-v] [--version] [--installroot [path]]
 2                   [--nodocs] [--noplugins] [--enableplugin [plugin]]
 3                   [--disableplugin [plugin]] [--releasever RELEASEVER] [--setopt SETOPTS]
 4                   [--skip-broken] [-h] [--allowerasing] [-b | --nobest] [-C]
 5                   [-R [minutes]] [-d [debug level]] [--debugsolver] [--showduplicates]
 6                   [-e ERRORLEVEL] [--obsoletes] [--rpmverbosity [debug level name]] [-y]
 7                   [--assumeno] [--enablerepo [repo]] [--disablerepo [repo] | --repo
 8                   [repo]] [--enable | --disable] [-x [package]] [--disableexcludes [repo]]
 9                   [--repofrompath [repo,path]] [--noautoremove] [--nogpgcheck]
10                   [--color COLOR] [--refresh] [-4] [-6] [--destdir DESTDIR]
11                   [--downloadonly] [--comment COMMENT] [--bugfix] [--enhancement]
12                   [--newpackage] [--security] [--advisory ADVISORY] [--bz BUGZILLA]
13                   [--cve CVES] [--sec-severity {Critical,Important,Moderate,Low}]
14                   [--forcearch ARCH] [--duplicates | --oldinstallonly]
15                   [PACKAGE ...]

Here only the options in line 14 (and 15) are specific to this command, all the previous ones are General DNF options.

I propose that this usage message should be simplified by replacing those general option listing with [<general-option> ...]. e.g.

 1  usage: dnf remove [<general-option> ...] [--forcearch ARCH] [--duplicates | --oldinstallonly]
 2                    [PACKAGE ...]

I hope this (along with removing help message for general options on dnf help <command> #1869) will make reading command specific usage meesage and help message much better (tidy) experience.

@esdnm
Copy link
Author

esdnm commented Mar 29, 2023

hey @rpm-software-management!

@kontura
Copy link
Contributor

kontura commented Apr 3, 2023

Thanks for the suggestion, we are trying to improve this in dnf5 by showing just the option specific to the command.
For example:

$ dnf5 remove --help
Usage:
  dnf5 remove [GLOBAL OPTIONS] [OPTIONS] [ARGUMENTS]

Arguments:
  keys_to_match                 List of keys to match

$ dnf5 upgrade --help
Usage:
  dnf5 upgrade [GLOBAL OPTIONS] [OPTIONS] [ARGUMENTS]

Options:
  --minimal                                    Upgrade packages only to the lowest versions of packages that fix the problems affecting the system.
  --allowerasing                               Allow erasing of installed packages to resolve problems
  --skip-unavailable                           Allow skipping unavailable packages
  --advisories=ADVISORY_NAME,...               Consider only content contained in advisories with specified name. List option.
  --security                                   Consider only content contained in security advisories.
  --bugfix                                     Consider only content contained in bugfix advisories.
  --enhancement                                Consider only content contained in enhancement advisories.
  --newpackage                                 Consider only content contained in newpackage advisories.
  --advisory-severities=ADVISORY_SEVERITY,...  Consider only content contained in advisories with specified severity. List option. Can be "critical", "important", "moderate", "low", "none".
  --bzs=BUGZILLA_ID,...                        Consider only content contained in advisories that fix a Bugzilla ID, Eg. 123123. List option.
  --cves=CVE_ID,...                            Consider only content contained in advisories that fix a CVE (Common Vulnerabilities and Exposures) ID, Eg. CVE-2201-0123. List option.
  --advisory=ADVISORY_NAME,...                 Alias for '--advisories'
  --bz=BUGZILLA_ID,...                         Alias for '--bzs'
  --cve=CVE_ID,...                             Alias for '--cves'

Arguments:
  specs                                        List of package specs to upgrade

We are unlikely to improve the situation for this current dnf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants