rpm-software-management / dnf

Package manager based on libdnf and libsolv. Replaces YUM.
GNU General Public License v2.0
1.23k stars 410 forks source link

dnf help: simplify usage message line #1870

Open esdnm opened 1 year ago

esdnm commented 1 year ago

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> https://github.com/rpm-software-management/dnf/issues/1869) will make reading command specific usage meesage and help message much better (tidy) experience.

esdnm commented 1 year ago

hey @rpm-software-management!

kontura commented 1 year ago

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.