Commit b1f31a3
authored
Fix containerOptions --opt=value parsing for AWS Batch (nextflow-io#5190) (nextflow-io#7288)
`CmdLineHelper.parseGnuArgs` classified the GNU long-option form
`--opt=value` as a bare boolean flag: the CLI_OPT regex swallowed the
`=value` suffix as opaque trailing text via `(?:\W.*)?$`, so the value
was lost and the option defaulted to `'true'`. On AWS Batch this made
`containerOptions '--shm-size=1000000000'` fail at task submission with
`For input string: "true"` when AwsContainerOptionsMapper cast the
value to Integer.
Change CLI_OPT to explicitly capture an optional inline `=value` per
alternative and have parseGnuArgs use the captured value immediately
(mirroring the space-separated logic). The value is checked for
truthiness so quoted forms like `-a='b -1'` keep falling back to the
next token, preserving existing behavior.
Add regression tests in CmdLineHelperTest and AwsContainerOptionsMapperTest.
Signed-off-by: Ben Sherman <bentshermann@gmail.com>1 parent 37984dd commit b1f31a3
3 files changed
Lines changed: 26 additions & 2 deletions
File tree
- modules/nf-commons/src
- main/nextflow/util
- test/nextflow/util
- plugins/nf-amazon/src/test/nextflow/cloud/aws/batch
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
132 | 142 | | |
133 | 143 | | |
134 | 144 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
139 | 148 | | |
140 | 149 | | |
141 | 150 | | |
| |||
0 commit comments