This commit is contained in:
douboer
2025-09-07 12:39:28 +08:00
parent 1ba01e3c64
commit 4d033257fe
5714 changed files with 15866 additions and 1032 deletions

View File

@@ -0,0 +1,22 @@
import Foundation
@available(macOS 10.15, iOS 13.0, *)
@main
struct CLIMain {
static func main() async {
guard CommandLine.arguments.count > 1 else {
print("用法: IpadReaderCLI <bundle.zip>")
return
}
let zipPath = CommandLine.arguments[1]
let url = URL(fileURLWithPath: zipPath)
let importer = BundleImporter()
do {
let idx = try await importer.importZipFile(at: url)
print("导入成功,书籍数: \(idx.books.count)")
print("统计: 年总时长 \(idx.stats.global.year_total_minutes/60) 小时")
} catch {
print("导入失败: \(error)")
}
}
}