Skip to content

Commit

Permalink
Colorize by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef-Friedrich committed Feb 5, 2024
1 parent 8cb2b0d commit a82d5bc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions mscxyz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ def _split_lines(self, text: typing.Text, width: int) -> typing.List[str]:

info_group.add_argument(
"-k",
"--colorize",
action="store_true",
dest="general_colorize",
"--color",
action=argparse.BooleanOptionalAction,
dest="general_color",
default=True,
help="Colorize the command line print statements.",
)

Expand Down
2 changes: 1 addition & 1 deletion mscxyz/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DefaultArguments:
general_mscore: bool = False
general_executable: Optional[str] = None
general_verbose: int = 0
general_colorize: bool = False
general_color: bool = True
general_diff: bool = False
general_print_xml: bool = False

Expand Down
2 changes: 1 addition & 1 deletion mscxyz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def colorize(
color('“{}”'.format(post[field]), 'yellow')
"""
settings = get_args()
if settings.general_colorize:
if settings.general_color:
return termcolor.colored(text, color, on_color)
else:
return text
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TestArgparse:
def test_args_general(self) -> None:
args = parser.parse_args(["."])
assert args.general_backup is False
assert args.general_colorize is False
assert args.general_color is True
assert args.general_dry_run is False
assert args.selection_glob == "*.msc[xz]"
assert args.general_mscore is False
Expand Down

0 comments on commit a82d5bc

Please sign in to comment.