From 920ddf72947226de625f4a873c5097ed73f4e8fb Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 15 Apr 2011 09:40:23 +0200 Subject: [PATCH] support '-Xdirective=value' on cmd line, in addition to '-X directive=value' --- Cython/Compiler/CmdLine.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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]) -- 2.26.2