Skip to content

Fix typos #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rich_argparse/optparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def format_heading(self, heading: str) -> str:
"--syntax", action="store_true", help="`backquotes` may be bold, but they are :muscle:"
)
parser.add_option(
"-s", "--long", metavar="METAVAR", help="Thats a lot of metavars for an option!"
"-s", "--long", metavar="METAVAR", help="That's a lot of metavars for an option!"
)

group = parser.add_option_group("Magic", description=":sparkles: :sparkles: :sparkles:")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ def test_default_highlights():
parser = ArgumentParser(
"PROG",
formatter_class=RichHelpFormatter,
description="Descritpion with `syntax` and --options.",
description="Description with `syntax` and --options.",
epilog="Epilog with `syntax` and --options.",
)
# syntax highlights
Expand All @@ -670,7 +670,7 @@ def test_default_highlights():
parser.add_argument("--option-short", action="store_true", help="Start -middle end")

expected_help_output = """
\x1b[39mDescritpion with `\x1b[0m\x1b[1;39msyntax\x1b[0m\x1b[39m` and \x1b[0m\x1b[36m--options\x1b[0m\x1b[39m.\x1b[0m
\x1b[39mDescription with `\x1b[0m\x1b[1;39msyntax\x1b[0m\x1b[39m` and \x1b[0m\x1b[36m--options\x1b[0m\x1b[39m.\x1b[0m

\x1b[38;5;208mOptional Arguments:\x1b[0m
\x1b[36m-h\x1b[0m, \x1b[36m--help\x1b[0m \x1b[39mshow this help message and exit\x1b[0m
Expand Down
10 changes: 5 additions & 5 deletions tests/test_optparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def test_default_highlights():
parser = OptionParser(
"PROG",
formatter=IndentedRichHelpFormatter(),
description="Descritpion with `syntax` and --options.",
description="Description with `syntax` and --options.",
epilog="Epilog with `syntax` and --options.",
)
# syntax highlights
Expand All @@ -226,7 +226,7 @@ def test_default_highlights():
parser.add_option("--option-short", action="store_true", help="Start -middle end")

expected_help_output = """
\x1b[39mDescritpion with `\x1b[0m\x1b[1;39msyntax\x1b[0m\x1b[39m` and \x1b[0m\x1b[36m--options\x1b[0m\x1b[39m.\x1b[0m
\x1b[39mDescription with `\x1b[0m\x1b[1;39msyntax\x1b[0m\x1b[39m` and \x1b[0m\x1b[36m--options\x1b[0m\x1b[39m.\x1b[0m

\x1b[38;5;208mOptions:\x1b[0m
\x1b[36m-h\x1b[0m, \x1b[36m--help\x1b[0m \x1b[39mshow this help message and exit\x1b[0m
Expand Down Expand Up @@ -273,7 +273,7 @@ def test_titled_help_formatter():
TitledHelpFormatter(),
TitledRichHelpFormatter(),
prog="PROG",
description="Descritpion.",
description="Description.",
epilog="Epilog.",
)
parsers.add_option("--option", help="help")
Expand All @@ -287,7 +287,7 @@ def test_titled_help_formatter():
def test_titled_help_formatter_colors():
parser = OptionParser(
prog="PROG",
description="Descritpion.",
description="Description.",
epilog="Epilog.",
formatter=TitledRichHelpFormatter(),
)
Expand All @@ -297,7 +297,7 @@ def test_titled_help_formatter_colors():
\x1b[38;5;208m=====\x1b[0m
PROG [options]

\x1b[39mDescritpion.\x1b[0m
\x1b[39mDescription.\x1b[0m

\x1b[38;5;208mOptions\x1b[0m
\x1b[38;5;208m=======\x1b[0m
Expand Down