@@ -824,11 +824,11 @@ def main_preset():
824
824
parser .add_argument (
825
825
"--show-presets" ,
826
826
help = "list all presets and exit" ,
827
- action = "store_true" )
827
+ action = arguments . action . optional_bool )
828
828
parser .add_argument (
829
829
"--distcc" ,
830
830
help = "use distcc" ,
831
- action = "store_true" )
831
+ action = arguments . action . optional_bool )
832
832
parser .add_argument (
833
833
"preset_substitutions_raw" ,
834
834
help = "'name=value' pairs that are substituted in the preset" ,
@@ -1116,22 +1116,22 @@ details of the setups of other systems or automated environments.""")
1116
1116
projects_group .add_argument (
1117
1117
"--xctest" ,
1118
1118
help = "build xctest" ,
1119
- action = "store_true" ,
1119
+ action = arguments . action . optional_bool ,
1120
1120
dest = "build_xctest" )
1121
1121
projects_group .add_argument (
1122
1122
"--foundation" ,
1123
1123
help = "build foundation" ,
1124
- action = "store_true" ,
1124
+ action = arguments . action . optional_bool ,
1125
1125
dest = "build_foundation" )
1126
1126
projects_group .add_argument (
1127
1127
"--libdispatch" ,
1128
1128
help = "build libdispatch" ,
1129
- action = "store_true" ,
1129
+ action = arguments . action . optional_bool ,
1130
1130
dest = "build_libdispatch" )
1131
1131
projects_group .add_argument (
1132
1132
"--build-ninja" ,
1133
1133
help = "build the Ninja tool" ,
1134
- action = "store_true" )
1134
+ action = arguments . action . optional_bool )
1135
1135
1136
1136
extra_actions_group = parser .add_argument_group (
1137
1137
title = "Extra actions to perform before or in addition to building" )
@@ -1142,7 +1142,7 @@ details of the setups of other systems or automated environments.""")
1142
1142
extra_actions_group .add_argument (
1143
1143
"--export-compile-commands" ,
1144
1144
help = "generate compilation databases in addition to building" ,
1145
- action = "store_true" )
1145
+ action = arguments . action . optional_bool )
1146
1146
extra_actions_group .add_argument (
1147
1147
"--symbols-package" ,
1148
1148
metavar = "PATH" ,
@@ -1324,11 +1324,7 @@ details of the setups of other systems or automated environments.""")
1324
1324
run_tests_group .add_argument (
1325
1325
"--test" ,
1326
1326
help = "test Swift after building" ,
1327
- metavar = "BOOL" ,
1328
- nargs = '?' ,
1329
- type = arguments .type .bool ,
1330
- default = False ,
1331
- const = True )
1327
+ action = arguments .action .optional_bool )
1332
1328
run_tests_group .add_argument (
1333
1329
"-T" ,
1334
1330
help = "run the validation test suite (implies --test)" ,
@@ -1338,11 +1334,7 @@ details of the setups of other systems or automated environments.""")
1338
1334
run_tests_group .add_argument (
1339
1335
"--validation-test" ,
1340
1336
help = "run the validation test suite (implies --test)" ,
1341
- metavar = "BOOL" ,
1342
- nargs = '?' ,
1343
- type = arguments .type .bool ,
1344
- default = False ,
1345
- const = True )
1337
+ action = arguments .action .optional_bool )
1346
1338
run_tests_group .add_argument (
1347
1339
"-o" ,
1348
1340
help = "run the test suite in optimized mode too (implies --test)" ,
@@ -1352,52 +1344,44 @@ details of the setups of other systems or automated environments.""")
1352
1344
run_tests_group .add_argument (
1353
1345
"--test-optimized" ,
1354
1346
help = "run the test suite in optimized mode too (implies --test)" ,
1355
- metavar = "BOOL" ,
1356
- nargs = '?' ,
1357
- type = arguments .type .bool ,
1358
- default = False ,
1359
- const = True )
1347
+ action = arguments .action .optional_bool )
1360
1348
run_tests_group .add_argument (
1361
1349
"--long-test" ,
1362
1350
help = "run the long test suite" ,
1363
- metavar = "BOOL" ,
1364
- nargs = '?' ,
1365
- type = arguments .type .bool ,
1366
- default = False ,
1367
- const = True )
1351
+ action = arguments .action .optional_bool )
1368
1352
run_tests_group .add_argument (
1369
1353
"--host-test" ,
1370
1354
help = "run executable tests on host devices (such as iOS or tvOS)" ,
1371
- action = "store_true" )
1355
+ action = arguments . action . optional_bool )
1372
1356
run_tests_group .add_argument (
1373
1357
"-B" , "--benchmark" ,
1374
1358
help = "run the Swift Benchmark Suite after building" ,
1375
1359
action = "store_true" )
1376
1360
run_tests_group .add_argument (
1377
1361
"--skip-test-osx" ,
1378
1362
help = "skip testing Swift stdlibs for Mac OS X" ,
1379
- action = "store_true" )
1363
+ action = arguments . action . optional_bool )
1380
1364
run_tests_group .add_argument (
1381
1365
"--skip-test-linux" ,
1382
1366
help = "skip testing Swift stdlibs for Linux" ,
1383
- action = "store_true" )
1367
+ action = arguments . action . optional_bool )
1384
1368
run_tests_group .add_argument (
1385
1369
"--skip-test-freebsd" ,
1386
1370
help = "skip testing Swift stdlibs for FreeBSD" ,
1387
- action = "store_true" )
1371
+ action = arguments . action . optional_bool )
1388
1372
run_tests_group .add_argument (
1389
1373
"--skip-test-cygwin" ,
1390
1374
help = "skip testing Swift stdlibs for Cygwin" ,
1391
- action = "store_true" )
1375
+ action = arguments . action . optional_bool )
1392
1376
parser .add_argument (
1393
1377
"--build-runtime-with-host-compiler" ,
1394
1378
help = "Use the host compiler, not the self-built one to compile the "
1395
1379
"Swift runtime" ,
1396
- action = "store_true" )
1380
+ action = arguments . action . optional_bool )
1397
1381
parser .add_argument (
1398
1382
"--build-swift-stdlib-unittest-extra" ,
1399
1383
help = "Build optional StdlibUnittest components" ,
1400
- action = "store_true" )
1384
+ action = arguments . action . optional_bool )
1401
1385
1402
1386
run_build_group = parser .add_argument_group (
1403
1387
title = "Run build" )
@@ -1408,124 +1392,124 @@ details of the setups of other systems or automated environments.""")
1408
1392
run_build_group .add_argument (
1409
1393
"--skip-build-linux" ,
1410
1394
help = "skip building Swift stdlibs for Linux" ,
1411
- action = "store_true" )
1395
+ action = arguments . action . optional_bool )
1412
1396
run_build_group .add_argument (
1413
1397
"--skip-build-freebsd" ,
1414
1398
help = "skip building Swift stdlibs for FreeBSD" ,
1415
- action = "store_true" )
1399
+ action = arguments . action . optional_bool )
1416
1400
run_build_group .add_argument (
1417
1401
"--skip-build-cygwin" ,
1418
1402
help = "skip building Swift stdlibs for Cygwin" ,
1419
- action = "store_true" )
1403
+ action = arguments . action . optional_bool )
1420
1404
run_build_group .add_argument (
1421
1405
"--skip-build-osx" ,
1422
1406
help = "skip building Swift stdlibs for MacOSX" ,
1423
- action = "store_true" )
1407
+ action = arguments . action . optional_bool )
1424
1408
1425
1409
run_build_group .add_argument (
1426
1410
"--skip-build-ios" ,
1427
1411
help = "skip building Swift stdlibs for iOS" ,
1428
- action = "store_true" )
1412
+ action = arguments . action . optional_bool )
1429
1413
run_build_group .add_argument (
1430
1414
"--skip-build-ios-device" ,
1431
1415
help = "skip building Swift stdlibs for iOS devices "
1432
1416
"(i.e. build simulators only)" ,
1433
- action = "store_true" )
1417
+ action = arguments . action . optional_bool )
1434
1418
run_build_group .add_argument (
1435
1419
"--skip-build-ios-simulator" ,
1436
1420
help = "skip building Swift stdlibs for iOS simulator "
1437
1421
"(i.e. build devices only)" ,
1438
- action = "store_true" )
1422
+ action = arguments . action . optional_bool )
1439
1423
1440
1424
run_build_group .add_argument (
1441
1425
"--skip-build-tvos" ,
1442
1426
help = "skip building Swift stdlibs for tvOS" ,
1443
- action = "store_true" )
1427
+ action = arguments . action . optional_bool )
1444
1428
run_build_group .add_argument (
1445
1429
"--skip-build-tvos-device" ,
1446
1430
help = "skip building Swift stdlibs for tvOS devices "
1447
1431
"(i.e. build simulators only)" ,
1448
- action = "store_true" )
1432
+ action = arguments . action . optional_bool )
1449
1433
run_build_group .add_argument (
1450
1434
"--skip-build-tvos-simulator" ,
1451
1435
help = "skip building Swift stdlibs for tvOS simulator "
1452
1436
"(i.e. build devices only)" ,
1453
- action = "store_true" )
1437
+ action = arguments . action . optional_bool )
1454
1438
1455
1439
run_build_group .add_argument (
1456
1440
"--skip-build-watchos" ,
1457
1441
help = "skip building Swift stdlibs for watchOS" ,
1458
- action = "store_true" )
1442
+ action = arguments . action . optional_bool )
1459
1443
run_build_group .add_argument (
1460
1444
"--skip-build-watchos-device" ,
1461
1445
help = "skip building Swift stdlibs for watchOS devices "
1462
1446
"(i.e. build simulators only)" ,
1463
- action = "store_true" )
1447
+ action = arguments . action . optional_bool )
1464
1448
run_build_group .add_argument (
1465
1449
"--skip-build-watchos-simulator" ,
1466
1450
help = "skip building Swift stdlibs for watchOS simulator "
1467
1451
"(i.e. build devices only)" ,
1468
- action = "store_true" )
1452
+ action = arguments . action . optional_bool )
1469
1453
1470
1454
run_build_group .add_argument (
1471
1455
"--skip-build-android" ,
1472
1456
help = "skip building Swift stdlibs for Android" ,
1473
- action = "store_true" )
1457
+ action = arguments . action . optional_bool )
1474
1458
1475
1459
run_build_group .add_argument (
1476
1460
"--skip-build-benchmarks" ,
1477
1461
help = "skip building Swift Benchmark Suite" ,
1478
- action = "store_true" )
1462
+ action = arguments . action . optional_bool )
1479
1463
1480
1464
skip_test_group = parser .add_argument_group (
1481
1465
title = "Skip testing specified targets" )
1482
1466
skip_test_group .add_argument (
1483
1467
"--skip-test-ios" ,
1484
1468
help = "skip testing all iOS targets. Equivalent to specifying both "
1485
1469
"--skip-test-ios-simulator and --skip-test-ios-host" ,
1486
- action = "store_true" )
1470
+ action = arguments . action . optional_bool )
1487
1471
skip_test_group .add_argument (
1488
1472
"--skip-test-ios-simulator" ,
1489
1473
help = "skip testing iOS simulator targets" ,
1490
- action = "store_true" )
1474
+ action = arguments . action . optional_bool )
1491
1475
skip_test_group .add_argument (
1492
1476
"--skip-test-ios-host" ,
1493
1477
help = "skip testing iOS device targets on the host machine (the phone "
1494
1478
"itself)" ,
1495
- action = "store_true" )
1479
+ action = arguments . action . optional_bool )
1496
1480
skip_test_group .add_argument (
1497
1481
"--skip-test-tvos" ,
1498
1482
help = "skip testing all tvOS targets. Equivalent to specifying both "
1499
1483
"--skip-test-tvos-simulator and --skip-test-tvos-host" ,
1500
- action = "store_true" )
1484
+ action = arguments . action . optional_bool )
1501
1485
skip_test_group .add_argument (
1502
1486
"--skip-test-tvos-simulator" ,
1503
1487
help = "skip testing tvOS simulator targets" ,
1504
- action = "store_true" )
1488
+ action = arguments . action . optional_bool )
1505
1489
skip_test_group .add_argument (
1506
1490
"--skip-test-tvos-host" ,
1507
1491
help = "skip testing tvOS device targets on the host machine (the TV "
1508
1492
"itself)" ,
1509
- action = "store_true" )
1493
+ action = arguments . action . optional_bool )
1510
1494
skip_test_group .add_argument (
1511
1495
"--skip-test-watchos" ,
1512
1496
help = "skip testing all tvOS targets. Equivalent to specifying both "
1513
1497
"--skip-test-watchos-simulator and --skip-test-watchos-host" ,
1514
- action = "store_true" )
1498
+ action = arguments . action . optional_bool )
1515
1499
skip_test_group .add_argument (
1516
1500
"--skip-test-watchos-simulator" ,
1517
1501
help = "skip testing watchOS simulator targets" ,
1518
- action = "store_true" )
1502
+ action = arguments . action . optional_bool )
1519
1503
skip_test_group .add_argument (
1520
1504
"--skip-test-watchos-host" ,
1521
1505
help = "skip testing watchOS device targets on the host machine (the "
1522
1506
"watch itself)" ,
1523
- action = "store_true" )
1507
+ action = arguments . action . optional_bool )
1524
1508
skip_test_group .add_argument (
1525
1509
"--skip-test-android-host" ,
1526
1510
help = "skip testing Android device targets on the host machine (the "
1527
1511
"phone itself)" ,
1528
- action = "store_true" )
1512
+ action = arguments . action . optional_bool )
1529
1513
1530
1514
parser .add_argument (
1531
1515
"-i" , "--ios" ,
@@ -1542,7 +1526,7 @@ details of the setups of other systems or automated environments.""")
1542
1526
"--tvos" ,
1543
1527
help = "also build for tvOS, but disallow tests that require a tvos "
1544
1528
"device" ,
1545
- action = "store_true" )
1529
+ action = arguments . action . optional_bool )
1546
1530
parser .add_argument (
1547
1531
"--skip-tvos" ,
1548
1532
help = "set to skip everything tvOS-related" ,
@@ -1553,7 +1537,7 @@ details of the setups of other systems or automated environments.""")
1553
1537
"--watchos" ,
1554
1538
help = "also build for watchOS, but disallow tests that require an "
1555
1539
"watchOS device" ,
1556
- action = "store_true" )
1540
+ action = arguments . action . optional_bool )
1557
1541
parser .add_argument (
1558
1542
"--skip-watchos" ,
1559
1543
help = "set to skip everything watchOS-related" ,
@@ -1563,7 +1547,7 @@ details of the setups of other systems or automated environments.""")
1563
1547
parser .add_argument (
1564
1548
"--android" ,
1565
1549
help = "also build for Android" ,
1566
- action = "store_true" )
1550
+ action = arguments . action . optional_bool )
1567
1551
1568
1552
parser .add_argument (
1569
1553
"--swift-analyze-code-coverage" ,
@@ -1609,7 +1593,7 @@ details of the setups of other systems or automated environments.""")
1609
1593
parser .add_argument (
1610
1594
"--show-sdks" ,
1611
1595
help = "print installed Xcode and SDK versions" ,
1612
- action = "store_true" )
1596
+ action = arguments . action . optional_bool )
1613
1597
1614
1598
parser .add_argument (
1615
1599
"--extra-swift-args" ,
@@ -1677,15 +1661,15 @@ details of the setups of other systems or automated environments.""")
1677
1661
parser .add_argument (
1678
1662
"--distcc" ,
1679
1663
help = "use distcc in pump mode" ,
1680
- action = "store_true" )
1664
+ action = arguments . action . optional_bool )
1681
1665
parser .add_argument (
1682
1666
"--enable-asan" ,
1683
1667
help = "enable Address Sanitizer" ,
1684
- action = "store_true" )
1668
+ action = arguments . action . optional_bool )
1685
1669
parser .add_argument (
1686
1670
"--enable-ubsan" ,
1687
1671
help = "enable Undefined Behavior Sanitizer" ,
1688
- action = "store_true" )
1672
+ action = arguments . action . optional_bool )
1689
1673
parser .add_argument (
1690
1674
"--clang-compiler-version" ,
1691
1675
help = "string that indicates a compiler version for Clang" ,
@@ -1733,11 +1717,7 @@ details of the setups of other systems or automated environments.""")
1733
1717
parser .add_argument (
1734
1718
"--verbose-build" ,
1735
1719
help = "print the commands executed during the build" ,
1736
- metavar = "BOOL" ,
1737
- nargs = '?' ,
1738
- type = arguments .type .bool ,
1739
- default = False ,
1740
- const = True )
1720
+ action = arguments .action .optional_bool )
1741
1721
1742
1722
parser .add_argument (
1743
1723
"--lto" ,
0 commit comments