summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-12-14 14:59:07 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-12-26 10:09:17 +0100
commit652895abdce4bc1ff2f00c7f21c0d0d722680806 (patch)
treea361fe6d917cc9ec6660b5fddd8790f632bdb6f0
parenta410a750c74c49e004ddd442e0debda891d83126 (diff)
downloadmpv-652895abdce4bc1ff2f00c7f21c0d0d722680806.tar.bz2
mpv-652895abdce4bc1ff2f00c7f21c0d0d722680806.tar.xz
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.
-rw-r--r--README.md6
-rw-r--r--waftools/features.py6
2 files changed, 11 insertions, 1 deletions
diff --git a/README.md b/README.md
index 59b1cb4e40..ecc2f36223 100644
--- a/README.md
+++ b/README.md
@@ -27,6 +27,12 @@ you think you have support for some feature installed but configure fails to
detect it, the file `build/config.log` may contain information about the
reasons for the failure.
+NOTE: To avoid cluttering the output with unreadable spam, `--help` only shows
+one of the two switches for each option. If the option is autodetected by
+default, the `--disable-***` switch is printed; if the option is disabled by
+default, the `--enable-***` switch is printed. Either way, you can use
+`--enable-***` or `--disable-**` regardless of what is printed by `--help`.
+
To build the software you can use `./waf build`: the result of the compilation
will be located in `build/mpv`. You can use `./waf install` to install mpv
to the *prefix* after it is compiled.
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)