diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-06-12 20:59:50 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-06-12 20:59:50 +0100 |
commit | 5469f2aa29d641e9dc0edb22e77066847c7ed17a (patch) | |
tree | 2803bd5d78d62ef6ca849b869702c346d6c60da0 /docs/source/generate_commands.py | |
parent | 34e7e6c73035f8e4fe309075e0813ac48517d610 (diff) |
doc: do not list all possible choices for boolean
.. command parameters. BooleanAction type
argparse parameters allow y/n, true/false etc.. don't list all possibilities in the docs
Diffstat (limited to 'docs/source/generate_commands.py')
-rwxr-xr-x | docs/source/generate_commands.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/source/generate_commands.py b/docs/source/generate_commands.py index 97c50cd2..eb241d10 100755 --- a/docs/source/generate_commands.py +++ b/docs/source/generate_commands.py @@ -6,6 +6,7 @@ from alot.commands import * from alot.commands import COMMANDS import alot.buffers from argparse import HelpFormatter, SUPPRESS, OPTIONAL, ZERO_OR_MORE, ONE_OR_MORE, PARSER, REMAINDER +from alot.utils.booleanaction import BooleanAction from gettext import gettext as _ import collections as _collections import copy as _copy @@ -84,7 +85,7 @@ def rstify_parser(parser): for a in parser._optionals._group_actions: switches = [s.replace('--','---') for s in a.option_strings] out += "\t:%s: %s" % (', '.join(switches), a.help) - if a.choices: + if a.choices and not isinstance(a, BooleanAction): out += ". Valid choices are: %s" % ','.join(['\`%s\`' % s for s in a.choices]) if a.default: |