Skip to content

Commit 359a5a8

Browse files
committed
fix(cli): handle bare /md command without trailing space
Typing /md without a space was falling through to chat instead of showing usage. Match the exact "/md" token in addition to "/md ". Signed-off-by: Matt Van Horn <mvanhorn@users.noreply.github.com> Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
1 parent 980339c commit 359a5a8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

crates/goose-cli/src/session/input.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ fn handle_slash_command(input: &str) -> Option<InputResult> {
308308
println!("{}", console::style("⚠️ Note: /summarize has been renamed to /compact and will be removed in a future release.").yellow());
309309
Some(InputResult::Compact)
310310
}
311-
s if s.starts_with("/md ") => {
312-
let path = s.strip_prefix("/md ").unwrap_or("").trim();
311+
s if s == "/md" || s.starts_with("/md ") => {
312+
let path = s.strip_prefix("/md").unwrap_or("").trim();
313313
if path.is_empty() {
314314
println!("Usage: /md <file>");
315315
Some(InputResult::Retry)

0 commit comments

Comments
 (0)