public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Pagano" <mpagano@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/
Date: Tue,  1 May 2018 12:32:55 +0000 (UTC)	[thread overview]
Message-ID: <1525177813.bb585671418fa51682a7e1dbfef5914e26261adf.mpagano@gentoo> (raw)

commit:     bb585671418fa51682a7e1dbfef5914e26261adf
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Tue May  1 12:30:13 2018 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> 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


             reply	other threads:[~2018-05-01 12:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01 12:32 Mike Pagano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-07 18:49 [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/ Sam James
2024-03-07 18:49 Sam James
2023-09-19 19:13 Sam James
2023-08-05  5:38 Sam James
2023-07-18 22:30 Sam James
2023-07-18 22:26 Sam James
2022-07-28 15:29 Brian Dolbec
2022-07-28 15:29 Brian Dolbec
2022-07-10 18:41 Brian Dolbec
2022-07-10 18:01 Brian Dolbec
2022-07-10 16:23 Brian Dolbec
2022-07-10 16:23 Brian Dolbec
2022-07-10  1:24 Brian Dolbec
2022-07-09  5:17 Sam James
2017-09-05 15:32 Mike Gilbert
2016-06-30 23:36 Paul Varner
2016-06-30 20:44 Paul Varner
2016-06-06 19:29 Brian Dolbec
2015-11-09 20:52 Brian Dolbec
2015-11-09  2:42 Brian Dolbec
2015-11-08 17:37 Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1525177813.bb585671418fa51682a7e1dbfef5914e26261adf.mpagano@gentoo \
    --to=mpagano@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox