forked from LBRYCommunity/lbry-sdk
dont break lines on -- to avoid docopt parsing issues
This commit is contained in:
parent
b330c35282
commit
7304d24dfd
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue