func run()

in Sources/HubCLI/HubCLI.swift [60:71]


    func run() async throws {
        let hubApi = HubApi(hfToken: hfToken)
        let repo = Hub.Repo(id: repo, type: repoType.asHubApiRepoType)
        let downloadedTo = try await hubApi.snapshot(from: repo, revision: revision, matching: include) { progress in
            DispatchQueue.main.async {
                let totalPercent = 100 * progress.fractionCompleted
                print("\(progress.completedUnitCount)/\(progress.totalUnitCount) \(totalPercent.formatted("%.02f"))%", terminator: "\r")
                fflush(stdout)
            }
        }
        print("Snapshot downloaded to: \(downloadedTo.path)")
    }