feat(flags): add Flags.ProcessBase short-flag-free subset of Flags.Process (CHAOS-1324)#12
Open
chrisgeo wants to merge 1 commit into
Open
feat(flags): add Flags.ProcessBase short-flag-free subset of Flags.Process (CHAOS-1324)#12chrisgeo wants to merge 1 commit into
chrisgeo wants to merge 1 commit into
Conversation
28d98b7 to
91e9908
Compare
…ocess
Adds a new public 'Flags.ProcessBase' struct alongside the existing
'Flags.Process'. ProcessBase is a minimal subset that does NOT claim
the common short flags (-e, -u, -w, -i, -t), so downstream tools that
wrap 'container' can @OptionGroup ProcessBase without colliding on
those names.
Motivation
----------
Tools like 'compose run' and 'compose exec' need to expose their own
'-e KEY=VALUE' / '-u USER' / '-w DIR' UX (the docker-compose
convention) but currently can't @OptionGroup Flags.Process because
swift-argument-parser hits a parse-time clash on the short flags.
The compose tooling's workaround is to declare verbose '--run-env',
'--run-user', '--run-workdir' aliases that nobody types willingly.
Adding ProcessBase upstream lets those wrappers inherit the safe
long-form options (--cwd, --env-file) while reclaiming the short
flags for their own subcommand-specific UX.
What this PR changes
--------------------
- Sources/Services/ContainerAPIService/Client/Flags.swift: a new public
struct 'Flags.ProcessBase' with two fields ('cwd: String?',
'envFile: [String]'), declared with the same long-form @option
attributes as the matching fields on 'Flags.Process'. No short
flags. Existing 'Flags.Process' is unchanged.
Total: 1 file, +37/-0.
Wire compatibility
------------------
Pure additive — 'Flags.Process' is unchanged. Existing callers see no
diff; new callers can opt into ProcessBase explicitly.
Verification
------------
Full 'swift build' clean on macOS 26 / Apple silicon (release config,
all targets).
91e9908 to
28cd619
Compare
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.
Staging branch — fork-internal review before any apple/container upstream filing.
Linear: CHAOS-1324
Type of Change
Motivation and Context
Tools like
compose runandcompose execneed to expose their own-e KEY=VALUE/-u USER/-w DIRUX (the docker-compose convention) but can't@OptionGroupFlags.Processbecause swift-argument-parser hits a parse-time clash on those short flags (Flags.Processregisters-e,-u,-w,-i,-t).The current downstream workaround is verbose
--run-env/--run-user/--run-workdiraliases that nobody types willingly. AddingFlags.ProcessBaseupstream lets wrapping tools inherit the safe long-form options (--cwd,--env-file) while reclaiming the short flags for their own subcommand-specific UX.What this PR changes
Sources/Services/ContainerAPIService/Client/Flags.swift: a new public structFlags.ProcessBasewith two fields (cwd: String?,envFile: [String]), declared with the same long-form@Optionattributes as the matching fields onFlags.Process. No short flags. ExistingFlags.Processis unchanged.Total: 1 file, +37/−0.
Wire compatibility
Pure additive.
Flags.Processis byte-for-byte unchanged. Existing callers see no diff; new callers can opt intoProcessBaseexplicitly.Testing
swift buildclean on macOS 26 / Apple silicon, all targets).swift-argument-parserregistration. Happy to add a parse-positive / parse-negative test if desired.Flags.Process.Status
Draft, fork-staged. Routing to
full-chaos/container:mainfirst so we can review the surface internally before opening the apple/container companion issue + upstream PR (same pattern as CHAOS-1319 / CHAOS-1320).