You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/chat-cli/src/cli/chat/command.rs
+22-3Lines changed: 22 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -187,7 +187,8 @@ impl ContextSubcommand {
187
187
<em>help</em> <black!>Show an explanation for the context command</black!>
188
188
189
189
<em>show [--expand]</em> <black!>Display the context rule configuration and matched files</black!>
190
-
<black!>--expand: Print out each matched file's content</black!>
190
+
<black!>--expand: Print out each matched file's content, hook</black!>
191
+
<black!> configurations and last conversation summary </black!>
191
192
192
193
<em>add [--global] [--force] <<paths...>></em>
193
194
<black!>Add context rules (filenames or glob patterns)</black!>
@@ -836,8 +837,26 @@ impl Command {
836
837
}
837
838
Self::Export{ path, force }
838
839
},
839
-
_unknown_command => Self::Ask{
840
-
prompt: input.to_string(),
840
+
unknown_command => {
841
+
let looks_like_path = {
842
+
let after_slash_command_str = parts[1..].join(" ");
843
+
unknown_command.contains('/')
844
+
|| unknown_command.contains('.')
845
+
|| unknown_command.contains('\\')
846
+
|| after_slash_command_str.contains('/')
847
+
|| after_slash_command_str.contains('.')
848
+
|| after_slash_command_str.contains('\\')
849
+
};
850
+
if looks_like_path {
851
+
returnOk(Self::Ask{
852
+
prompt: command.to_string(),
853
+
});
854
+
}
855
+
856
+
returnErr(format!(
857
+
"Unknown command: '/{}'. Type '/help' to see available commands.\nTo use a literal slash at the beginning of your message, escape it with a backslash (e.g., '\\//hey' for '/hey').",
0 commit comments