From 652895abdce4bc1ff2f00c7f21c0d0d722680806 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 14 Dec 2013 14:59:07 +0100 Subject: build: hide duplicate options from `--help` Hide --enable variants from [autodetect]'ed options and --enable/--disable variants for [enable]'d/[disable]'d options. The hidden options are still usable, just hidden for more readability. --- waftools/features.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'waftools') diff --git a/waftools/features.py b/waftools/features.py index 1385d41dbf..d038392a82 100644 --- a/waftools/features.py +++ b/waftools/features.py @@ -1,4 +1,5 @@ from waflib.Options import OptionsContext +import optparse class Feature(object): def __init__(self, group, feature): @@ -43,8 +44,11 @@ class Feature(object): return "--{0}-{1}".format(state, self.identifier) def help(self, state): + default = self.behaviour() + if (default, state) == ("autodetect", "enable") or default == state: + return optparse.SUPPRESS_HELP return "{0} {1} [{2}]" \ - .format(state, self.attributes['desc'], self.behaviour()) + .format(state, self.attributes['desc'], default) def storage(self): return "enable_{0}".format(self.identifier) -- cgit v1.2.3