Commit 91e9908
committed
feat(flags): add Flags.ProcessBase short-flag-free subset of Flags.Process
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).1 parent caff1e9 commit 91e9908
1 file changed
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
33 | 70 | | |
34 | 71 | | |
35 | 72 | | |
| |||
0 commit comments