lystbot 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +11 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -201,9 +201,18 @@ program
|
|
|
201
201
|
.action(async (listQuery, rawItems) => {
|
|
202
202
|
config.getApiKey();
|
|
203
203
|
|
|
204
|
-
// Smart parsing:
|
|
204
|
+
// Smart parsing: each CLI argument is one item.
|
|
205
|
+
// Within a single argument, split on ", " (comma+space) for batch input.
|
|
206
|
+
// To include a literal comma+space in an item, use semicolons as separator instead.
|
|
207
|
+
// e.g. "Milch; Eier; Brot" or "Käse, Wurst, Senf" both work as batch.
|
|
208
|
+
// Single item with comma: pass as separate arg without comma+space pattern.
|
|
205
209
|
const items = rawItems
|
|
206
|
-
.flatMap(i =>
|
|
210
|
+
.flatMap(i => {
|
|
211
|
+
// If argument contains semicolons, use those as separators (commas stay literal)
|
|
212
|
+
if (i.includes(';')) return i.split(';');
|
|
213
|
+
// Otherwise split on ", " (comma followed by space)
|
|
214
|
+
return i.split(', ');
|
|
215
|
+
})
|
|
207
216
|
.map(i => i.trim())
|
|
208
217
|
.filter(Boolean);
|
|
209
218
|
|