Commit 2daf9a1
ArgParser: support positional args inside union cases
Removes the last restriction of the positional-args-with-unions plan:
a [<PositionalArgs>] field may now live inside a union case's payload
record, so each alternative can convert the positional stream at its
own field's type. Two sinks in mutually exclusive cases may share
their addressing forms (a keyed --rest token means the same thing
whichever case wins); a form still may not collide with any named
argument. Generation rejects only what is genuinely unsound: two sinks
in one product (argv holds a single positional stream), Collect-mode
sinks anywhere a union is in play (a mistyped case-selecting argument
would be silently collected), and unprovable flag-like settings.
Selection remains purely structural, before any conversion: named
arguments select cases; a keyed positional form unique to one
alternative selects it structurally; bare tokens never select (except
that a sink present in only one case makes bare tokens pin that case);
and parseability at some case's element type never influences the
choice. Help renders each case's positional args inside its group.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent e4b89d7 commit 2daf9a1
8 files changed
Lines changed: 834 additions & 50 deletions
File tree
- ConsumePlugin
- WoofWare.Myriad.Plugins.Test
- TestArgParser
- WoofWare.Myriad.Plugins
- Test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
0 commit comments