This repository was archived by the owner on Jul 17, 2025. It is now read-only.
Commit ccfa066
committed
Improve handling of errors while cmdline parsing
Depending on the commandline formatting, there was a case where this
resulted in an endless loop in processing the command line. Errors were
printed using the `error!` macro, that used the logger functionality
before it was setup.
We introduce an error return value for parsing the commandline. It
returns an error whenever there was something wrong with the command
line that could lead to a misconfiguration of the runtime parameters.
For that we have two error values:
- InvalidCmdLineOptions indicating the command line parsed fine, but
the selected option are not supported
- MalformedCmdLine indicating that there were issues with parsing the
commandline that would have led to skipped arguments.
Signed-off-by: Reto Achermann <achreto@gmail.com>1 parent dd84480 commit ccfa066
3 files changed
+33
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
| |||
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
279 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
280 | 288 | | |
281 | 289 | | |
282 | 290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
151 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
152 | 155 | | |
153 | 156 | | |
154 | 157 | | |
| |||
217 | 220 | | |
218 | 221 | | |
219 | 222 | | |
220 | | - | |
221 | | - | |
| 223 | + | |
| 224 | + | |
222 | 225 | | |
223 | 226 | | |
224 | 227 | | |
| |||
230 | 233 | | |
231 | 234 | | |
232 | 235 | | |
233 | | - | |
234 | | - | |
| 236 | + | |
| 237 | + | |
235 | 238 | | |
236 | 239 | | |
237 | 240 | | |
| |||
268 | 271 | | |
269 | 272 | | |
270 | 273 | | |
271 | | - | |
| 274 | + | |
272 | 275 | | |
273 | 276 | | |
274 | 277 | | |
275 | 278 | | |
276 | 279 | | |
277 | | - | |
278 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
279 | 286 | | |
280 | 287 | | |
281 | 288 | | |
282 | 289 | | |
283 | 290 | | |
284 | 291 | | |
285 | 292 | | |
286 | | - | |
| 293 | + | |
| 294 | + | |
287 | 295 | | |
288 | 296 | | |
289 | 297 | | |
290 | 298 | | |
291 | 299 | | |
292 | 300 | | |
293 | | - | |
| 301 | + | |
294 | 302 | | |
295 | 303 | | |
| 304 | + | |
296 | 305 | | |
297 | 306 | | |
298 | 307 | | |
299 | | - | |
| 308 | + | |
300 | 309 | | |
301 | 310 | | |
302 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
| |||
0 commit comments