From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 623831382C5 for ; Tue, 1 May 2018 12:33:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 80707E098A; Tue, 1 May 2018 12:32:59 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5A539E098A for ; Tue, 1 May 2018 12:32:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 171AF335C74 for ; Tue, 1 May 2018 12:32:58 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id EEFE7281 for ; Tue, 1 May 2018 12:32:55 +0000 (UTC) From: "Mike Pagano" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Pagano" Message-ID: <1525177813.bb585671418fa51682a7e1dbfef5914e26261adf.mpagano@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/equery/meta.py X-VCS-Directories: pym/gentoolkit/equery/ X-VCS-Committer: mpagano X-VCS-Committer-Name: Mike Pagano X-VCS-Revision: bb585671418fa51682a7e1dbfef5914e26261adf X-VCS-Branch: master Date: Tue, 1 May 2018 12:32:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: e0d47f48-edd8-4245-aa6f-7550278e0cd7 X-Archives-Hash: 7a3f68df8b796704b2cfe819fe32b40e commit: bb585671418fa51682a7e1dbfef5914e26261adf Author: Mike Pagano gentoo org> AuthorDate: Tue May 1 12:30:13 2018 +0000 Commit: Mike Pagano gentoo org> CommitDate: Tue May 1 12:30:13 2018 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=bb585671 epkginfo: Add 'reverse' display option for equery This adds a small convenience for displaying the ebuilds in reverse order. This helps people prune packages that grow quickly as the most relevant ones are at the top. pym/gentoolkit/equery/meta.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pym/gentoolkit/equery/meta.py b/pym/gentoolkit/equery/meta.py index ea1c96a..e9f5cea 100644 --- a/pym/gentoolkit/equery/meta.py +++ b/pym/gentoolkit/equery/meta.py @@ -89,6 +89,7 @@ def print_help(with_description=True, with_usage=True): (" -k, --keywords", "show keywords for all matching package versions"), (" -l, --license", "show licenses for the best maching version"), (" -m, --maintainer", "show the maintainer(s) for the package"), + (" -r, --reverse", "show the output in reverse order if applicable"), (" -S, --stablreq", "show STABLEREQ arches (cc's) for all matching package versions"), (" -u, --useflags", "show per-package USE flag descriptions"), (" -U, --upstream", "show package's upstream information"), @@ -525,9 +526,9 @@ def parse_module_options(module_opts): def main(input_args): """Parse input and run the program.""" - short_opts = "hdHklmSuUx" + short_opts = "hdHklmrSuUx" long_opts = ('help', 'description', 'herd', 'keywords', 'license', - 'maintainer', 'stablereq', 'useflags', 'upstream', 'xml') + 'maintainer', 'reverse', 'stablereq', 'useflags', 'upstream', 'xml') try: module_opts, queries = gnu_getopt(input_args, short_opts, long_opts) @@ -561,6 +562,8 @@ def main(input_args): print() matches.sort() + matches.sort(reverse=any(name in ('-r', '--reverse') + for name, opt in module_opts)) call_format_functions(best_match, matches) first_run = False