def _match_long_opt(self, opt): try: return OptionParser._match_long_opt(self, opt) except BadOptionError: option = Option(opt, action='callback', dest='django', type='string', callback=add_django_option) # Adding the option straight in by-passes the help mechanism. self._long_opt[opt] = option return opt
def _match_long_opt(self, opt): if opt.startswith("--no-"): return (OptionParser._match_long_opt(self, "--" + opt[5:]), True) return OptionParser._match_long_opt(self, opt)