Commit bb7422a
fix(cli): Allow '=' as key-value separator for tags and extra flags (#1285)
Previously, the `parseKeyValue` function in
`src/lib/envelope/event-builder.ts` only recognized the `KEY:VALUE`
format, splitting exclusively on the first colon (`:`). This led to
`ValidationError` when users or AI agents provided key-value pairs using
the common `KEY=VALUE` format (e.g., `--tag component=app`).
This change updates `parseKeyValue` to correctly identify and split on
the first occurrence of either a colon (`:`) or an equals sign (`=`),
whichever appears first and is not at the beginning of the string. This
ensures that both `KEY:VALUE` and `KEY=VALUE` formats are accepted,
improving flexibility and aligning with common CLI conventions, while
preserving any subsequent separators within the value part.
Fixes
[CLI-21G](https://sentry.sentry.io/issues/7554746770/?seerDrawer=true)
<sub>Comment `@sentry <feedback>` on this PR to have Autofix iterate on
the changes.</sub>
---------
Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
Co-authored-by: jared-outpost[bot] <jared-outpost[bot]@users.noreply.github.com>1 parent cce4d63 commit bb7422a
2 files changed
Lines changed: 24 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | | - | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
38 | 55 | | |
39 | 56 | | |
40 | 57 | | |
| |||
0 commit comments