mirror of
https://github.com/NCBM/plyngent.git
synced 2026-07-23 05:55:16 +08:00
core/cli: fix /help command usage line and help Tab completion
Use a standalone Click context so /help compact shows Usage: /compact, not nested under help. Complete /help <cmd> from the slash registry.
This commit is contained in:
@@ -96,6 +96,14 @@ async def test_help_and_clear(state: ReplState) -> None:
|
||||
assert state.agent.messages == []
|
||||
|
||||
|
||||
async def test_help_command_usage_line(state: ReplState, capsys: pytest.CaptureFixture[str]) -> None:
|
||||
assert await handle_slash(state, "/help compact") is True
|
||||
out = capsys.readouterr().out
|
||||
assert "Usage: /compact" in out
|
||||
assert "help [COMMAND] compact" not in out
|
||||
assert "Soft-compact" in out
|
||||
|
||||
|
||||
async def test_quit(state: ReplState) -> None:
|
||||
assert await handle_slash(state, "/quit") is False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user