diff options
author | Mike Pagano <mpagano@gentoo.org> | 2018-05-01 08:30:13 -0400 |
---|---|---|
committer | Mike Pagano <mpagano@gentoo.org> | 2018-05-01 08:30:13 -0400 |
commit | bb585671418fa51682a7e1dbfef5914e26261adf (patch) | |
tree | bf47757c7ba456080da2f70e6754441a66f25b4d | |
parent | eshowkw: Always group Prefix keywords last (diff) | |
download | gentoolkit-bb585671418fa51682a7e1dbfef5914e26261adf.tar.gz gentoolkit-bb585671418fa51682a7e1dbfef5914e26261adf.tar.bz2 gentoolkit-bb585671418fa51682a7e1dbfef5914e26261adf.zip |
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.
-rw-r--r-- | pym/gentoolkit/equery/meta.py | 7 |
1 files 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 |