-
Notifications
You must be signed in to change notification settings - Fork 53
Fix --show flag rejected as unknown in rodney start#43
Merged
Merged
Conversation
The first flag-parsing loop in cmdStart only recognized --insecure/-k, causing --show to hit the default case and exit with "unknown flag" error. The second loop that handled --show was unreachable. Extract flag parsing into testable parseStartArgs function that handles all flags (--show, --insecure, -k) in a single pass. Add tests covering each flag individually, combined flags, and unknown flag rejection. https://claude.ai/code/session_019dG8c5MD6DibdiFCXcSq7C
Port 6 functions to use Go's standard flag package: - parseStartArgs: --show, --insecure/-k - cmdReload: --hard - cmdScreenshot: -w/--width, -h/--height + positional filename - cmdAXTree: --depth, --json - cmdAXFind: --name, --role, --json - cmdAXNode: --json + positional selector (hybrid pre-extraction) Leave parseAssertArgs and extractScopeArgs as-is because their flags-anywhere-in-the-arg-list semantics are incompatible with flag.Parse which stops at the first non-flag argument. Add findUnknownFlag helper for backward-compatible error messages. https://claude.ai/code/session_019dG8c5MD6DibdiFCXcSq7C
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.
Uh oh!
There was an error while loading. Please reload this page.
The first flag-parsing loop in cmdStart only recognized --insecure/-k,
causing --show to hit the default case and exit with "unknown flag" error.
The second loop that handled --show was unreachable.
Extract flag parsing into testable parseStartArgs function that handles
all flags (--show, --insecure, -k) in a single pass. Add tests covering
each flag individually, combined flags, and unknown flag rejection.
https://claude.ai/code/session_019dG8c5MD6DibdiFCXcSq7C