aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/wrap
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2018-08-21 17:08:41 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2018-08-22 10:43:08 -0400
commit3147b4178792c967277449f03d418b23e2d03137 (patch)
treecffc14c98b6ce90ea8dcd293146380c574fe5472 /mesonbuild/wrap
parent05b54b4767ff9bd14f0c037d0c2b86447a077b66 (diff)
downloadmeson-3147b4178792c967277449f03d418b23e2d03137.zip
meson-3147b4178792c967277449f03d418b23e2d03137.tar.gz
meson-3147b4178792c967277449f03d418b23e2d03137.tar.bz2
help: Fix printing list of wrap mode
Implement a string converter in our WrapMode enum so that argparse will only print the names in the doc instead of WrapMode.<name>. This changes --help command from printing: --wrap-mode {WrapMode.default,WrapMode.nofallback,WrapMode.nodownload,WrapMode.forcefallback} to: --wrap-mode {default,nofallback,nodownload,forcefallback} Fixes issue #4067
Diffstat (limited to 'mesonbuild/wrap')
-rw-r--r--mesonbuild/wrap/__init__.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/wrap/__init__.py b/mesonbuild/wrap/__init__.py
index 6e2bc83..b792dfa 100644
--- a/mesonbuild/wrap/__init__.py
+++ b/mesonbuild/wrap/__init__.py
@@ -33,4 +33,11 @@ from enum import Enum
# Note that these options do not affect subprojects that
# are git submodules since those are only usable in git
# repositories, and you almost always want to download them.
-WrapMode = Enum('WrapMode', 'default nofallback nodownload forcefallback')
+class WrapMode(Enum):
+ default = 1
+ nofallback = 2
+ nodownload = 3
+ forcefallback = 4
+
+ def __str__(self):
+ return self.name