Christophe Guillon added the comment: As a workaround for this missing feature, the negative number matching regexp can be used for allowing arguments starting with '-' in arguments of option flags.
We basically do: parser = argparse.ArgumentParser(...) parser._negative_number_matcher = re.compile(r'^-.+$') This allow cases such as @andersk: $ a2x --asciidoc-opts --safe gitcli.txt where '--safe' is an argument to '--asciidoc-opts' As this behavioral change is quite simple, couldn't the requested feature be implemented like this with an optional setting to the ArgumentParser contructor? ---------- nosy: +Christophe.Guillon _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9334> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com