From 02292d8518c5406a32cf929b88f6d9355588eea5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 7 Sep 2014 19:04:09 +0200 Subject: [PATCH] generate_doc: Remove unneeded whitespace --- doc/qutebrowser.1.asciidoc | 5 ----- scripts/generate_doc.py | 15 ++++++++------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/doc/qutebrowser.1.asciidoc b/doc/qutebrowser.1.asciidoc index bd847fb64..7761b790d 100644 --- a/doc/qutebrowser.1.asciidoc +++ b/doc/qutebrowser.1.asciidoc @@ -30,7 +30,6 @@ It was inspired by other browsers/addons like dwb and Vimperator/Pentadactyl. *'URL'*:: URLs to open on startup. - === optional arguments *-h*, *--help*:: show this help message and exit @@ -41,7 +40,6 @@ It was inspired by other browsers/addons like dwb and Vimperator/Pentadactyl. *-V*, *--version*:: Show version and quit. - === debug arguments *-l* 'LOGLEVEL', *--loglevel* 'LOGLEVEL':: Set loglevel @@ -81,9 +79,6 @@ It was inspired by other browsers/addons like dwb and Vimperator/Pentadactyl. *--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. - - - // QUTE_OPTIONS_END == BUGS diff --git a/scripts/generate_doc.py b/scripts/generate_doc.py index 87bc6652f..659b3aaa3 100755 --- a/scripts/generate_doc.py +++ b/scripts/generate_doc.py @@ -151,7 +151,7 @@ def _format_action(action): for opt in action.option_strings: parts.append('*{}* {}'.format(opt, args_string)) invocation = ', '.join(parts) + '::' - return '{}\n {}\n\n'.format(invocation, action.help) + return '{}\n {}\n'.format(invocation, action.help) def generate_commands(f): @@ -293,19 +293,20 @@ def regenerate_manpage(filename): """Update manpage OPTIONS using an argparse parser.""" # pylint: disable=protected-access parser = qutequtebrowser.get_argparser() - options = [] + groups = [] # positionals, optionals and user-defined 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: - options.append(group.description + '\n') + groupdata.append(group.description) for action in group._group_actions: - options.append(_format_action(action)) - options.append('\n') + groupdata.append(_format_action(action)) + groups.append('\n'.join(groupdata)) + options = '\n'.join(groups) # epilog if parser.epilog is not None: options.append(parser.epilog) - options.append('\n') _format_block(filename, 'options', options)