Commit ca79df3
fix: validate -s/--start flag and error on unparseable values (#259)
* fix: validate --start flag input and error on unparseable values
Previously, passing an invalid string to -s/--start (e.g. a typo or
free-form text) would silently fall back to NOW via chrono-node's
parseDate returning null. The command would then proceed as if no start
time was specified.
Now the argParser throws a CommanderError with a clear message when the
input cannot be parsed as a date.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix error message
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 101ad1e commit ca79df3
1 file changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
330 | 329 | | |
331 | 330 | | |
332 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
333 | 344 | | |
334 | 345 | | |
335 | 346 | | |
336 | 347 | | |
337 | | - | |
| 348 | + | |
338 | 349 | | |
339 | 350 | | |
340 | 351 | | |
| |||
0 commit comments