@@ -13,6 +13,11 @@ protocol ConfigExportPerforming: Sendable {
1313struct SubcommandConfigExporter : ConfigExportPerforming {
1414 let globalOptions : GlobalOptions
1515 let resume : Bool
16+ let cache : Bool
17+ let noCache : Bool
18+ let force : Bool
19+ let cachePath : String ?
20+ let concurrentDownloads : Int
1621
1722 func export(
1823 configFile: ConfigFile ,
@@ -21,11 +26,17 @@ struct SubcommandConfigExporter: ConfigExportPerforming {
2126 ui: TerminalUI
2227 ) async throws -> ExportStats {
2328 try await InjectedClientStorage . $client. withValue ( client) {
24- let cacheOptions = CacheOptions ( )
29+ var cacheOptions = CacheOptions ( )
30+ cacheOptions. cache = cache
31+ cacheOptions. noCache = noCache
32+ cacheOptions. force = force
33+ cacheOptions. cachePath = cachePath
34+
2535 let faultToleranceOptions = FaultToleranceOptions ( )
2636
2737 var heavyFaultToleranceOptions = HeavyFaultToleranceOptions ( )
2838 heavyFaultToleranceOptions. resume = resume
39+ heavyFaultToleranceOptions. concurrentDownloads = concurrentDownloads
2940
3041 let colors = makeColors (
3142 options: options,
@@ -71,6 +82,11 @@ struct BatchConfigRunner: Sendable {
7182 let globalOptions : GlobalOptions
7283 let maxRetries : Int
7384 let resume : Bool
85+ let cache : Bool
86+ let noCache : Bool
87+ let force : Bool
88+ let cachePath : String ?
89+ let concurrentDownloads : Int
7490 let exporter : any ConfigExportPerforming
7591
7692 init (
@@ -79,16 +95,31 @@ struct BatchConfigRunner: Sendable {
7995 globalOptions: GlobalOptions ,
8096 maxRetries: Int ,
8197 resume: Bool ,
98+ cache: Bool = false ,
99+ noCache: Bool = false ,
100+ force: Bool = false ,
101+ cachePath: String ? = nil ,
102+ concurrentDownloads: Int = FileDownloader . defaultMaxConcurrentDownloads,
82103 exporter: ConfigExportPerforming ? = nil
83104 ) {
84105 self . rateLimiter = rateLimiter
85106 self . retryPolicy = retryPolicy
86107 self . globalOptions = globalOptions
87108 self . maxRetries = maxRetries
88109 self . resume = resume
110+ self . cache = cache
111+ self . noCache = noCache
112+ self . force = force
113+ self . cachePath = cachePath
114+ self . concurrentDownloads = concurrentDownloads
89115 self . exporter = exporter ?? SubcommandConfigExporter (
90116 globalOptions: globalOptions,
91- resume: resume
117+ resume: resume,
118+ cache: cache,
119+ noCache: noCache,
120+ force: force,
121+ cachePath: cachePath,
122+ concurrentDownloads: concurrentDownloads
92123 )
93124 }
94125
0 commit comments