diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2008-08-25 09:10:03 +0200 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2008-08-25 09:10:03 +0200 |
commit | ad26c4c6302b3a17e05629b1c9b6385478c4df27 (patch) | |
tree | b5a3c857078a3eab93b2753b89d292440b074a8b | |
parent | 1530f6a9ef48332b1f096c0a0e560bb29ec1f25f (diff) | |
download | logilab-common-ad26c4c6302b3a17e05629b1c9b6385478c4df27.tar.gz |
fix default values in help
-rw-r--r-- | configuration.py | 5 | ||||
-rw-r--r-- | test/unittest_configuration.py | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/configuration.py b/configuration.py index 9fcac36..f4dce43 100644 --- a/configuration.py +++ b/configuration.py @@ -367,7 +367,7 @@ class OptionsManagerMixIn(object): for opt_name, opt_dict in non_group_spec_options: args, opt_dict = self.optik_option(provider, opt_name, opt_dict) self._optik_parser.add_option(*args, **opt_dict) - self._all_options[opt_name] = provider + self._all_options[opt_name] = provider for gname, gdoc in groups: goptions = [option for option in provider.options if option[1].get('group') == gname] @@ -401,10 +401,11 @@ class OptionsManagerMixIn(object): opt_dict['callback'] = self.cb_set_provider_option for specific in ('default', 'group', 'inputlevel'): if opt_dict.has_key(specific): - del opt_dict[specific] if (OPTPARSE_FORMAT_DEFAULT and specific == 'default' and opt_dict.has_key('help')): opt_dict['help'] += ' [current: %default]' + else: + del opt_dict[specific] args = ['--' + opt_name] if opt_dict.has_key('short'): self._short_options[opt_dict['short']] = opt_name diff --git a/test/unittest_configuration.py b/test/unittest_configuration.py index dc00aec..6e2c981 100644 --- a/test/unittest_configuration.py +++ b/test/unittest_configuration.py @@ -165,7 +165,7 @@ Options: --dothis=<y or n> -v<string>, --value=<string> --multiple=<comma separated values> - you can also document the option [current: none] + you can also document the option [current: ('yop',)] --number=<int> --choice=<yo|ye> --multiple-choice=<yo|ye> @@ -182,7 +182,7 @@ options: --dothis=<y or n> -v<string>, --value=<string> --multiple=<comma separated values> - you can also document the option [current: none] + you can also document the option [current: ('yop',)] --number=<int> --choice=<yo|ye> --multiple-choice=<yo|ye> |