aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Ospald <hasufell@gentoo.org>2013-11-01 19:07:54 +0100
committerJulian Ospald <hasufell@gentoo.org>2013-11-01 19:07:54 +0100
commit07c7d909a9f36e2cccda406adb97091631f71f25 (patch)
treee62eab6efc127de224aa37e393e7649879905959 /pym/gentoolkit/equery/uses.py
parentAdd fallback to using portageq for get_portdir function. (diff)
downloadgentoolkit-07c7d909a9f36e2cccda406adb97091631f71f25.tar.gz
gentoolkit-07c7d909a9f36e2cccda406adb97091631f71f25.tar.bz2
gentoolkit-07c7d909a9f36e2cccda406adb97091631f71f25.zip
equery: add --ignore-linguas switch to 'equery uses'
Diffstat (limited to 'pym/gentoolkit/equery/uses.py')
-rw-r--r--pym/gentoolkit/equery/uses.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/pym/gentoolkit/equery/uses.py b/pym/gentoolkit/equery/uses.py
index 22e6488..cedac96 100644
--- a/pym/gentoolkit/equery/uses.py
+++ b/pym/gentoolkit/equery/uses.py
@@ -34,7 +34,7 @@ from gentoolkit.flag import get_flags, reduce_flags
# Globals
# =======
-QUERY_OPTS = {"all_versions" : False}
+QUERY_OPTS = {"all_versions" : False, "ignore_linguas" : False}
# =========
# Functions
@@ -55,7 +55,8 @@ def print_help(with_description=True):
print(pp.command("options"))
print(format_options((
(" -h, --help", "display this help message"),
- (" -a, --all", "include all package versions")
+ (" -a, --all", "include all package versions"),
+ (" -i, --ignore-linguas", "don't show linguas USE flags")
)))
@@ -183,6 +184,11 @@ def get_output_descriptions(pkg, global_usedesc):
usevar = reduce_flags(iuse)
usevar.sort()
+ if QUERY_OPTS['ignore_linguas']:
+ for a in usevar[:]:
+ if a.startswith("linguas_"):
+ usevar.remove(a)
+
if pkg.is_installed():
used_flags = pkg.use().split()
@@ -235,6 +241,8 @@ def parse_module_options(module_opts):
sys.exit(0)
elif opt in ('-a', '--all'):
QUERY_OPTS['all_versions'] = True
+ elif opt in ('-i', '--ignore-linguas'):
+ QUERY_OPTS['ignore_linguas'] = True
def print_legend():
@@ -249,8 +257,8 @@ def print_legend():
def main(input_args):
"""Parse input and run the program"""
- short_opts = "ha"
- long_opts = ('help', 'all')
+ short_opts = "hai"
+ long_opts = ('help', 'all', 'ignore-linguas')
try:
module_opts, queries = gnu_getopt(input_args, short_opts, long_opts)