@@ -474,16 +474,11 @@ public class SwiftTool<Options: ToolOptions> {
474
474
option: parser. add ( option: " --build-system " , kind: BuildSystemKind . self, usage: nil ) ,
475
475
to: { $0. _buildSystem = $1 } )
476
476
477
- #if os(macOS)
478
- if #available( macOS 10 . 13 , * ) {
479
- // implementation of the netrc reader depends upon macOS 10.13
480
- binder. bind (
481
- option: parser. add (
482
- option: " --netrc-file " , kind: PathArgument . self,
483
- usage: " Absolute path to netrc file for downloading binary target artifacts " ) ,
484
- to: { $0. netrcFilePath = $1. path } )
485
- }
486
- #endif
477
+ binder. bind (
478
+ option: parser. add (
479
+ option: " --netrc-file " , kind: PathArgument . self,
480
+ usage: " Absolute path to netrc file for downloading binary target artifacts (macOS >=10.13) " ) ,
481
+ to: { $0. netrcFilePath = $1. path } )
487
482
488
483
// Let subclasses bind arguments.
489
484
type ( of: self ) . defineArguments ( parser: parser, binder: binder)
@@ -574,6 +569,19 @@ public class SwiftTool<Options: ToolOptions> {
574
569
if result. exists ( arg: " --arch " ) && result. exists ( arg: " --triple " ) {
575
570
diagnostics. emit ( . mutuallyExclusiveArgumentsError( arguments: [ " --arch " , " --triple " ] ) )
576
571
}
572
+
573
+ if result. exists ( arg: " --netrc-file " ) {
574
+ // --netrc-file option only supported on macOS >=10.13
575
+ #if os(macOS)
576
+ if #available( macOS 10 . 13 , * ) {
577
+ // ok, check succeeds
578
+ diagnostics. emit ( error: " --netrc-file option is only supported on macOS >=10.13 " )
579
+ } else {
580
+ }
581
+ #else
582
+ diagnostics. emit ( error: " --netrc-file option is only supported on macOS >=10.13 " )
583
+ #endif
584
+ }
577
585
}
578
586
579
587
class func defineArguments( parser: ArgumentParser , binder: ArgumentBinder < Options > ) {
0 commit comments