Repository navigation
Conversation
SplitAdditionalOptions splits the xcodebuild_options input with POSIX shell rules (go-shellquote's Split, which the steps have always used on it), and ParseAdditionalOptions reads the arguments as xcodebuild does: - every argument is a switch, a flag with a value (-flag value, -flag:value), a user default (-Key=value), a build setting (NAME=value, split at the first "="), or a build action; there is no dictionary of xcodebuild flags, so flags of a newer Xcode work; - a flag takes the next argument as its value unless that is a flag, a NAME=value or an action; a short hint list of flags whose values can look like one (-destination platform=..., -scheme test, -derivedDataPath build) always takes it; - what fits no form is kept verbatim as Unknown with the reason (an empty argument, a flag quoted together with its value, a bare word from an unquoted value with spaces); - parsing round-trips: Args() gives back the arguments it was given. Options.Filter selects by kind, for steps that forward part of the options, such as xcode-archive's build settings and package flags for -showBuildSettings. The builders still append the options verbatim; nothing here changes a command line. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 9, 2026
lpusok
added this pull request to stack #365
October 9, 2026 12:56
lpusok
marked this pull request as ready for review
October 9, 2026 12:57
There was a problem hiding this comment.
🟡 Changes recommended
Unknown-option diagnostics are inaccessible to consumers of the public parsing API.
1 open finding
What changed in this PR
Adds typed parsing and filtering for shell-split xcodebuild_options while preserving argument round-tripping.
Changes:
- Classifies switches, value options, defaults, settings, actions, and unknown arguments.
- Adds filtering, keying, rendering, and comprehensive parser tests.
- Adds
go-shellquotefor POSIX-compatible splitting.
| File | Description |
|---|---|
xcodecommand/xcodebuild.go |
Defines recognized build actions. |
xcodecommand/options.go |
Implements splitting, parsing, classification, and filtering. |
xcodecommand/options_test.go |
Tests parser behavior and round-tripping. |
go.mod |
Adds the shell-splitting dependency. |
go.sum |
Records dependency checksums. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| Kind Kind | ||
| Name string | ||
| Value string | ||
| issue issue // why an Unknown option was not parsed |
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.

SplitAdditionalOptions splits the xcodebuild_options input with POSIX shell rules
(go-shellquote's Split, which the steps have always used on it), and
ParseAdditionalOptions reads the arguments as xcodebuild does:
default (-Key=value), a build setting (NAME=value, split at the first "="), or a build
action; there is no dictionary of xcodebuild flags, so flags of a newer Xcode work;
action; a short hint list of flags whose values can look like one (-destination
platform=..., -scheme test, -derivedDataPath build) always takes it;
quoted together with its value, a bare word from an unquoted value with spaces);
Options.Filter selects by kind, for steps that forward part of the options, such as
xcode-archive's build settings and package flags for -showBuildSettings.
The builders still append the options verbatim; nothing here changes a command line.
🤖 Generated with Claude Code