From: Stefan Behnel Date: Fri, 15 Apr 2011 07:40:23 +0000 (+0200) Subject: support '-Xdirective=value' on cmd line, in addition to '-X directive=value' X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=920ddf72947226de625f4a873c5097ed73f4e8fb;p=cython.git support '-Xdirective=value' on cmd line, in addition to '-X directive=value' --- diff --git a/Cython/Compiler/CmdLine.py b/Cython/Compiler/CmdLine.py index 60eff8db..b2b449dc 100644 --- a/Cython/Compiler/CmdLine.py +++ b/Cython/Compiler/CmdLine.py @@ -133,10 +133,14 @@ def parse_command_line(args): Options.fast_fail = True elif option == "--disable-function-redefinition": Options.disable_function_redefinition = True - elif option in ("-X", "--directive"): + elif option == "--directive" or option.startswith('-X'): + if option.startswith('-X') and option[2:].strip(): + x_args = option[2:] + else: + x_args = pop_arg() try: options.compiler_directives = Options.parse_directive_list( - pop_arg(), relaxed_bool=True, + x_args, relaxed_bool=True, current_settings=options.compiler_directives) except ValueError, e: sys.stderr.write("Error in compiler directive: %s\n" % e.args[0])