Skip to content

fix(cli): deltix log -n <repo> works regardless of flag order - #47

Merged
SammyBytes merged 1 commit into
mainfrom
fix/log-flags-before-repo
Aug 31, 2026
Merged

fix(cli): deltix log -n <repo> works regardless of flag order#47
SammyBytes merged 1 commit into
mainfrom
fix/log-flags-before-repo

Conversation

@SammyBytes

Copy link
Copy Markdown
Owner

The previous destructuring const [repoArg, ...flags] = args in runLog assumed the first arg was always the repo name. When the user typed deltix log -n 5 hmc-sync, -n became repoArg and the command failed with Repo not found: -n.

Added a splitPositionalsAndFlags helper that separates any arg starting with - (and its value) from positional args, so flags can appear before or after the repo name — same behavior as git log -n 5 <branch>.

  • 8 new unit tests for the helper
  • 128 tests pass, lint clean

The previous destructuring `const [repoArg, ...flags] = args` in runLog
assumed the first arg was always the repo name. When the user typed
`deltix log -n 5 hmc-sync`, '-n' became repoArg and the command failed
with 'Repo not found: -n'.

Added a splitPositionalsAndFlags helper that separates any arg starting
with '-' (and its value) from positional args, so flags can appear
before or after the repo name — same behavior as git log -n 5 <branch>.

8 new unit tests for the helper; 128 tests pass; lint clean.
@SammyBytes
SammyBytes merged commit aae1bb3 into main Aug 31, 2026
2 checks passed
@SammyBytes
SammyBytes deleted the fix/log-flags-before-repo branch August 31, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant