summaryrefslogtreecommitdiff
path: root/internal/server/handlers/serverhandler.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-07-02 21:23:00 +0300
committerPaul Buetow <paul@buetow.org>2025-07-02 21:23:00 +0300
commit17ee5e62c2b1037c21cb36f2677d2c538e2542cb (patch)
tree8fbed16de9d7ae13307216551cbdafcd34127bf9 /internal/server/handlers/serverhandler.go
parente7a64c7e338e0d8818425e67650e673240d9b853 (diff)
feat: add server info message for literal grep mode
- Add IsLiteral() and Pattern() methods to regex.Regex struct - Log info message when grep uses optimized literal string matching - Fix bug where grep commands were processed as cat commands - Add comprehensive integration tests to verify literal mode messages This gives users visibility when the performance-optimized literal string matching is being used instead of regex matching. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'internal/server/handlers/serverhandler.go')
-rw-r--r--internal/server/handlers/serverhandler.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/server/handlers/serverhandler.go b/internal/server/handlers/serverhandler.go
index 9163447..da27066 100644
--- a/internal/server/handlers/serverhandler.go
+++ b/internal/server/handlers/serverhandler.go
@@ -74,7 +74,13 @@ func (h *ServerHandler) handleUserCommand(ctx context.Context, ltx lcontext.LCon
}
switch commandName {
- case "grep", "cat":
+ case "grep":
+ command := newReadCommand(h, omode.GrepClient)
+ go func() {
+ command.Start(ctx, ltx, argc, args, 1)
+ commandFinished()
+ }()
+ case "cat":
command := newReadCommand(h, omode.CatClient)
go func() {
command.Start(ctx, ltx, argc, args, 1)