@@ -146,17 +146,28 @@ Summary Table:
146146
147147## view
148148
149- ** Description:** View details of a specific key across all languages.
149+ ** Description:** View details of a specific key or multiple keys matching a regex pattern across all languages.
150150
151151** Arguments:**
152- - ` <KEY> ` - The key to view (required)
152+ - ` <KEY> ` - The key or regex pattern to view (required)
153153
154154** Options:**
155155- ` -p, --path <PATH> ` - Resource folder path
156+ - ` -c, --config-file <PATH> ` - Path to configuration file
157+ - ` -f, --format <FORMAT> ` - Output format: ` table ` (default), ` json ` , or ` simple `
158+ - ` --regex ` - Treat KEY as a regular expression pattern
156159- ` --show-comments ` - Include comments in output
157- - ` --format <FORMAT> ` - Output format: ` table ` (default), ` json ` , or ` simple `
160+ - ` --limit <COUNT> ` - Maximum number of keys to display (default: 100, 0 for no limit)
161+ - ` --no-limit ` - Show all matches without limit (same as --limit 0)
162+ - ` --sort ` - Sort matched keys alphabetically
163+
164+ ** Modes:**
165+ - ** Exact match (default):** View a single specific key
166+ - ** Regex mode (with --regex):** View all keys matching a pattern
158167
159168** Examples:**
169+
170+ ** Single Key (Exact Match):**
160171``` bash
161172# View key in table format (default)
162173lrm view SaveButton
@@ -171,9 +182,36 @@ lrm view SaveButton --format json
171182lrm view SaveButton --format simple
172183```
173184
185+ ** Multiple Keys (Regex Pattern):**
186+ ``` bash
187+ # View all Error keys
188+ lrm view " Error\..*" --regex
189+
190+ # View all button keys with comments
191+ lrm view " Button\..*" --regex --show-comments
192+
193+ # View numbered items (Item1, Item2, etc.)
194+ lrm view " Item[0-9]+" --regex
195+
196+ # View all keys containing "Validation"
197+ lrm view " .*Validation.*" --regex
198+
199+ # View with sorting
200+ lrm view " Success\..*" --regex --sort
201+
202+ # View all matches (no limit)
203+ lrm view " .*" --regex --no-limit
204+
205+ # Custom limit of 50 matches
206+ lrm view " .*Label.*" --regex --limit 50
207+
208+ # JSON output for automation
209+ lrm view " Error\..*" --regex --format json
210+ ```
211+
174212** Output formats:**
175213
176- ** Table (default ):**
214+ ** Table (single key ):**
177215```
178216Key: SaveButton
179217
@@ -183,9 +221,32 @@ Key: SaveButton
183221│ English │ Save │
184222│ Greek │ Σώσει │
185223└───────────┴────────┘
224+
225+ Present in 2/2 language(s), 0 empty value(s)
186226```
187227
188- ** JSON:**
228+ ** Table (multiple keys with regex):**
229+ ```
230+ Pattern: Error\..*
231+ Matched 3 key(s)
232+
233+ ┌───────────────────┬──────────────┬─────────────────┐
234+ │ Key │ Language │ Value │
235+ ├───────────────────┼──────────────┼─────────────────┤
236+ │ Error.NotFound │ English │ Item not found │
237+ │ │ Greek │ Δεν βρέθηκε │
238+ ├───────────────────┼──────────────┼─────────────────┤
239+ │ Error.Validation │ English │ Invalid │
240+ │ │ Greek │ Άκυρο │
241+ ├───────────────────┼──────────────┼─────────────────┤
242+ │ Error.Unauthorized│ English │ Access denied │
243+ │ │ Greek │ Απαγορεύεται │
244+ └───────────────────┴──────────────┴─────────────────┘
245+
246+ Showing 3 key(s) across 2 language(s)
247+ ```
248+
249+ ** JSON (single key):**
189250``` json
190251{
191252 "key" : " SaveButton" ,
@@ -196,6 +257,68 @@ Key: SaveButton
196257}
197258```
198259
260+ ** JSON (multiple keys with regex):**
261+ ``` json
262+ {
263+ "pattern" : " Error\\ ..*" ,
264+ "matchCount" : 3 ,
265+ "keys" : [
266+ {
267+ "key" : " Error.NotFound" ,
268+ "translations" : {
269+ "default" : " Item not found" ,
270+ "el" : " Δεν βρέθηκε"
271+ }
272+ },
273+ {
274+ "key" : " Error.Validation" ,
275+ "translations" : {
276+ "default" : " Invalid" ,
277+ "el" : " Άκυρο"
278+ }
279+ },
280+ {
281+ "key" : " Error.Unauthorized" ,
282+ "translations" : {
283+ "default" : " Access denied" ,
284+ "el" : " Απαγορεύεται"
285+ }
286+ }
287+ ]
288+ }
289+ ```
290+
291+ ** Simple (multiple keys):**
292+ ```
293+ Pattern: Error\..*
294+ Matched 3 key(s)
295+
296+ --- Error.NotFound ---
297+ English (default): Item not found
298+ Greek: Δεν βρέθηκε
299+
300+ --- Error.Validation ---
301+ English (default): Invalid
302+ Greek: Άκυρο
303+
304+ --- Error.Unauthorized ---
305+ English (default): Access denied
306+ Greek: Απαγορεύεται
307+ ```
308+
309+ ** Safety Features:**
310+ - ** Regex timeout:** 1-second limit prevents ReDoS attacks
311+ - ** Default limit:** Shows first 100 matches to avoid overwhelming output
312+ - ** Invalid pattern detection:** Clear error messages for malformed regex
313+ - ** Backward compatible:** Exact match by default, regex is opt-in
314+
315+ ** Use Cases:**
316+ - ** Namespace exploration:** View all keys in a namespace (e.g., ` Error.* ` )
317+ - ** Pattern discovery:** Find keys by pattern without knowing exact names
318+ - ** Documentation:** Generate translation reports for specific areas
319+ - ** Validation:** Check translations for entire feature groups
320+ - ** CI/CD integration:** Export specific key groups as JSON
321+
199322---
200323
201324## add
0 commit comments