Skip to content

Commit

Permalink
main: limit help text width
Browse files Browse the repository at this point in the history
  • Loading branch information
layday committed May 11, 2023
1 parent f5d5f15 commit e6d0616
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/build/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import warnings

from collections.abc import Iterator, Sequence
from functools import partial
from typing import NoReturn, TextIO

import build
Expand Down Expand Up @@ -275,7 +276,12 @@ def main_parser() -> argparse.ArgumentParser:
).strip(),
' ',
),
formatter_class=argparse.RawTextHelpFormatter,
formatter_class=partial(
argparse.RawDescriptionHelpFormatter,
# Prevent argparse from taking up the entire width of the terminal window
# which impedes readability.
width=min(shutil.get_terminal_size().columns - 2, 127),
),
)
parser.add_argument(
'srcdir',
Expand Down

0 comments on commit e6d0616

Please sign in to comment.