diff options
Diffstat (limited to 'pym/gentoolkit/equery/depends.py')
| -rw-r--r-- | pym/gentoolkit/equery/depends.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/pym/gentoolkit/equery/depends.py b/pym/gentoolkit/equery/depends.py index 39e0b25..34ac974 100644 --- a/pym/gentoolkit/equery/depends.py +++ b/pym/gentoolkit/equery/depends.py @@ -28,6 +28,7 @@ QUERY_OPTS = { "only_direct": True, "max_depth": None, "package_format": None, + "conditionals": False, } # ======= @@ -154,6 +155,10 @@ def print_help(with_description=True): (" -D, --indirect", "search both direct and indirect dependencies"), (" -F, --format=TMPL", "specify a custom output format"), (" --depth=N", "limit indirect dependency tree to specified depth"), + ( + " --conditionals", + "filter conditional dependencies using your installed flags", + ), ) ) ) @@ -174,6 +179,8 @@ def parse_module_options(module_opts): QUERY_OPTS["only_direct"] = False elif opt in ("-F", "--format"): QUERY_OPTS["package_format"] = posarg + elif opt in ("--conditionals"): + QUERY_OPTS["conditionals"] = True elif opt in ("--depth"): if posarg.isdigit(): depth = int(posarg) @@ -189,7 +196,15 @@ def parse_module_options(module_opts): def main(input_args): """Parse input and run the program""" short_opts = "hadDF:" # -d, --direct was old option for default action - long_opts = ("help", "all-packages", "direct", "indirect", "format", "depth=") + long_opts = ( + "help", + "all-packages", + "direct", + "indirect", + "format", + "depth=", + "conditionals", + ) try: module_opts, queries = gnu_getopt(input_args, short_opts, long_opts) @@ -233,6 +248,7 @@ def main(input_args): pkgset=sorted(pkggetter()), only_direct=QUERY_OPTS["only_direct"], max_depth=QUERY_OPTS["max_depth"], + conditionals=QUERY_OPTS["conditionals"], ): if last_seen is None or last_seen != pkgdep: seen = False |
