Skip to content

Commit 07244f5

Browse files
committed
Corrected a comment and some type hints.
1 parent 28729a2 commit 07244f5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cmd2/argparse_custom.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ def _format_action_invocation(self, action: argparse.Action) -> str:
12611261
def _determine_metavar(
12621262
self,
12631263
action: argparse.Action,
1264-
default_metavar: str | tuple[str, ...],
1264+
default_metavar: str,
12651265
) -> str | tuple[str, ...]:
12661266
"""Determine what to use as the metavar value of an action."""
12671267
if action.metavar is not None:
@@ -1278,7 +1278,7 @@ def _determine_metavar(
12781278
def _metavar_formatter(
12791279
self,
12801280
action: argparse.Action,
1281-
default_metavar: str | tuple[str, ...],
1281+
default_metavar: str,
12821282
) -> Callable[[int], tuple[str, ...]]:
12831283
metavar = self._determine_metavar(action, default_metavar)
12841284

@@ -1289,7 +1289,7 @@ def format_tuple(tuple_size: int) -> tuple[str, ...]:
12891289

12901290
return format_tuple
12911291

1292-
def _format_args(self, action: argparse.Action, default_metavar: str | tuple[str, ...]) -> str:
1292+
def _format_args(self, action: argparse.Action, default_metavar: str) -> str:
12931293
"""Handle ranged nargs and make other output less verbose."""
12941294
metavar = self._determine_metavar(action, default_metavar)
12951295
metavar_formatter = self._metavar_formatter(action, default_metavar)

cmd2/rich_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ def __init__(self, file: IO[str] | None = None) -> None:
128128
elif ALLOW_STYLE == AllowStyle.NEVER:
129129
force_terminal = False
130130

131-
# Configure console defaults to treat output as plain, unstructured text.
132-
# This involves enabling soft wrapping (no automatic word-wrap) and disabling
131+
# Configure console defaults to treat text as already formatted.
132+
# Therefore we enable soft wrap (no automatic word-wrap) and disable
133133
# Rich's automatic markup, emoji, and highlight processing.
134134
# While these automatic features are off by default, the console fully supports
135135
# rendering explicitly created Rich objects (e.g., Panel, Table).

0 commit comments

Comments
 (0)