generate_doc: Remove unneeded whitespace

This commit is contained in:
Florian Bruhin 2014-09-07 19:04:09 +02:00
parent a1fabcc5c2
commit 02292d8518
2 changed files with 8 additions and 12 deletions

View File

@ -30,7 +30,6 @@ It was inspired by other browsers/addons like dwb and Vimperator/Pentadactyl.
*'URL'*:: *'URL'*::
URLs to open on startup. URLs to open on startup.
=== optional arguments === optional arguments
*-h*, *--help*:: *-h*, *--help*::
show this help message and exit show this help message and exit
@ -41,7 +40,6 @@ It was inspired by other browsers/addons like dwb and Vimperator/Pentadactyl.
*-V*, *--version*:: *-V*, *--version*::
Show version and quit. Show version and quit.
=== debug arguments === debug arguments
*-l* 'LOGLEVEL', *--loglevel* 'LOGLEVEL':: *-l* 'LOGLEVEL', *--loglevel* 'LOGLEVEL'::
Set loglevel Set loglevel
@ -81,9 +79,6 @@ It was inspired by other browsers/addons like dwb and Vimperator/Pentadactyl.
*--qt-qmljsdebugger* 'port:PORT[,block]':: *--qt-qmljsdebugger* 'port:PORT[,block]'::
Activate the QML/JS debugger with a specified port. 'block' is optional and will make the application wait until a debugger connects to it. Activate the QML/JS debugger with a specified port. 'block' is optional and will make the application wait until a debugger connects to it.
// QUTE_OPTIONS_END // QUTE_OPTIONS_END
== BUGS == BUGS

View File

@ -151,7 +151,7 @@ def _format_action(action):
for opt in action.option_strings: for opt in action.option_strings:
parts.append('*{}* {}'.format(opt, args_string)) parts.append('*{}* {}'.format(opt, args_string))
invocation = ', '.join(parts) + '::' invocation = ', '.join(parts) + '::'
return '{}\n {}\n\n'.format(invocation, action.help) return '{}\n {}\n'.format(invocation, action.help)
def generate_commands(f): def generate_commands(f):
@ -293,19 +293,20 @@ def regenerate_manpage(filename):
"""Update manpage OPTIONS using an argparse parser.""" """Update manpage OPTIONS using an argparse parser."""
# pylint: disable=protected-access # pylint: disable=protected-access
parser = qutequtebrowser.get_argparser() parser = qutequtebrowser.get_argparser()
options = [] groups = []
# positionals, optionals and user-defined groups # positionals, optionals and user-defined groups
for group in parser._action_groups: for group in parser._action_groups:
options.append('=== {}\n'.format(group.title)) groupdata = []
groupdata.append('=== {}'.format(group.title))
if group.description is not None: if group.description is not None:
options.append(group.description + '\n') groupdata.append(group.description)
for action in group._group_actions: for action in group._group_actions:
options.append(_format_action(action)) groupdata.append(_format_action(action))
options.append('\n') groups.append('\n'.join(groupdata))
options = '\n'.join(groups)
# epilog # epilog
if parser.epilog is not None: if parser.epilog is not None:
options.append(parser.epilog) options.append(parser.epilog)
options.append('\n')
_format_block(filename, 'options', options) _format_block(filename, 'options', options)