logilab/common
changeset 1130:d706bd7eabcf stable
fix help generation for normal optparse using script if optik_ext has been imported (#24450)
| author | Alexandre Fayolle <alexandre.fayolle@logilab.fr> |
|---|---|
| date | Mon May 03 12:12:09 2010 +0200 (21 months ago) |
| parents | b3091f908cae |
| children | 441ef9b0b667 0c03df7e9c1c |
| files | optik_ext.py |
line diff
1.1 --- a/optik_ext.py Mon May 03 09:15:57 2010 +0200 1.2 +++ b/optik_ext.py Mon May 03 12:12:09 2010 +0200 1.3 @@ -274,7 +274,7 @@ 1.4 result = [] 1.5 outputlevel = getattr(formatter, 'output_level', 0) 1.6 for option in self.option_list: 1.7 - if option.level <= outputlevel and not option.help is SUPPRESS_HELP: 1.8 + if getattr(option, 'level', 0) <= outputlevel and not option.help is SUPPRESS_HELP: 1.9 result.append(formatter.format_option(option)) 1.10 return "".join(result) 1.11 OptionContainer.format_option_help = format_option_help
