BadScript 2
Loading...
Searching...
No Matches
ParserExtensions.cs
Go to the documentation of this file.
1// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
2
3using System;
4using System.Collections.Generic;
5
6namespace CommandLine
7{
11 public static class ParserExtensions
12 {
33 public static ParserResult<object> ParseArguments<T1, T2>(this Parser parser, IEnumerable<string> args)
34 {
35 if (parser == null)
36 {
37 throw new ArgumentNullException("parser");
38 }
39
40 return parser.ParseArguments(args, typeof(T1), typeof(T2));
41 }
42
64 public static ParserResult<object> ParseArguments<T1, T2, T3>(this Parser parser, IEnumerable<string> args)
65 {
66 if (parser == null)
67 {
68 throw new ArgumentNullException("parser");
69 }
70
71 return parser.ParseArguments(args, typeof(T1), typeof(T2), typeof(T3));
72 }
73
96 public static ParserResult<object> ParseArguments<T1, T2, T3, T4>(this Parser parser, IEnumerable<string> args)
97 {
98 if (parser == null)
99 {
100 throw new ArgumentNullException("parser");
101 }
102
103 return parser.ParseArguments(args, typeof(T1), typeof(T2), typeof(T3), typeof(T4));
104 }
105
130 this Parser parser,
131 IEnumerable<string> args)
132 {
133 if (parser == null)
134 {
135 throw new ArgumentNullException("parser");
136 }
137
138 return parser.ParseArguments(args, typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5));
139 }
140
166 this Parser parser,
167 IEnumerable<string> args)
168 {
169 if (parser == null)
170 {
171 throw new ArgumentNullException("parser");
172 }
173
174 return parser.ParseArguments(args, typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6));
175 }
176
203 this Parser parser,
204 IEnumerable<string> args)
205 {
206 if (parser == null)
207 {
208 throw new ArgumentNullException("parser");
209 }
210
211 return parser.ParseArguments(args,
212 typeof(T1),
213 typeof(T2),
214 typeof(T3),
215 typeof(T4),
216 typeof(T5),
217 typeof(T6),
218 typeof(T7)
219 );
220 }
221
249 this Parser parser,
250 IEnumerable<string> args)
251 {
252 if (parser == null)
253 {
254 throw new ArgumentNullException("parser");
255 }
256
257 return parser.ParseArguments(args,
258 typeof(T1),
259 typeof(T2),
260 typeof(T3),
261 typeof(T4),
262 typeof(T5),
263 typeof(T6),
264 typeof(T7),
265 typeof(T8)
266 );
267 }
268
297 this Parser parser,
298 IEnumerable<string> args)
299 {
300 if (parser == null)
301 {
302 throw new ArgumentNullException("parser");
303 }
304
305 return parser.ParseArguments(args,
306 typeof(T1),
307 typeof(T2),
308 typeof(T3),
309 typeof(T4),
310 typeof(T5),
311 typeof(T6),
312 typeof(T7),
313 typeof(T8),
314 typeof(T9)
315 );
316 }
317
347 this Parser parser,
348 IEnumerable<string> args)
349 {
350 if (parser == null)
351 {
352 throw new ArgumentNullException("parser");
353 }
354
355 return parser.ParseArguments(args,
356 typeof(T1),
357 typeof(T2),
358 typeof(T3),
359 typeof(T4),
360 typeof(T5),
361 typeof(T6),
362 typeof(T7),
363 typeof(T8),
364 typeof(T9),
365 typeof(T10)
366 );
367 }
368
399 this Parser parser,
400 IEnumerable<string> args)
401 {
402 if (parser == null)
403 {
404 throw new ArgumentNullException("parser");
405 }
406
407 return parser.ParseArguments(args,
408 typeof(T1),
409 typeof(T2),
410 typeof(T3),
411 typeof(T4),
412 typeof(T5),
413 typeof(T6),
414 typeof(T7),
415 typeof(T8),
416 typeof(T9),
417 typeof(T10),
418 typeof(T11)
419 );
420 }
421
453 this Parser parser,
454 IEnumerable<string> args)
455 {
456 if (parser == null)
457 {
458 throw new ArgumentNullException("parser");
459 }
460
461 return parser.ParseArguments(args,
462 typeof(T1),
463 typeof(T2),
464 typeof(T3),
465 typeof(T4),
466 typeof(T5),
467 typeof(T6),
468 typeof(T7),
469 typeof(T8),
470 typeof(T9),
471 typeof(T10),
472 typeof(T11),
473 typeof(T12)
474 );
475 }
476
509 this Parser parser,
510 IEnumerable<string> args)
511 {
512 if (parser == null)
513 {
514 throw new ArgumentNullException("parser");
515 }
516
517 return parser.ParseArguments(args,
518 typeof(T1),
519 typeof(T2),
520 typeof(T3),
521 typeof(T4),
522 typeof(T5),
523 typeof(T6),
524 typeof(T7),
525 typeof(T8),
526 typeof(T9),
527 typeof(T10),
528 typeof(T11),
529 typeof(T12),
530 typeof(T13)
531 );
532 }
533
567 this Parser parser,
568 IEnumerable<string> args)
569 {
570 if (parser == null)
571 {
572 throw new ArgumentNullException("parser");
573 }
574
575 return parser.ParseArguments(args,
576 typeof(T1),
577 typeof(T2),
578 typeof(T3),
579 typeof(T4),
580 typeof(T5),
581 typeof(T6),
582 typeof(T7),
583 typeof(T8),
584 typeof(T9),
585 typeof(T10),
586 typeof(T11),
587 typeof(T12),
588 typeof(T13),
589 typeof(T14)
590 );
591 }
592
626 public static ParserResult<object> ParseArguments<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
627 T15>(this Parser parser, IEnumerable<string> args)
628 {
629 if (parser == null)
630 {
631 throw new ArgumentNullException("parser");
632 }
633
634 return parser.ParseArguments(args,
635 typeof(T1),
636 typeof(T2),
637 typeof(T3),
638 typeof(T4),
639 typeof(T5),
640 typeof(T6),
641 typeof(T7),
642 typeof(T8),
643 typeof(T9),
644 typeof(T10),
645 typeof(T11),
646 typeof(T12),
647 typeof(T13),
648 typeof(T14),
649 typeof(T15)
650 );
651 }
652
687 public static ParserResult<object> ParseArguments<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
688 T15, T16>(this Parser parser, IEnumerable<string> args)
689 {
690 if (parser == null)
691 {
692 throw new ArgumentNullException("parser");
693 }
694
695 return parser.ParseArguments(args,
696 typeof(T1),
697 typeof(T2),
698 typeof(T3),
699 typeof(T4),
700 typeof(T5),
701 typeof(T6),
702 typeof(T7),
703 typeof(T8),
704 typeof(T9),
705 typeof(T10),
706 typeof(T11),
707 typeof(T12),
708 typeof(T13),
709 typeof(T14),
710 typeof(T15),
711 typeof(T16)
712 );
713 }
714 }
715}
Defines generic overloads for CommandLine.Parser.ParseArguments(IEnumerable<string>,...
static ParserResult< object > ParseArguments< T1, T2, T3, T4, T5, T6, T7 >(this Parser parser, IEnumerable< string > args)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
static ParserResult< object > ParseArguments< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 >(this Parser parser, IEnumerable< string > args)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
static ParserResult< object > ParseArguments< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 >(this Parser parser, IEnumerable< string > args)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
static ParserResult< object > ParseArguments< T1, T2 >(this Parser parser, IEnumerable< string > args)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
static ParserResult< object > ParseArguments< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 >(this Parser parser, IEnumerable< string > args)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
static ParserResult< object > ParseArguments< T1, T2, T3, T4, T5 >(this Parser parser, IEnumerable< string > args)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
static ParserResult< object > ParseArguments< T1, T2, T3, T4, T5, T6, T7, T8 >(this Parser parser, IEnumerable< string > args)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
static ParserResult< object > ParseArguments< T1, T2, T3 >(this Parser parser, IEnumerable< string > args)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
static ParserResult< object > ParseArguments< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 >(this Parser parser, IEnumerable< string > args)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
static ParserResult< object > ParseArguments< T1, T2, T3, T4, T5, T6, T7, T8, T9 >(this Parser parser, IEnumerable< string > args)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
static ParserResult< object > ParseArguments< T1, T2, T3, T4, T5, T6 >(this Parser parser, IEnumerable< string > args)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
static ParserResult< object > ParseArguments< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 >(this Parser parser, IEnumerable< string > args)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
static ParserResult< object > ParseArguments< T1, T2, T3, T4 >(this Parser parser, IEnumerable< string > args)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
Provides methods to parse command line arguments.
Definition Parser.cs:21
ParserResult< object > ParseArguments(IEnumerable< string > args, params Type[] types)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
Definition Parser.cs:216
Models a parser result. When inherited by CommandLine.Parsed<T>, it contains an instance of type T w...