BadScript 2
Loading...
Searching...
No Matches
CommandLine.ParserResultExtensions Class Reference

Provides convenience extension methods for CommandLine.ParserResult<T>. More...

Static Public Member Functions

static ParserResult< T > WithParsed< T > (this ParserResult< T > result, Action< T > action)
 Executes action if CommandLine.ParserResult<T> contains parsed values.
 
static ParserResult< object > WithParsed< T > (this ParserResult< object > result, Action< T > action)
 Executes action if parsed values are of T .
 
static ParserResult< T > WithNotParsed< T > (this ParserResult< T > result, Action< IEnumerable< Error > > action)
 Executes action if CommandLine.ParserResult<T> lacks parsed values and contains errors.
 
static TResult MapResult< TSource, TResult > (this ParserResult< TSource > result, Func< TSource, TResult > parsedFunc, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, T4, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< T4, TResult > parsedFunc4, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, T4, T5, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< T4, TResult > parsedFunc4, Func< T5, TResult > parsedFunc5, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, T4, T5, T6, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< T4, TResult > parsedFunc4, Func< T5, TResult > parsedFunc5, Func< T6, TResult > parsedFunc6, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, T4, T5, T6, T7, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< T4, TResult > parsedFunc4, Func< T5, TResult > parsedFunc5, Func< T6, TResult > parsedFunc6, Func< T7, TResult > parsedFunc7, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, T4, T5, T6, T7, T8, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< T4, TResult > parsedFunc4, Func< T5, TResult > parsedFunc5, Func< T6, TResult > parsedFunc6, Func< T7, TResult > parsedFunc7, Func< T8, TResult > parsedFunc8, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< T4, TResult > parsedFunc4, Func< T5, TResult > parsedFunc5, Func< T6, TResult > parsedFunc6, Func< T7, TResult > parsedFunc7, Func< T8, TResult > parsedFunc8, Func< T9, TResult > parsedFunc9, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< T4, TResult > parsedFunc4, Func< T5, TResult > parsedFunc5, Func< T6, TResult > parsedFunc6, Func< T7, TResult > parsedFunc7, Func< T8, TResult > parsedFunc8, Func< T9, TResult > parsedFunc9, Func< T10, TResult > parsedFunc10, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< T4, TResult > parsedFunc4, Func< T5, TResult > parsedFunc5, Func< T6, TResult > parsedFunc6, Func< T7, TResult > parsedFunc7, Func< T8, TResult > parsedFunc8, Func< T9, TResult > parsedFunc9, Func< T10, TResult > parsedFunc10, Func< T11, TResult > parsedFunc11, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< T4, TResult > parsedFunc4, Func< T5, TResult > parsedFunc5, Func< T6, TResult > parsedFunc6, Func< T7, TResult > parsedFunc7, Func< T8, TResult > parsedFunc8, Func< T9, TResult > parsedFunc9, Func< T10, TResult > parsedFunc10, Func< T11, TResult > parsedFunc11, Func< T12, TResult > parsedFunc12, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< T4, TResult > parsedFunc4, Func< T5, TResult > parsedFunc5, Func< T6, TResult > parsedFunc6, Func< T7, TResult > parsedFunc7, Func< T8, TResult > parsedFunc8, Func< T9, TResult > parsedFunc9, Func< T10, TResult > parsedFunc10, Func< T11, TResult > parsedFunc11, Func< T12, TResult > parsedFunc12, Func< T13, TResult > parsedFunc13, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< T4, TResult > parsedFunc4, Func< T5, TResult > parsedFunc5, Func< T6, TResult > parsedFunc6, Func< T7, TResult > parsedFunc7, Func< T8, TResult > parsedFunc8, Func< T9, TResult > parsedFunc9, Func< T10, TResult > parsedFunc10, Func< T11, TResult > parsedFunc11, Func< T12, TResult > parsedFunc12, Func< T13, TResult > parsedFunc13, Func< T14, TResult > parsedFunc14, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< T4, TResult > parsedFunc4, Func< T5, TResult > parsedFunc5, Func< T6, TResult > parsedFunc6, Func< T7, TResult > parsedFunc7, Func< T8, TResult > parsedFunc8, Func< T9, TResult > parsedFunc9, Func< T10, TResult > parsedFunc10, Func< T11, TResult > parsedFunc11, Func< T12, TResult > parsedFunc12, Func< T13, TResult > parsedFunc13, Func< T14, TResult > parsedFunc14, Func< T15, TResult > parsedFunc15, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static TResult MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult > (this ParserResult< object > result, Func< T1, TResult > parsedFunc1, Func< T2, TResult > parsedFunc2, Func< T3, TResult > parsedFunc3, Func< T4, TResult > parsedFunc4, Func< T5, TResult > parsedFunc5, Func< T6, TResult > parsedFunc6, Func< T7, TResult > parsedFunc7, Func< T8, TResult > parsedFunc8, Func< T9, TResult > parsedFunc9, Func< T10, TResult > parsedFunc10, Func< T11, TResult > parsedFunc11, Func< T12, TResult > parsedFunc12, Func< T13, TResult > parsedFunc13, Func< T14, TResult > parsedFunc14, Func< T15, TResult > parsedFunc15, Func< T16, TResult > parsedFunc16, Func< IEnumerable< Error >, TResult > notParsedFunc)
 Provides a way to transform result data into another value.
 
static async Task< ParserResult< T > > WithParsedAsync< T > (this ParserResult< T > result, Func< T, Task > action)
 Executes asynchronously action if CommandLine.ParserResult<T> contains parsed values.
 
static async Task< ParserResult< object > > WithParsedAsync< T > (this ParserResult< object > result, Func< T, Task > action)
 Executes asynchronously action if parsed values are of T .
 
static async Task< ParserResult< T > > WithNotParsedAsync< T > (this ParserResult< T > result, Func< IEnumerable< Error >, Task > action)
 Executes asynchronously action if CommandLine.ParserResult<T> lacks parsed values and contains errors.
 

Detailed Description

Provides convenience extension methods for CommandLine.ParserResult<T>.

Definition at line 11 of file ParserResultExtensions.cs.

Member Function Documentation

◆ MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< T4, TResult >  parsedFunc4,
Func< T5, TResult >  parsedFunc5,
Func< T6, TResult >  parsedFunc6,
Func< T7, TResult >  parsedFunc7,
Func< T8, TResult >  parsedFunc8,
Func< T9, TResult >  parsedFunc9,
Func< T10, TResult >  parsedFunc10,
Func< T11, TResult >  parsedFunc11,
Func< T12, TResult >  parsedFunc12,
Func< T13, TResult >  parsedFunc13,
Func< T14, TResult >  parsedFunc14,
Func< T15, TResult >  parsedFunc15,
Func< T16, TResult >  parsedFunc16,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
T4Fourth verb type.
T5Fifth verb type.
T6Sixth verb type.
T7Seventh verb type.
T8Eighth verb type.
T9Ninth verb type.
T10Tenth verb type.
T11Eleventh verb type.
T12Twelfth verb type.
T13Thirteenth verb type.
T14Fourteenth verb type.
T15Fifteenth verb type.
T16Sixteenth verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
parsedFunc4Lambda executed on successful parsing of T4 .
parsedFunc5Lambda executed on successful parsing of T5 .
parsedFunc6Lambda executed on successful parsing of T6 .
parsedFunc7Lambda executed on successful parsing of T7 .
parsedFunc8Lambda executed on successful parsing of T8 .
parsedFunc9Lambda executed on successful parsing of T9 .
parsedFunc10Lambda executed on successful parsing of T10 .
parsedFunc11Lambda executed on successful parsing of T11 .
parsedFunc12Lambda executed on successful parsing of T12 .
parsedFunc13Lambda executed on successful parsing of T13 .
parsedFunc14Lambda executed on successful parsing of T14 .
parsedFunc15Lambda executed on successful parsing of T15 .
parsedFunc16Lambda executed on successful parsing of T16 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 1405 of file ParserResultExtensions.cs.

1424 {
1425 Parsed<object> parsed = result as Parsed<object>;
1426
1427 if (parsed != null)
1428 {
1429 if (parsed.Value is T1)
1430 {
1431 return parsedFunc1((T1)parsed.Value);
1432 }
1433
1434 if (parsed.Value is T2)
1435 {
1436 return parsedFunc2((T2)parsed.Value);
1437 }
1438
1439 if (parsed.Value is T3)
1440 {
1441 return parsedFunc3((T3)parsed.Value);
1442 }
1443
1444 if (parsed.Value is T4)
1445 {
1446 return parsedFunc4((T4)parsed.Value);
1447 }
1448
1449 if (parsed.Value is T5)
1450 {
1451 return parsedFunc5((T5)parsed.Value);
1452 }
1453
1454 if (parsed.Value is T6)
1455 {
1456 return parsedFunc6((T6)parsed.Value);
1457 }
1458
1459 if (parsed.Value is T7)
1460 {
1461 return parsedFunc7((T7)parsed.Value);
1462 }
1463
1464 if (parsed.Value is T8)
1465 {
1466 return parsedFunc8((T8)parsed.Value);
1467 }
1468
1469 if (parsed.Value is T9)
1470 {
1471 return parsedFunc9((T9)parsed.Value);
1472 }
1473
1474 if (parsed.Value is T10)
1475 {
1476 return parsedFunc10((T10)parsed.Value);
1477 }
1478
1479 if (parsed.Value is T11)
1480 {
1481 return parsedFunc11((T11)parsed.Value);
1482 }
1483
1484 if (parsed.Value is T12)
1485 {
1486 return parsedFunc12((T12)parsed.Value);
1487 }
1488
1489 if (parsed.Value is T13)
1490 {
1491 return parsedFunc13((T13)parsed.Value);
1492 }
1493
1494 if (parsed.Value is T14)
1495 {
1496 return parsedFunc14((T14)parsed.Value);
1497 }
1498
1499 if (parsed.Value is T15)
1500 {
1501 return parsedFunc15((T15)parsed.Value);
1502 }
1503
1504 if (parsed.Value is T16)
1505 {
1506 return parsedFunc16((T16)parsed.Value);
1507 }
1508
1509 throw new InvalidOperationException();
1510 }
1511
1512 return notParsedFunc(((NotParsed<object>)result).Errors);
1513 }

◆ MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< T4, TResult >  parsedFunc4,
Func< T5, TResult >  parsedFunc5,
Func< T6, TResult >  parsedFunc6,
Func< T7, TResult >  parsedFunc7,
Func< T8, TResult >  parsedFunc8,
Func< T9, TResult >  parsedFunc9,
Func< T10, TResult >  parsedFunc10,
Func< T11, TResult >  parsedFunc11,
Func< T12, TResult >  parsedFunc12,
Func< T13, TResult >  parsedFunc13,
Func< T14, TResult >  parsedFunc14,
Func< T15, TResult >  parsedFunc15,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
T4Fourth verb type.
T5Fifth verb type.
T6Sixth verb type.
T7Seventh verb type.
T8Eighth verb type.
T9Ninth verb type.
T10Tenth verb type.
T11Eleventh verb type.
T12Twelfth verb type.
T13Thirteenth verb type.
T14Fourteenth verb type.
T15Fifteenth verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
parsedFunc4Lambda executed on successful parsing of T4 .
parsedFunc5Lambda executed on successful parsing of T5 .
parsedFunc6Lambda executed on successful parsing of T6 .
parsedFunc7Lambda executed on successful parsing of T7 .
parsedFunc8Lambda executed on successful parsing of T8 .
parsedFunc9Lambda executed on successful parsing of T9 .
parsedFunc10Lambda executed on successful parsing of T10 .
parsedFunc11Lambda executed on successful parsing of T11 .
parsedFunc12Lambda executed on successful parsing of T12 .
parsedFunc13Lambda executed on successful parsing of T13 .
parsedFunc14Lambda executed on successful parsing of T14 .
parsedFunc15Lambda executed on successful parsing of T15 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 1262 of file ParserResultExtensions.cs.

1280 {
1281 Parsed<object> parsed = result as Parsed<object>;
1282
1283 if (parsed != null)
1284 {
1285 if (parsed.Value is T1)
1286 {
1287 return parsedFunc1((T1)parsed.Value);
1288 }
1289
1290 if (parsed.Value is T2)
1291 {
1292 return parsedFunc2((T2)parsed.Value);
1293 }
1294
1295 if (parsed.Value is T3)
1296 {
1297 return parsedFunc3((T3)parsed.Value);
1298 }
1299
1300 if (parsed.Value is T4)
1301 {
1302 return parsedFunc4((T4)parsed.Value);
1303 }
1304
1305 if (parsed.Value is T5)
1306 {
1307 return parsedFunc5((T5)parsed.Value);
1308 }
1309
1310 if (parsed.Value is T6)
1311 {
1312 return parsedFunc6((T6)parsed.Value);
1313 }
1314
1315 if (parsed.Value is T7)
1316 {
1317 return parsedFunc7((T7)parsed.Value);
1318 }
1319
1320 if (parsed.Value is T8)
1321 {
1322 return parsedFunc8((T8)parsed.Value);
1323 }
1324
1325 if (parsed.Value is T9)
1326 {
1327 return parsedFunc9((T9)parsed.Value);
1328 }
1329
1330 if (parsed.Value is T10)
1331 {
1332 return parsedFunc10((T10)parsed.Value);
1333 }
1334
1335 if (parsed.Value is T11)
1336 {
1337 return parsedFunc11((T11)parsed.Value);
1338 }
1339
1340 if (parsed.Value is T12)
1341 {
1342 return parsedFunc12((T12)parsed.Value);
1343 }
1344
1345 if (parsed.Value is T13)
1346 {
1347 return parsedFunc13((T13)parsed.Value);
1348 }
1349
1350 if (parsed.Value is T14)
1351 {
1352 return parsedFunc14((T14)parsed.Value);
1353 }
1354
1355 if (parsed.Value is T15)
1356 {
1357 return parsedFunc15((T15)parsed.Value);
1358 }
1359
1360 throw new InvalidOperationException();
1361 }
1362
1363 return notParsedFunc(((NotParsed<object>)result).Errors);
1364 }

◆ MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< T4, TResult >  parsedFunc4,
Func< T5, TResult >  parsedFunc5,
Func< T6, TResult >  parsedFunc6,
Func< T7, TResult >  parsedFunc7,
Func< T8, TResult >  parsedFunc8,
Func< T9, TResult >  parsedFunc9,
Func< T10, TResult >  parsedFunc10,
Func< T11, TResult >  parsedFunc11,
Func< T12, TResult >  parsedFunc12,
Func< T13, TResult >  parsedFunc13,
Func< T14, TResult >  parsedFunc14,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
T4Fourth verb type.
T5Fifth verb type.
T6Sixth verb type.
T7Seventh verb type.
T8Eighth verb type.
T9Ninth verb type.
T10Tenth verb type.
T11Eleventh verb type.
T12Twelfth verb type.
T13Thirteenth verb type.
T14Fourteenth verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
parsedFunc4Lambda executed on successful parsing of T4 .
parsedFunc5Lambda executed on successful parsing of T5 .
parsedFunc6Lambda executed on successful parsing of T6 .
parsedFunc7Lambda executed on successful parsing of T7 .
parsedFunc8Lambda executed on successful parsing of T8 .
parsedFunc9Lambda executed on successful parsing of T9 .
parsedFunc10Lambda executed on successful parsing of T10 .
parsedFunc11Lambda executed on successful parsing of T11 .
parsedFunc12Lambda executed on successful parsing of T12 .
parsedFunc13Lambda executed on successful parsing of T13 .
parsedFunc14Lambda executed on successful parsing of T14 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 1127 of file ParserResultExtensions.cs.

1144 {
1145 Parsed<object> parsed = result as Parsed<object>;
1146
1147 if (parsed != null)
1148 {
1149 if (parsed.Value is T1)
1150 {
1151 return parsedFunc1((T1)parsed.Value);
1152 }
1153
1154 if (parsed.Value is T2)
1155 {
1156 return parsedFunc2((T2)parsed.Value);
1157 }
1158
1159 if (parsed.Value is T3)
1160 {
1161 return parsedFunc3((T3)parsed.Value);
1162 }
1163
1164 if (parsed.Value is T4)
1165 {
1166 return parsedFunc4((T4)parsed.Value);
1167 }
1168
1169 if (parsed.Value is T5)
1170 {
1171 return parsedFunc5((T5)parsed.Value);
1172 }
1173
1174 if (parsed.Value is T6)
1175 {
1176 return parsedFunc6((T6)parsed.Value);
1177 }
1178
1179 if (parsed.Value is T7)
1180 {
1181 return parsedFunc7((T7)parsed.Value);
1182 }
1183
1184 if (parsed.Value is T8)
1185 {
1186 return parsedFunc8((T8)parsed.Value);
1187 }
1188
1189 if (parsed.Value is T9)
1190 {
1191 return parsedFunc9((T9)parsed.Value);
1192 }
1193
1194 if (parsed.Value is T10)
1195 {
1196 return parsedFunc10((T10)parsed.Value);
1197 }
1198
1199 if (parsed.Value is T11)
1200 {
1201 return parsedFunc11((T11)parsed.Value);
1202 }
1203
1204 if (parsed.Value is T12)
1205 {
1206 return parsedFunc12((T12)parsed.Value);
1207 }
1208
1209 if (parsed.Value is T13)
1210 {
1211 return parsedFunc13((T13)parsed.Value);
1212 }
1213
1214 if (parsed.Value is T14)
1215 {
1216 return parsedFunc14((T14)parsed.Value);
1217 }
1218
1219 throw new InvalidOperationException();
1220 }
1221
1222 return notParsedFunc(((NotParsed<object>)result).Errors);
1223 }

◆ MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< T4, TResult >  parsedFunc4,
Func< T5, TResult >  parsedFunc5,
Func< T6, TResult >  parsedFunc6,
Func< T7, TResult >  parsedFunc7,
Func< T8, TResult >  parsedFunc8,
Func< T9, TResult >  parsedFunc9,
Func< T10, TResult >  parsedFunc10,
Func< T11, TResult >  parsedFunc11,
Func< T12, TResult >  parsedFunc12,
Func< T13, TResult >  parsedFunc13,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
T4Fourth verb type.
T5Fifth verb type.
T6Sixth verb type.
T7Seventh verb type.
T8Eighth verb type.
T9Ninth verb type.
T10Tenth verb type.
T11Eleventh verb type.
T12Twelfth verb type.
T13Thirteenth verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
parsedFunc4Lambda executed on successful parsing of T4 .
parsedFunc5Lambda executed on successful parsing of T5 .
parsedFunc6Lambda executed on successful parsing of T6 .
parsedFunc7Lambda executed on successful parsing of T7 .
parsedFunc8Lambda executed on successful parsing of T8 .
parsedFunc9Lambda executed on successful parsing of T9 .
parsedFunc10Lambda executed on successful parsing of T10 .
parsedFunc11Lambda executed on successful parsing of T11 .
parsedFunc12Lambda executed on successful parsing of T12 .
parsedFunc13Lambda executed on successful parsing of T13 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 1000 of file ParserResultExtensions.cs.

1016 {
1017 Parsed<object> parsed = result as Parsed<object>;
1018
1019 if (parsed != null)
1020 {
1021 if (parsed.Value is T1)
1022 {
1023 return parsedFunc1((T1)parsed.Value);
1024 }
1025
1026 if (parsed.Value is T2)
1027 {
1028 return parsedFunc2((T2)parsed.Value);
1029 }
1030
1031 if (parsed.Value is T3)
1032 {
1033 return parsedFunc3((T3)parsed.Value);
1034 }
1035
1036 if (parsed.Value is T4)
1037 {
1038 return parsedFunc4((T4)parsed.Value);
1039 }
1040
1041 if (parsed.Value is T5)
1042 {
1043 return parsedFunc5((T5)parsed.Value);
1044 }
1045
1046 if (parsed.Value is T6)
1047 {
1048 return parsedFunc6((T6)parsed.Value);
1049 }
1050
1051 if (parsed.Value is T7)
1052 {
1053 return parsedFunc7((T7)parsed.Value);
1054 }
1055
1056 if (parsed.Value is T8)
1057 {
1058 return parsedFunc8((T8)parsed.Value);
1059 }
1060
1061 if (parsed.Value is T9)
1062 {
1063 return parsedFunc9((T9)parsed.Value);
1064 }
1065
1066 if (parsed.Value is T10)
1067 {
1068 return parsedFunc10((T10)parsed.Value);
1069 }
1070
1071 if (parsed.Value is T11)
1072 {
1073 return parsedFunc11((T11)parsed.Value);
1074 }
1075
1076 if (parsed.Value is T12)
1077 {
1078 return parsedFunc12((T12)parsed.Value);
1079 }
1080
1081 if (parsed.Value is T13)
1082 {
1083 return parsedFunc13((T13)parsed.Value);
1084 }
1085
1086 throw new InvalidOperationException();
1087 }
1088
1089 return notParsedFunc(((NotParsed<object>)result).Errors);
1090 }

◆ MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< T4, TResult >  parsedFunc4,
Func< T5, TResult >  parsedFunc5,
Func< T6, TResult >  parsedFunc6,
Func< T7, TResult >  parsedFunc7,
Func< T8, TResult >  parsedFunc8,
Func< T9, TResult >  parsedFunc9,
Func< T10, TResult >  parsedFunc10,
Func< T11, TResult >  parsedFunc11,
Func< T12, TResult >  parsedFunc12,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
T4Fourth verb type.
T5Fifth verb type.
T6Sixth verb type.
T7Seventh verb type.
T8Eighth verb type.
T9Ninth verb type.
T10Tenth verb type.
T11Eleventh verb type.
T12Twelfth verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
parsedFunc4Lambda executed on successful parsing of T4 .
parsedFunc5Lambda executed on successful parsing of T5 .
parsedFunc6Lambda executed on successful parsing of T6 .
parsedFunc7Lambda executed on successful parsing of T7 .
parsedFunc8Lambda executed on successful parsing of T8 .
parsedFunc9Lambda executed on successful parsing of T9 .
parsedFunc10Lambda executed on successful parsing of T10 .
parsedFunc11Lambda executed on successful parsing of T11 .
parsedFunc12Lambda executed on successful parsing of T12 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 881 of file ParserResultExtensions.cs.

896 {
897 Parsed<object> parsed = result as Parsed<object>;
898
899 if (parsed != null)
900 {
901 if (parsed.Value is T1)
902 {
903 return parsedFunc1((T1)parsed.Value);
904 }
905
906 if (parsed.Value is T2)
907 {
908 return parsedFunc2((T2)parsed.Value);
909 }
910
911 if (parsed.Value is T3)
912 {
913 return parsedFunc3((T3)parsed.Value);
914 }
915
916 if (parsed.Value is T4)
917 {
918 return parsedFunc4((T4)parsed.Value);
919 }
920
921 if (parsed.Value is T5)
922 {
923 return parsedFunc5((T5)parsed.Value);
924 }
925
926 if (parsed.Value is T6)
927 {
928 return parsedFunc6((T6)parsed.Value);
929 }
930
931 if (parsed.Value is T7)
932 {
933 return parsedFunc7((T7)parsed.Value);
934 }
935
936 if (parsed.Value is T8)
937 {
938 return parsedFunc8((T8)parsed.Value);
939 }
940
941 if (parsed.Value is T9)
942 {
943 return parsedFunc9((T9)parsed.Value);
944 }
945
946 if (parsed.Value is T10)
947 {
948 return parsedFunc10((T10)parsed.Value);
949 }
950
951 if (parsed.Value is T11)
952 {
953 return parsedFunc11((T11)parsed.Value);
954 }
955
956 if (parsed.Value is T12)
957 {
958 return parsedFunc12((T12)parsed.Value);
959 }
960
961 throw new InvalidOperationException();
962 }
963
964 return notParsedFunc(((NotParsed<object>)result).Errors);
965 }

◆ MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< T4, TResult >  parsedFunc4,
Func< T5, TResult >  parsedFunc5,
Func< T6, TResult >  parsedFunc6,
Func< T7, TResult >  parsedFunc7,
Func< T8, TResult >  parsedFunc8,
Func< T9, TResult >  parsedFunc9,
Func< T10, TResult >  parsedFunc10,
Func< T11, TResult >  parsedFunc11,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
T4Fourth verb type.
T5Fifth verb type.
T6Sixth verb type.
T7Seventh verb type.
T8Eighth verb type.
T9Ninth verb type.
T10Tenth verb type.
T11Eleventh verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
parsedFunc4Lambda executed on successful parsing of T4 .
parsedFunc5Lambda executed on successful parsing of T5 .
parsedFunc6Lambda executed on successful parsing of T6 .
parsedFunc7Lambda executed on successful parsing of T7 .
parsedFunc8Lambda executed on successful parsing of T8 .
parsedFunc9Lambda executed on successful parsing of T9 .
parsedFunc10Lambda executed on successful parsing of T10 .
parsedFunc11Lambda executed on successful parsing of T11 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 770 of file ParserResultExtensions.cs.

784 {
785 Parsed<object> parsed = result as Parsed<object>;
786
787 if (parsed != null)
788 {
789 if (parsed.Value is T1)
790 {
791 return parsedFunc1((T1)parsed.Value);
792 }
793
794 if (parsed.Value is T2)
795 {
796 return parsedFunc2((T2)parsed.Value);
797 }
798
799 if (parsed.Value is T3)
800 {
801 return parsedFunc3((T3)parsed.Value);
802 }
803
804 if (parsed.Value is T4)
805 {
806 return parsedFunc4((T4)parsed.Value);
807 }
808
809 if (parsed.Value is T5)
810 {
811 return parsedFunc5((T5)parsed.Value);
812 }
813
814 if (parsed.Value is T6)
815 {
816 return parsedFunc6((T6)parsed.Value);
817 }
818
819 if (parsed.Value is T7)
820 {
821 return parsedFunc7((T7)parsed.Value);
822 }
823
824 if (parsed.Value is T8)
825 {
826 return parsedFunc8((T8)parsed.Value);
827 }
828
829 if (parsed.Value is T9)
830 {
831 return parsedFunc9((T9)parsed.Value);
832 }
833
834 if (parsed.Value is T10)
835 {
836 return parsedFunc10((T10)parsed.Value);
837 }
838
839 if (parsed.Value is T11)
840 {
841 return parsedFunc11((T11)parsed.Value);
842 }
843
844 throw new InvalidOperationException();
845 }
846
847 return notParsedFunc(((NotParsed<object>)result).Errors);
848 }

◆ MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< T4, TResult >  parsedFunc4,
Func< T5, TResult >  parsedFunc5,
Func< T6, TResult >  parsedFunc6,
Func< T7, TResult >  parsedFunc7,
Func< T8, TResult >  parsedFunc8,
Func< T9, TResult >  parsedFunc9,
Func< T10, TResult >  parsedFunc10,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
T4Fourth verb type.
T5Fifth verb type.
T6Sixth verb type.
T7Seventh verb type.
T8Eighth verb type.
T9Ninth verb type.
T10Tenth verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
parsedFunc4Lambda executed on successful parsing of T4 .
parsedFunc5Lambda executed on successful parsing of T5 .
parsedFunc6Lambda executed on successful parsing of T6 .
parsedFunc7Lambda executed on successful parsing of T7 .
parsedFunc8Lambda executed on successful parsing of T8 .
parsedFunc9Lambda executed on successful parsing of T9 .
parsedFunc10Lambda executed on successful parsing of T10 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 667 of file ParserResultExtensions.cs.

680 {
681 Parsed<object> parsed = result as Parsed<object>;
682
683 if (parsed != null)
684 {
685 if (parsed.Value is T1)
686 {
687 return parsedFunc1((T1)parsed.Value);
688 }
689
690 if (parsed.Value is T2)
691 {
692 return parsedFunc2((T2)parsed.Value);
693 }
694
695 if (parsed.Value is T3)
696 {
697 return parsedFunc3((T3)parsed.Value);
698 }
699
700 if (parsed.Value is T4)
701 {
702 return parsedFunc4((T4)parsed.Value);
703 }
704
705 if (parsed.Value is T5)
706 {
707 return parsedFunc5((T5)parsed.Value);
708 }
709
710 if (parsed.Value is T6)
711 {
712 return parsedFunc6((T6)parsed.Value);
713 }
714
715 if (parsed.Value is T7)
716 {
717 return parsedFunc7((T7)parsed.Value);
718 }
719
720 if (parsed.Value is T8)
721 {
722 return parsedFunc8((T8)parsed.Value);
723 }
724
725 if (parsed.Value is T9)
726 {
727 return parsedFunc9((T9)parsed.Value);
728 }
729
730 if (parsed.Value is T10)
731 {
732 return parsedFunc10((T10)parsed.Value);
733 }
734
735 throw new InvalidOperationException();
736 }
737
738 return notParsedFunc(((NotParsed<object>)result).Errors);
739 }

◆ MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< T4, TResult >  parsedFunc4,
Func< T5, TResult >  parsedFunc5,
Func< T6, TResult >  parsedFunc6,
Func< T7, TResult >  parsedFunc7,
Func< T8, TResult >  parsedFunc8,
Func< T9, TResult >  parsedFunc9,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
T4Fourth verb type.
T5Fifth verb type.
T6Sixth verb type.
T7Seventh verb type.
T8Eighth verb type.
T9Ninth verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
parsedFunc4Lambda executed on successful parsing of T4 .
parsedFunc5Lambda executed on successful parsing of T5 .
parsedFunc6Lambda executed on successful parsing of T6 .
parsedFunc7Lambda executed on successful parsing of T7 .
parsedFunc8Lambda executed on successful parsing of T8 .
parsedFunc9Lambda executed on successful parsing of T9 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 573 of file ParserResultExtensions.cs.

584 {
585 Parsed<object> parsed = result as Parsed<object>;
586
587 if (parsed != null)
588 {
589 if (parsed.Value is T1)
590 {
591 return parsedFunc1((T1)parsed.Value);
592 }
593
594 if (parsed.Value is T2)
595 {
596 return parsedFunc2((T2)parsed.Value);
597 }
598
599 if (parsed.Value is T3)
600 {
601 return parsedFunc3((T3)parsed.Value);
602 }
603
604 if (parsed.Value is T4)
605 {
606 return parsedFunc4((T4)parsed.Value);
607 }
608
609 if (parsed.Value is T5)
610 {
611 return parsedFunc5((T5)parsed.Value);
612 }
613
614 if (parsed.Value is T6)
615 {
616 return parsedFunc6((T6)parsed.Value);
617 }
618
619 if (parsed.Value is T7)
620 {
621 return parsedFunc7((T7)parsed.Value);
622 }
623
624 if (parsed.Value is T8)
625 {
626 return parsedFunc8((T8)parsed.Value);
627 }
628
629 if (parsed.Value is T9)
630 {
631 return parsedFunc9((T9)parsed.Value);
632 }
633
634 throw new InvalidOperationException();
635 }
636
637 return notParsedFunc(((NotParsed<object>)result).Errors);
638 }

◆ MapResult< T1, T2, T3, T4, T5, T6, T7, T8, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, T4, T5, T6, T7, T8, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< T4, TResult >  parsedFunc4,
Func< T5, TResult >  parsedFunc5,
Func< T6, TResult >  parsedFunc6,
Func< T7, TResult >  parsedFunc7,
Func< T8, TResult >  parsedFunc8,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
T4Fourth verb type.
T5Fifth verb type.
T6Sixth verb type.
T7Seventh verb type.
T8Eighth verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
parsedFunc4Lambda executed on successful parsing of T4 .
parsedFunc5Lambda executed on successful parsing of T5 .
parsedFunc6Lambda executed on successful parsing of T6 .
parsedFunc7Lambda executed on successful parsing of T7 .
parsedFunc8Lambda executed on successful parsing of T8 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 487 of file ParserResultExtensions.cs.

497 {
498 Parsed<object> parsed = result as Parsed<object>;
499
500 if (parsed != null)
501 {
502 if (parsed.Value is T1)
503 {
504 return parsedFunc1((T1)parsed.Value);
505 }
506
507 if (parsed.Value is T2)
508 {
509 return parsedFunc2((T2)parsed.Value);
510 }
511
512 if (parsed.Value is T3)
513 {
514 return parsedFunc3((T3)parsed.Value);
515 }
516
517 if (parsed.Value is T4)
518 {
519 return parsedFunc4((T4)parsed.Value);
520 }
521
522 if (parsed.Value is T5)
523 {
524 return parsedFunc5((T5)parsed.Value);
525 }
526
527 if (parsed.Value is T6)
528 {
529 return parsedFunc6((T6)parsed.Value);
530 }
531
532 if (parsed.Value is T7)
533 {
534 return parsedFunc7((T7)parsed.Value);
535 }
536
537 if (parsed.Value is T8)
538 {
539 return parsedFunc8((T8)parsed.Value);
540 }
541
542 throw new InvalidOperationException();
543 }
544
545 return notParsedFunc(((NotParsed<object>)result).Errors);
546 }

◆ MapResult< T1, T2, T3, T4, T5, T6, T7, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, T4, T5, T6, T7, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< T4, TResult >  parsedFunc4,
Func< T5, TResult >  parsedFunc5,
Func< T6, TResult >  parsedFunc6,
Func< T7, TResult >  parsedFunc7,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
T4Fourth verb type.
T5Fifth verb type.
T6Sixth verb type.
T7Seventh verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
parsedFunc4Lambda executed on successful parsing of T4 .
parsedFunc5Lambda executed on successful parsing of T5 .
parsedFunc6Lambda executed on successful parsing of T6 .
parsedFunc7Lambda executed on successful parsing of T7 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 408 of file ParserResultExtensions.cs.

418 {
419 Parsed<object> parsed = result as Parsed<object>;
420
421 if (parsed != null)
422 {
423 if (parsed.Value is T1)
424 {
425 return parsedFunc1((T1)parsed.Value);
426 }
427
428 if (parsed.Value is T2)
429 {
430 return parsedFunc2((T2)parsed.Value);
431 }
432
433 if (parsed.Value is T3)
434 {
435 return parsedFunc3((T3)parsed.Value);
436 }
437
438 if (parsed.Value is T4)
439 {
440 return parsedFunc4((T4)parsed.Value);
441 }
442
443 if (parsed.Value is T5)
444 {
445 return parsedFunc5((T5)parsed.Value);
446 }
447
448 if (parsed.Value is T6)
449 {
450 return parsedFunc6((T6)parsed.Value);
451 }
452
453 if (parsed.Value is T7)
454 {
455 return parsedFunc7((T7)parsed.Value);
456 }
457
458 throw new InvalidOperationException();
459 }
460
461 return notParsedFunc(((NotParsed<object>)result).Errors);
462 }

◆ MapResult< T1, T2, T3, T4, T5, T6, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, T4, T5, T6, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< T4, TResult >  parsedFunc4,
Func< T5, TResult >  parsedFunc5,
Func< T6, TResult >  parsedFunc6,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
T4Fourth verb type.
T5Fifth verb type.
T6Sixth verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
parsedFunc4Lambda executed on successful parsing of T4 .
parsedFunc5Lambda executed on successful parsing of T5 .
parsedFunc6Lambda executed on successful parsing of T6 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 337 of file ParserResultExtensions.cs.

346 {
347 Parsed<object> parsed = result as Parsed<object>;
348
349 if (parsed != null)
350 {
351 if (parsed.Value is T1)
352 {
353 return parsedFunc1((T1)parsed.Value);
354 }
355
356 if (parsed.Value is T2)
357 {
358 return parsedFunc2((T2)parsed.Value);
359 }
360
361 if (parsed.Value is T3)
362 {
363 return parsedFunc3((T3)parsed.Value);
364 }
365
366 if (parsed.Value is T4)
367 {
368 return parsedFunc4((T4)parsed.Value);
369 }
370
371 if (parsed.Value is T5)
372 {
373 return parsedFunc5((T5)parsed.Value);
374 }
375
376 if (parsed.Value is T6)
377 {
378 return parsedFunc6((T6)parsed.Value);
379 }
380
381 throw new InvalidOperationException();
382 }
383
384 return notParsedFunc(((NotParsed<object>)result).Errors);
385 }

◆ MapResult< T1, T2, T3, T4, T5, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, T4, T5, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< T4, TResult >  parsedFunc4,
Func< T5, TResult >  parsedFunc5,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
T4Fourth verb type.
T5Fifth verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
parsedFunc4Lambda executed on successful parsing of T4 .
parsedFunc5Lambda executed on successful parsing of T5 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 275 of file ParserResultExtensions.cs.

282 {
283 Parsed<object> parsed = result as Parsed<object>;
284
285 if (parsed != null)
286 {
287 if (parsed.Value is T1)
288 {
289 return parsedFunc1((T1)parsed.Value);
290 }
291
292 if (parsed.Value is T2)
293 {
294 return parsedFunc2((T2)parsed.Value);
295 }
296
297 if (parsed.Value is T3)
298 {
299 return parsedFunc3((T3)parsed.Value);
300 }
301
302 if (parsed.Value is T4)
303 {
304 return parsedFunc4((T4)parsed.Value);
305 }
306
307 if (parsed.Value is T5)
308 {
309 return parsedFunc5((T5)parsed.Value);
310 }
311
312 throw new InvalidOperationException();
313 }
314
315 return notParsedFunc(((NotParsed<object>)result).Errors);
316 }

◆ MapResult< T1, T2, T3, T4, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, T4, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< T4, TResult >  parsedFunc4,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
T4Fourth verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
parsedFunc4Lambda executed on successful parsing of T4 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 221 of file ParserResultExtensions.cs.

227 {
228 Parsed<object> parsed = result as Parsed<object>;
229
230 if (parsed != null)
231 {
232 if (parsed.Value is T1)
233 {
234 return parsedFunc1((T1)parsed.Value);
235 }
236
237 if (parsed.Value is T2)
238 {
239 return parsedFunc2((T2)parsed.Value);
240 }
241
242 if (parsed.Value is T3)
243 {
244 return parsedFunc3((T3)parsed.Value);
245 }
246
247 if (parsed.Value is T4)
248 {
249 return parsedFunc4((T4)parsed.Value);
250 }
251
252 throw new InvalidOperationException();
253 }
254
255 return notParsedFunc(((NotParsed<object>)result).Errors);
256 }

◆ MapResult< T1, T2, T3, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, T3, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< T3, TResult >  parsedFunc3,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
T3Third verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
parsedFunc3Lambda executed on successful parsing of T3 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 175 of file ParserResultExtensions.cs.

180 {
181 Parsed<object> parsed = result as Parsed<object>;
182
183 if (parsed != null)
184 {
185 if (parsed.Value is T1)
186 {
187 return parsedFunc1((T1)parsed.Value);
188 }
189
190 if (parsed.Value is T2)
191 {
192 return parsedFunc2((T2)parsed.Value);
193 }
194
195 if (parsed.Value is T3)
196 {
197 return parsedFunc3((T3)parsed.Value);
198 }
199
200 throw new InvalidOperationException();
201 }
202
203 return notParsedFunc(((NotParsed<object>)result).Errors);
204 }

◆ MapResult< T1, T2, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, T2, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< T2, TResult >  parsedFunc2,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
T2Second verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
parsedFunc2Lambda executed on successful parsing of T2 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 137 of file ParserResultExtensions.cs.

141 {
142 Parsed<object> parsed = result as Parsed<object>;
143
144 if (parsed != null)
145 {
146 if (parsed.Value is T1)
147 {
148 return parsedFunc1((T1)parsed.Value);
149 }
150
151 if (parsed.Value is T2)
152 {
153 return parsedFunc2((T2)parsed.Value);
154 }
155
156 throw new InvalidOperationException();
157 }
158
159 return notParsedFunc(((NotParsed<object>)result).Errors);
160 }

◆ MapResult< T1, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< T1, TResult > ( this ParserResult< object >  result,
Func< T1, TResult >  parsedFunc1,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
T1First verb type.
TResult
Parameters
resultThe result in verb scenario.
parsedFunc1Lambda executed on successful parsing of T1 .
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 107 of file ParserResultExtensions.cs.

110 {
111 Parsed<object> parsed = result as Parsed<object>;
112
113 if (parsed != null)
114 {
115 if (parsed.Value is T1)
116 {
117 return parsedFunc1((T1)parsed.Value);
118 }
119
120 throw new InvalidOperationException();
121 }
122
123 return notParsedFunc(((NotParsed<object>)result).Errors);
124 }

◆ MapResult< TSource, TResult >()

static TResult CommandLine.ParserResultExtensions.MapResult< TSource, TResult > ( this ParserResult< TSource >  result,
Func< TSource, TResult >  parsedFunc,
Func< IEnumerable< Error >, TResult >  notParsedFunc 
)
static

Provides a way to transform result data into another value.

Template Parameters
TSourceType of the target instance built with parsed value.
TResultThe type of the new value.
Parameters
resultAn CommandLine.ParserResult<T> instance.
parsedFuncLambda executed on successful parsing.
notParsedFuncLambda executed on failed parsing.
Returns
The new value.

Definition at line 84 of file ParserResultExtensions.cs.

87 {
88 Parsed<TSource> parsed = result as Parsed<TSource>;
89
90 if (parsed != null)
91 {
92 return parsedFunc(parsed.Value);
93 }
94
95 return notParsedFunc(((NotParsed<TSource>)result).Errors);
96 }

◆ WithNotParsed< T >()

static ParserResult< T > CommandLine.ParserResultExtensions.WithNotParsed< T > ( this ParserResult< T >  result,
Action< IEnumerable< Error > >  action 
)
static

Executes action if CommandLine.ParserResult<T> lacks parsed values and contains errors.

Template Parameters
TType of the target instance built with parsed value.
Parameters
resultAn CommandLine.ParserResult<T> instance.
actionThe System.Action delegate to execute.
Returns
The same result instance.

Definition at line 63 of file ParserResultExtensions.cs.

64 {
65 NotParsed<T> notParsed = result as NotParsed<T>;
66
67 if (notParsed != null)
68 {
69 action(notParsed.Errors);
70 }
71
72 return result;
73 }

◆ WithNotParsedAsync< T >()

static async Task< ParserResult< T > > CommandLine.ParserResultExtensions.WithNotParsedAsync< T > ( this ParserResult< T >  result,
Func< IEnumerable< Error >, Task >  action 
)
static

Executes asynchronously action if CommandLine.ParserResult<T> lacks parsed values and contains errors.

Template Parameters
TType of the target instance built with parsed value.
Parameters
resultAn CommandLine.ParserResult<T> instance.
actionThe System.Func<Task> delegate to execute.
Returns
The same result instance as a Task instance.

Definition at line 60 of file ParserResultExtensionsAsync.cs.

62 {
63 if (result is NotParsed<T> notParsed)
64 {
65 await action(notParsed.Errors);
66 }
67
68 return result;
69 }

◆ WithParsed< T >() [1/2]

static ParserResult< object > CommandLine.ParserResultExtensions.WithParsed< T > ( this ParserResult< object >  result,
Action< T >  action 
)
static

Executes action if parsed values are of T .

Template Parameters
TType of the target instance built with parsed value.
Parameters
resultAn verb result instance.
actionThe Action<T> to execute.
Returns
The same result instance.

Definition at line 40 of file ParserResultExtensions.cs.

41 {
42 Parsed<object> parsed = result as Parsed<object>;
43
44 if (parsed != null)
45 {
46 if (parsed.Value is T)
47 {
48 action((T)parsed.Value);
49 }
50 }
51
52 return result;
53 }

◆ WithParsed< T >() [2/2]

static ParserResult< T > CommandLine.ParserResultExtensions.WithParsed< T > ( this ParserResult< T >  result,
Action< T >  action 
)
static

Executes action if CommandLine.ParserResult<T> contains parsed values.

Template Parameters
TType of the target instance built with parsed value.
Parameters
resultAn CommandLine.ParserResult<T> instance.
actionThe Action<T> to execute.
Returns
The same result instance.

Definition at line 21 of file ParserResultExtensions.cs.

22 {
23 Parsed<T> parsed = result as Parsed<T>;
24
25 if (parsed != null)
26 {
27 action(parsed.Value);
28 }
29
30 return result;
31 }

◆ WithParsedAsync< T >() [1/2]

static async Task< ParserResult< object > > CommandLine.ParserResultExtensions.WithParsedAsync< T > ( this ParserResult< object >  result,
Func< T, Task >  action 
)
static

Executes asynchronously action if parsed values are of T .

Template Parameters
TType of the target instance built with parsed value.
Parameters
resultAn verb result instance.
actionThe Func<T, Task> to execute.
Returns
The same result instance as a Task instance.

Definition at line 37 of file ParserResultExtensionsAsync.cs.

40 {
41 if (result is Parsed<object> parsed)
42 {
43 if (parsed.Value is T value)
44 {
45 await action(value);
46 }
47 }
48
49 return result;
50 }

◆ WithParsedAsync< T >() [2/2]

static async Task< ParserResult< T > > CommandLine.ParserResultExtensions.WithParsedAsync< T > ( this ParserResult< T >  result,
Func< T, Task >  action 
)
static

Executes asynchronously action if CommandLine.ParserResult<T> contains parsed values.

Template Parameters
TType of the target instance built with parsed value.
Parameters
resultAn CommandLine.ParserResult<T> instance.
actionThe Func<TResult> to execute.
Returns
The same result instance as a Task instance.

Definition at line 20 of file ParserResultExtensionsAsync.cs.

21 {
22 if (result is Parsed<T> parsed)
23 {
24 await action(parsed.Value);
25 }
26
27 return result;
28 }

The documentation for this class was generated from the following files: