Skip to content

fix(cli): validate invocations and route Cobra output through term.W - #23

Merged
Rasalas merged 1 commit into
mainfrom
fix/review-cli-validation
Sep 26, 2026
Merged

Rasalas merged 1 commit into
mainfrom
fix/review-cli-validation

Conversation

@Rasalas

@Rasalas Rasalas commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Invalid flags returned runtime-error exit code 1, and unexpected positional arguments could silently create a tag. Cobra help and version output also bypassed the configured terminal writer.

Classify flag and positional-argument errors as configuration errors with exit code 2. Reject extra arguments before Git operations for bump, status, and suggest. Resolve term.W for every Cobra output write so swapping the writer captures help and version output. Runtime failures still exit with code 1.

Closes #10
Closes #11
Closes #17

Validation: regression tests failed on the original implementation and now pass. Subprocess tests check actual exit codes, argument tests assert no Git operations, and output tests replace term.W repeatedly. go test ./..., go vet ./..., and golangci-lint v2.13.0 pass.

@Rasalas
Rasalas merged commit 0c647f0 into main Sep 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant