Commit 1bc03fe
authored
Move most of the built in middlewares out of middleware (#2043)
* move HelpOption out of middleware
* move environment variable directive out of middleware
* move parse directive out of middleware
* add a tests for combinding [perse] with --help and --version
* move suggest directive out of middleware
* move parse error reporting out of middleware
* report parsing errors as soon as unmatched token is found
* move typo corrections out of middleware
* make TypoCorrection a static class as all it needs is inside InvocationContext
* move exception handling out of middleware
* make internal properties fields to avoid method JITting
* reduce the number of fields
* provide default exit codes in explicit way1 parent 7030070 commit 1bc03fe
File tree
18 files changed
+312
-277
lines changed- src
- System.CommandLine.ApiCompatibility.Tests
- System.CommandLine.Hosting.Tests
- System.CommandLine.Tests
- System.CommandLine
- Builder
- Help
- Invocation
- Parsing
18 files changed
+312
-277
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
| 86 | + | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
49 | 99 | | |
50 | 100 | | |
51 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
17 | 44 | | |
18 | 45 | | |
19 | 46 | | |
| |||
33 | 60 | | |
34 | 61 | | |
35 | 62 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | 63 | | |
50 | 64 | | |
51 | 65 | | |
| |||
68 | 82 | | |
69 | 83 | | |
70 | 84 | | |
71 | | - | |
| 85 | + | |
72 | 86 | | |
73 | | - | |
| 87 | + | |
74 | 88 | | |
75 | | - | |
| 89 | + | |
76 | 90 | | |
77 | 91 | | |
78 | 92 | | |
79 | 93 | | |
80 | 94 | | |
81 | 95 | | |
82 | 96 | | |
83 | | - | |
| 97 | + | |
84 | 98 | | |
85 | 99 | | |
86 | 100 | | |
| |||
92 | 106 | | |
93 | 107 | | |
94 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
95 | 115 | | |
96 | 116 | | |
97 | 117 | | |
| |||
Lines changed: 15 additions & 119 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
230 | 229 | | |
231 | 230 | | |
232 | 231 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 232 | + | |
254 | 233 | | |
255 | 234 | | |
256 | 235 | | |
| |||
302 | 281 | | |
303 | 282 | | |
304 | 283 | | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
| 284 | + | |
316 | 285 | | |
317 | 286 | | |
318 | 287 | | |
| |||
397 | 366 | | |
398 | 367 | | |
399 | 368 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | 369 | | |
409 | 370 | | |
410 | 371 | | |
| |||
475 | 436 | | |
476 | 437 | | |
477 | 438 | | |
478 | | - | |
| 439 | + | |
479 | 440 | | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
| 441 | + | |
491 | 442 | | |
492 | 443 | | |
493 | 444 | | |
| |||
500 | 451 | | |
501 | 452 | | |
502 | 453 | | |
503 | | - | |
| 454 | + | |
504 | 455 | | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
| 456 | + | |
516 | 457 | | |
517 | 458 | | |
518 | 459 | | |
| |||
526 | 467 | | |
527 | 468 | | |
528 | 469 | | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
| 470 | + | |
551 | 471 | | |
552 | 472 | | |
553 | 473 | | |
| |||
562 | 482 | | |
563 | 483 | | |
564 | 484 | | |
565 | | - | |
| 485 | + | |
566 | 486 | | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
| 487 | + | |
| 488 | + | |
571 | 489 | | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
| 490 | + | |
576 | 491 | | |
577 | 492 | | |
578 | 493 | | |
| |||
619 | 534 | | |
620 | 535 | | |
621 | 536 | | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
| 537 | + | |
| 538 | + | |
626 | 539 | | |
627 | 540 | | |
628 | 541 | | |
| |||
634 | 547 | | |
635 | 548 | | |
636 | 549 | | |
637 | | - | |
638 | | - | |
639 | 550 | | |
640 | 551 | | |
641 | 552 | | |
642 | 553 | | |
643 | 554 | | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
| 555 | + | |
| 556 | + | |
648 | 557 | | |
649 | 558 | | |
650 | 559 | | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | 560 | | |
665 | 561 | | |
0 commit comments