Repository navigation
Command surface: help, version and argument errors - #40
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mainnow works out which command it was given before any Run starts:The help text replaces the old one-line
usage: thirdshift <Issue URL>. It keeps that string as its first form line, so the existing pre-flight tests pass unchanged. The flag aliases don't appear in the help text or the README.Seams tested: the built binary run as a subprocess (
tests/command_surface.rs), asserting only on stdout, stderr and the exit code.Evidence
thirdshift help→thirdshift: not a GitHub issue URL: help/usage: thirdshift <Issue URL>on stderr, exit 2.thirdshift versionbehaves the same way.After:
tests/command_surface.rs: 7 new tests pass. They cover help and its aliases, the aliases being absent from the help text, version and its aliases, the three argument errors, andupdatenot being available yet.cargo test: everything passes exceptci::waits_for_github_to_work_out_whether_the_pr_is_mergeable. That test also fails 4 times out of 4 onmainon this machine, so this change didn't cause it. It depends on timing and fails under load.Merge Danger
Door: two-way
Blast Radius: CLI
Two things change for scripts that call thirdshift:
helpandversionnow exit 0 instead of 2, and argument errors print more text to stderr. The Run path is unchanged.Unaddressed findings
Standards
maininto a pureCommandparse function. Skipped. The issue asks for tests that run the binary as a subprocess, and a five-arm match doesn't yet need its own module.updatestub is advertised but always fails. Skipped. The issue asks forupdatein the help text and allows the "not yet available" exit 1 until a later ticket.tests/preflight.rsusage tests, which still assert onusage: thirdshift <Issue URL>. Skipped. The issue requires the existing Run tests to pass unchanged, so I didn't edit them. The help text keeps that line on purpose.Spec
usage:prefix. Skipped. Theusage:prefix keeps the existing tests passing unchanged, and one tagline line is harmless.updatealthough it isn't implemented. Skipped. The issue explicitly allows this.not a GitHub issue URL: 7for the bare word7, and it must pass unchanged. One message for every rejected argument is also simpler.usage: thirdshift <Issue URL>pre-flight assertions pass only because the help contains that substring. Skipped. This is deliberate, for the "pass unchanged" criterion.Closes #31
🤖 Generated with Claude Code