From 0d23ad7a152751a1176289f7d4ed3a5f94ae49e3 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Sat, 14 Mar 2026 10:35:14 -0700 Subject: [PATCH] fix: cover remaining config placeholder help text Update the unknown-subcommand config help output to use placeholder syntax too, and extend the placeholder regression tests to cover show_config() and that fallback help path. --- hermes_cli/config.py | 2 +- tests/hermes_cli/test_placeholder_usage.py | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/hermes_cli/config.py b/hermes_cli/config.py index 249ae52b4..7a932d9e4 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -1506,7 +1506,7 @@ def config_command(args): print("Available commands:") print(" hermes config Show current configuration") print(" hermes config edit Open config in editor") - print(" hermes config set K V Set a config value") + print(" hermes config set Set a config value") print(" hermes config check Check for missing/outdated config") print(" hermes config migrate Update config with new options") print(" hermes config path Show config file path") diff --git a/tests/hermes_cli/test_placeholder_usage.py b/tests/hermes_cli/test_placeholder_usage.py index ab5234800..3479d8f57 100644 --- a/tests/hermes_cli/test_placeholder_usage.py +++ b/tests/hermes_cli/test_placeholder_usage.py @@ -6,7 +6,7 @@ from unittest.mock import patch import pytest -from hermes_cli.config import config_command +from hermes_cli.config import config_command, show_config from hermes_cli.setup import _print_setup_summary @@ -21,6 +21,25 @@ def test_config_set_usage_marks_placeholders(capsys): assert "Usage: hermes config set " in out +def test_config_unknown_command_help_marks_placeholders(capsys): + args = Namespace(config_command="wat") + + with pytest.raises(SystemExit) as exc: + config_command(args) + + assert exc.value.code == 1 + out = capsys.readouterr().out + assert "hermes config set Set a config value" in out + + +def test_show_config_marks_placeholders(tmp_path, capsys): + with patch.dict(os.environ, {"HERMES_HOME": str(tmp_path)}): + show_config() + + out = capsys.readouterr().out + assert "hermes config set " in out + + def test_setup_summary_marks_placeholders(tmp_path, capsys): with patch.dict(os.environ, {"HERMES_HOME": str(tmp_path)}): _print_setup_summary({"tts": {"provider": "edge"}}, tmp_path)