Skip to content

Commit

Permalink
work in progress to fix tomerfiliba#555
Browse files Browse the repository at this point in the history
  • Loading branch information
tashrifbillah committed Dec 31, 2021
1 parent 0c574a9 commit ffe4099
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions plumbum/cli/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,21 @@ def switchs(by_groups, show_groups):

for switch_info, prefix, color in switchs(by_groups, True):
help = switch_info.help # @ReservedAssignment

# break and join multi-line help message
max_width= 200
indent_size= 8
indent=' ' * indent_size
help= '\n'.join([
line for lst in map(
TextWrapper(width=max_width,
initial_indent=indent,
subsequent_indent=indent).wrap,
help.splitlines()
)
for line in lst
])

if switch_info.list:
help += T_("; may be given multiple times")
if switch_info.mandatory:
Expand All @@ -941,10 +956,11 @@ def switchs(by_groups, show_groups):
for switch in switch_info.excludes
)
)
# msg = indentation.join(
# wrapper.wrap(" ".join(ln.strip() for ln in help.splitlines()))
# )

msg = indentation.join(
wrapper.wrap(" ".join(ln.strip() for ln in help.splitlines()))
)
msg = help

if len(prefix) + wrapper.width >= cols:
padding = indentation
Expand Down

0 comments on commit ffe4099

Please sign in to comment.