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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +11 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lystbot",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "LystBot CLI - Manage your lists from the terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
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: split on commas, trim, flatten
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 => i.split(','))
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