summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsylvain thenault <sylvain.thenault@logilab.fr>2009-04-16 18:33:25 +0200
committersylvain thenault <sylvain.thenault@logilab.fr>2009-04-16 18:33:25 +0200
commit570ad3d6a1cb743d4bb947849a20145a0d9293ce (patch)
treecc74185ca81a8ae249c64f1a2b84924c34ae39e7
parentbee8f47ed47a7b071f3c2b41e46856ab1cffe181 (diff)
downloadlogilab-common-570ad3d6a1cb743d4bb947849a20145a0d9293ce.tar.gz
don't print default for store_true / store_false option / option with None as default
-rw-r--r--configuration.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/configuration.py b/configuration.py
index 63dd32d..4876aef 100644
--- a/configuration.py
+++ b/configuration.py
@@ -82,7 +82,7 @@ Quick start: simplest usage
>>>
-:copyright: 2003-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2003-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: General Public License version 2 - http://www.gnu.org/licenses
"""
@@ -425,7 +425,9 @@ class OptionsManagerMixIn(object):
# default is handled here and *must not* be given to optik if you
# want the whole machinery to work
if 'default' in opt_dict:
- if OPTPARSE_FORMAT_DEFAULT and 'help' in opt_dict:
+ if (OPTPARSE_FORMAT_DEFAULT and 'help' in opt_dict and
+ opt_dict.get('default') is not None and
+ not opt_dict['action'] in ('store_true', 'store_false')):
opt_dict['help'] += ' [current: %default]'
del opt_dict['default']
args = ['--' + opt_name]