From c1aedfef08e65bea25b2b5007e4aaaa9f4d4bc95 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Wed, 20 May 2020 21:40:41 +0300 Subject: [PATCH] Enhance --querytags and --qf help output Bring commands next to each other and make --querytags output machine readable. --- dnf/cli/commands/repoquery.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dnf/cli/commands/repoquery.py b/dnf/cli/commands/repoquery.py index 50c8126f6a..099a9312d9 100644 --- a/dnf/cli/commands/repoquery.py +++ b/dnf/cli/commands/repoquery.py @@ -43,13 +43,12 @@ # matches %[-][dd]{attr} QFORMAT_MATCH = re.compile(r'%(-?\d*?){([:.\w]+?)}') -QUERY_TAGS = """ +QUERY_TAGS = """\ name, arch, epoch, version, release, reponame (repoid), evr, debug_name, source_name, source_debug_name, installtime, buildtime, size, downloadsize, installsize, provides, requires, obsoletes, conflicts, sourcerpm, -description, summary, license, url, reason -""" +description, summary, license, url, reason""" OPTS_MAPPING = { 'conflicts': 'conflicts', @@ -165,9 +164,6 @@ def set_argparser(parser): 'used with --whatrequires, and --requires --resolve, query packages recursively.')) parser.add_argument('--deplist', action='store_true', help=_( "show a list of all dependencies and what packages provide them")) - parser.add_argument('--querytags', action='store_true', - help=_('show available tags to use with ' - '--queryformat')) parser.add_argument('--resolve', action='store_true', help=_('resolve capabilities to originating package(s)')) parser.add_argument("--tree", action="store_true", @@ -195,7 +191,12 @@ def set_argparser(parser): help=_('show changelogs of the package')) outform.add_argument('--qf', "--queryformat", dest='queryformat', default=QFORMAT_DEFAULT, - help=_('format for displaying found packages')) + help=_('display format for listing packages: ' + '"%%{name} %%{version} ...", ' + 'use --querytags to view full tag list')) + parser.add_argument('--querytags', action='store_true', + help=_('show available tags to use with ' + '--queryformat')) outform.add_argument("--nevra", dest='queryformat', const=QFORMAT_DEFAULT, action='store_const', help=_('use name-epoch:version-release.architecture format for ' @@ -433,7 +434,6 @@ def _add_add_remote_packages(self): def run(self): if self.opts.querytags: - print(_('Available query-tags: use --queryformat ".. %{tag} .."')) print(QUERY_TAGS) return