You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Switches the `-c`/`--command` flag from `StringSlice` to `StringArray` to prevent splitting commands on commas, ensuring single quoted commands (e.g., PowerShell `Select-Object`) are preserved as intended. Updates CLI, tests, documentation, and version to v1.2.2; adds release notes and improves robustness for Windows shell usage.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,13 @@
3
3
4
4
All notable changes to this project will be documented in this file.
5
5
6
+
## v1.2.2 - 2026-01-17
7
+
8
+
- Bugfix: Preserve comma-containing commands passed via a single `-c` flag (e.g., PowerShell `Select-Object` usage such as `Get-ComputerInfo | Select-Object OsName, OsVersion, OsArchitecture`). The CLI no longer splits a single `-c` value on commas — instead we use repeatable `-c` flags (`StringArray`) and ensure a single quoted `-c` is preserved literally.
9
+
- Internal: Switch `-c` command flags from `StringSlice` (which splits on commas) to `StringArray` to avoid unintended splitting; update retrieval functions accordingly and add unit tests to validate behavior.
10
+
- Tests: Add `TestSaveCommand_PreservesCommasInFlag` and update save-related tests to be robust across Windows-style inputs and quoting edge cases.
11
+
- Docs: Update `docs/cli.md` and add release notes for v1.2.2 describing the change and upgrade guidance.
12
+
6
13
## v1.2.1 - 2026-01-17
7
14
8
15
- CLI: **save** — Enhanced the `krnr save` command to better handle shell quoting mistakes by joining or merging split command arguments (e.g., when shells split embedded quotes) and heuristically reinserting `/C:"pattern"` quoting for common `findstr` usages. Adds robust argument splitting via `github.com/kballard/go-shellquote` and new unit tests.
Patch release focusing on a robustness fix for the `save` command.
4
+
5
+
What’s changed
6
+
7
+
- Preserve comma-containing commands passed via a single `-c` flag (PowerShell `Select-Object` usage). A single quoted `-c` will now be stored as a single command and is no longer split on commas.
8
+
- Internal: switched the repeatable command flag to `StringArray` to avoid unintended splitting and added tests to cover the behavior.
9
+
10
+
Upgrade notes
11
+
12
+
- No DB schema changes are required.
13
+
- When using Windows shells, prefer quoting `-c` values fully (e.g., `-c 'Get-ComputerInfo | Select-Object OsName, OsVersion, OsArchitecture'`) to avoid shell-level tokenization issues.
14
+
15
+
Thanks to contributors and maintainers for quick turnaround on this fix.
Copy file name to clipboardExpand all lines: docs/cli.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Author metadata:
16
16
-`--author-email` (`-e`) optionally sets the author email.
17
17
- If `--author` is not provided, `krnr save` will use the stored `whoami` identity if present.
18
18
19
-
Quoting & save behavior: The `save` command (v1.2.1) is more tolerant of common shell quoting mistakes. When leftover tokens are detected (for example, when shells split quoted arguments), `save` will join leftover tokens into a single `-c` command or merge them into an existing single `-c` value when appropriate. For simple `findstr /C:` patterns it will attempt to reinsert expected quotes so the saved command better matches user intent. Prefer providing command values as a single quoted `-c` when possible; see `docs/releases/v1.2.1.md` for details.
19
+
Quoting & save behavior: The `save` command (v1.2.2) is more tolerant of common shell quoting mistakes. When leftover tokens are detected (for example, when shells split quoted arguments), `save` will join leftover tokens into a single `-c` command or merge them into an existing single `-c` value when appropriate. For simple `findstr /C:` patterns it will attempt to reinsert expected quotes so the saved command better matches user intent. Prefer providing command values as a single quoted `-c` when possible; see `docs/releases/v1.2.2.md` for details.
This patch release fixes a subtle behavior where comma-containing commands (common in PowerShell cmdlets like `Select-Object`) could be split into multiple saved commands when supplied via a single `-c` flag. The CLI now preserves a single quoted `-c` value exactly (it no longer splits on commas).
4
+
5
+
Highlights
6
+
7
+
- Fix: Preserve comma-containing `-c` values (e.g., `Get-ComputerInfo | Select-Object OsName, OsVersion, OsArchitecture`) as a single saved command.
8
+
- Internal: Use `StringArray` for the repeatable `-c`/`--command` flag to avoid unintended comma splitting caused by `StringSlice`.
9
+
- Tests: Added unit tests to assert preservation of comma-containing commands and improved save-related tests to be robust to shell tokenization edge cases.
10
+
- Docs: Updated `docs/cli.md` and `CHANGELOG.md` to document the fix and provide upgrade guidance.
11
+
12
+
Upgrade guidance: Simply upgrade to v1.2.2; no DB schema changes are required. When using Windows shells, prefer quoting `-c` values fully (e.g., `-c 'Get-ComputerInfo | Select-Object OsName, OsVersion, OsArchitecture'`) to avoid any shell-level splitting. If you rely on previously-split behavior, re-save the affected command sets after upgrading.
0 commit comments