Skip to content

Commit 62c9f01

Browse files
committed
Improve eca_grep summary
1 parent 8eb55cb commit 62c9f01

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/eca/features/tools/filesystem.clj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@
202202

203203
(defn grep-summary [args]
204204
(if-let [pattern (get args "pattern")]
205-
(format "Searching for '%s'" pattern)
205+
(if (> (count pattern) 22)
206+
(format "Searching for '%s...'" (subs pattern 0 22))
207+
(format "Searching for '%s'" pattern))
206208
"Searching for files"))
207209

208210
(defn ^:private handle-file-change-result
@@ -217,8 +219,8 @@
217219

218220
(= (:error result) :ambiguous)
219221
(tools.util/single-text-content
220-
(format "Ambiguous match - content appears %d times in %s. Provide more specific context to identify the exact location."
221-
(:match-count result) path) :error)
222+
(format "Ambiguous match - content appears %d times in %s. Provide more specific context to identify the exact location."
223+
(:match-count result) path) :error)
222224

223225
:else
224226
(tools.util/single-text-content (format "Failed to process %s" path) :error)))

0 commit comments

Comments
 (0)