diff options
author | Simon Warta <[email protected]> | 2015-06-24 10:06:14 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-06-24 10:06:14 +0200 |
commit | 870e846c3fe4c723c313e72cdcfbe81a32bd01a9 (patch) | |
tree | 5837554dd8d9040cf96b5ddd64f4144f26eeb561 | |
parent | 2a83523815461a4aa461ce5cc3b1288727440705 (diff) |
Add optparse choices parameter to detect config errors nice and early
-rwxr-xr-x | configure.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/configure.py b/configure.py index 0d459bb66..fc6e40912 100755 --- a/configure.py +++ b/configure.py @@ -282,6 +282,7 @@ def process_command_line(args): modes = ['release', 'debug', 'coverage'] build_group.add_option('--build-mode', default='release', metavar='MODE', + choices=modes, help="Build mode (one of %s; default %%default)" % (', '.join(modes))) build_group.add_option('--debug-mode', action='store_const', @@ -290,7 +291,7 @@ def process_command_line(args): build_group.add_option('--enable-shared', dest='build_shared_lib', action='store_true', default=True, - help=optparse.SUPPRESS_HELP) + help=optparse.SUPPRESS_HELP) build_group.add_option('--disable-shared', dest='build_shared_lib', action='store_false', help='disable building shared library') @@ -324,8 +325,10 @@ def process_command_line(args): build_group.add_option('--link-method', default=None, metavar='METHOD', help='choose how links are created') + makefile_styles = ['gmake', 'nmake'] build_group.add_option('--makefile-style', metavar='STYLE', default=None, - help='makefile type (gmake or nmake)') + choices=makefile_styles, + help='makefile type (%s)' % ' or '.join(makefile_styles)) build_group.add_option('--with-local-config', dest='local_config', metavar='FILE', @@ -356,6 +359,7 @@ def process_command_line(args): build_group.add_option('--maintainer-mode', dest='maintainer_mode', action='store_true', default=False, help="Enable extra warnings") + build_group.add_option('--dirty-tree', dest='clean_build_tree', action='store_false', default=True, help=optparse.SUPPRESS_HELP) |