Skip to content

Commit 9909afb

Browse files
committed
Using nicer looking arrow and a named style in 'set' output.
1 parent 9105ed2 commit 9909afb

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

cmd2/cmd2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4009,7 +4009,7 @@ def _build_macro_create_parser(cls) -> Cmd2ArgumentParser:
40094009
"When the macro is called, the provided arguments are resolved and the assembled command is run. For example:",
40104010
"\n\n",
40114011
(" my_macro beef broccoli", Cmd2Style.COMMAND_LINE),
4012-
(" ───> ", Style(bold=True)),
4012+
(" ─> ", Style(bold=True)),
40134013
("make_dinner --meat beef --veggie broccoli", Cmd2Style.COMMAND_LINE),
40144014
)
40154015
macro_create_parser = argparse_utils.DEFAULT_ARGUMENT_PARSER(description=macro_create_description)
@@ -4724,8 +4724,8 @@ def do_set(self, args: argparse.Namespace) -> None:
47244724
else:
47254725
# Create the feedback message using Rich Text for color
47264726
feedback_msg = Text.assemble(
4727-
f"{args.param} -> ",
4728-
(f"{settable.value!r}", "green"),
4727+
f"{args.param} > ",
4728+
(f"{settable.value!r}", Cmd2Style.SUCCESS),
47294729
)
47304730
self.pfeedback(feedback_msg)
47314731

tests/test_cmd2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def test_set_with_choices(base_app) -> None:
281281
assert base_app.last_result is True
282282
assert not err
283283
assert out[0].startswith("fake")
284-
assert out[0].endswith(f"-> {fake_choices[1]!r}")
284+
assert out[0].endswith(f"> {fake_choices[1]!r}")
285285

286286
# Try an invalid choice
287287
_out, err = run_cmd(base_app, "set fake bad_value")
@@ -857,7 +857,7 @@ def test_allow_clipboard(base_app) -> None:
857857
def test_base_timing(base_app) -> None:
858858
out, err = run_cmd(base_app, "set timing True")
859859
assert out[0].startswith("timing")
860-
assert out[0].endswith("-> True")
860+
assert out[0].endswith("> True")
861861

862862
if sys.platform == "win32":
863863
assert err[0].startswith("Elapsed: 0:00:00")
@@ -878,7 +878,7 @@ def test_base_debug(base_app) -> None:
878878
out, err = run_cmd(base_app, "set debug True")
879879
assert not err
880880
assert out[0].startswith("debug")
881-
assert out[0].endswith("-> True")
881+
assert out[0].endswith("> True")
882882

883883
# Verify that we now see the exception traceback
884884
out, err = run_cmd(base_app, "edit")

tests/test_commandset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ def __init__(self) -> None:
11051105
out, err = run_cmd(app, "set arbitrary_value 10")
11061106
assert not err
11071107
assert out[0].startswith("arbitrary_value")
1108-
assert out[0].endswith("-> 10")
1108+
assert out[0].endswith("> 10")
11091109
out, err = run_cmd(app, "set arbitrary_value")
11101110
any("arbitrary_value" in line and "10" in line for line in out)
11111111

0 commit comments

Comments
 (0)