|
|
f27990 |
From 6fa62462187c45a32c76d00d15a701307f464336 Mon Sep 17 00:00:00 2001
|
|
|
f27990 |
From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= <jpokorny@redhat.com>
|
|
|
f27990 |
Date: Wed, 10 Aug 2016 16:04:30 +0200
|
|
|
f27990 |
Subject: [PATCH] main: make the help screen more help2html friendly
|
|
|
f27990 |
MIME-Version: 1.0
|
|
|
f27990 |
Content-Type: text/plain; charset=UTF-8
|
|
|
f27990 |
Content-Transfer-Encoding: 8bit
|
|
|
f27990 |
|
|
|
f27990 |
Previously, it was the case that --list-dists was line-split on
|
|
|
f27990 |
the inner hyphen, which then subsequently got lost in the man page.
|
|
|
f27990 |
Also enquoted --help was not parsed as an option, so simply drop
|
|
|
f27990 |
the surrounding quotes.
|
|
|
f27990 |
|
|
|
f27990 |
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
|
|
|
f27990 |
---
|
|
|
f27990 |
main.py | 12 +++++++++++-
|
|
|
f27990 |
1 file changed, 11 insertions(+), 1 deletion(-)
|
|
|
f27990 |
|
|
|
f27990 |
diff --git a/clufter/main.py b/clufter/main.py
|
|
|
f27990 |
index 62d628e..a68bf76 100644
|
|
|
f27990 |
--- a/clufter/main.py
|
|
|
f27990 |
+++ b/clufter/main.py
|
|
|
f27990 |
@@ -216,6 +216,16 @@ class SharedHelpFormatter(IndentedHelpFormatter):
|
|
|
f27990 |
"""IndentedHelpFormatter to expand choices along defaults"""
|
|
|
f27990 |
choices_tag = "%choices"
|
|
|
f27990 |
|
|
|
f27990 |
+ def __init__(self, *args, **kwargs):
|
|
|
f27990 |
+ from textwrap import fill, wrap
|
|
|
f27990 |
+ IndentedHelpFormatter.__init__(self, *args, **kwargs)
|
|
|
f27990 |
+ tw = type('textwrap_mock', (object, ), dict(
|
|
|
f27990 |
+ fill=staticmethod(fill),
|
|
|
f27990 |
+ wrap=staticmethod(lambda *args, **kwargs:
|
|
|
f27990 |
+ wrap(*args, **dict(kwargs, break_on_hyphens=False)),
|
|
|
f27990 |
+ )))
|
|
|
f27990 |
+ self.format_option.func_globals['textwrap'] = tw
|
|
|
f27990 |
+
|
|
|
f27990 |
def expand_default(self, option):
|
|
|
f27990 |
ret = IndentedHelpFormatter.expand_default(self, option)
|
|
|
f27990 |
if isinstance(option, ExpertOption):
|
|
|
f27990 |
@@ -373,7 +383,7 @@ def run(argv=None, *args):
|
|
|
f27990 |
description_raw=cmds,
|
|
|
f27990 |
epilog='\n'.join(args2sgpl(
|
|
|
f27990 |
"To get help for given command, just precede or follow"
|
|
|
f27990 |
- " it with `--help'.",
|
|
|
f27990 |
+ " it with --help.",
|
|
|
f27990 |
*report_bugs
|
|
|
f27990 |
))
|
|
|
f27990 |
)
|
|
|
f27990 |
--
|
|
|
f27990 |
2.4.11
|
|
|
f27990 |
|