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
pull/4068/head
Nicolas Dufresne 6 years ago
parent 05b54b4767
commit 3147b41787
  1. 9
      mesonbuild/wrap/__init__.py

@ -33,4 +33,11 @@ from enum import Enum
# Note that these options do not affect subprojects that # Note that these options do not affect subprojects that
# are git submodules since those are only usable in git # are git submodules since those are only usable in git
# repositories, and you almost always want to download them. # 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

Loading…
Cancel
Save