From 7304d24dfdb3fcc96493ecf676635e9e7111ef7c Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 3 Sep 2020 12:31:16 -0300 Subject: [PATCH] dont break lines on -- to avoid docopt parsing issues --- lbry/service/parser.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lbry/service/parser.py b/lbry/service/parser.py index a78a7b58f..9f30db0d0 100644 --- a/lbry/service/parser.py +++ b/lbry/service/parser.py @@ -215,6 +215,12 @@ def generate_options(method, indent) -> List[str]: text += f" [default: {arg['default']}]" wrapped = textwrap.wrap(text, LINE_WIDTH-len(left)) lines = [f"{left}{wrapped.pop(0)}"] + # dont break on -- or docopt will parse as a new option + for line_number, line in enumerate(wrapped): + if line.strip().startswith('--'): + wrapped[line_number-1] += ' ' + line.strip() + wrapped[line_number] = '' + continue for line in wrapped: lines.append(f"{' '*len(left)} {line}") options.extend(lines)