Skip to content

Commit fcc9a08

Browse files
committed
Adjust indentation of help strings
Uses backspace character (\b) because argparse does not provide any way to override the amount of indentation. Although argparse.HelpFormatter exposes an option for the amount of indendation, it is undocumented and not part of the public interface. Signed-off-by: John Pennycook <john.pennycook@intel.com>
1 parent f5fcd01 commit fcc9a08

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bin/codebasin

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ def _help_string(*lines: str, is_long=False, is_last=False):
4040
if not is_long:
4141
result = "\n"
4242

43+
# argparse.HelpFormatter indents by 24 characters.
44+
# We cannot override this directly, but can delete them with backspaces.
45+
lines = ["\b" * 20 + x for x in lines]
46+
4347
# The additional space is required for argparse to respect newlines.
4448
result += "\n".join(lines)
4549

0 commit comments

Comments
 (0)