22 lines
637 B
Swift
22 lines
637 B
Swift
import ArgumentParser
|
|
import PuttyKit
|
|
|
|
@main
|
|
struct CLI: AsyncParsableCommand {
|
|
static let configuration: CommandConfiguration = .init(
|
|
commandName: "putty",
|
|
abstract: "A utility for getting comic data from GoComics.com.",
|
|
subcommands: [Scrape.self])
|
|
}
|
|
|
|
struct Scrape: AsyncParsableCommand {
|
|
static let configuration: CommandConfiguration = .init(abstract: "Scrape all necessary data.")
|
|
|
|
mutating func run() async throws {
|
|
print("scrape")
|
|
let fetcher = PageFetcher(webDriverURL: "http://browser:4444")
|
|
_ = try await fetcher.fetchAToZ()
|
|
print("Fetch complete!")
|
|
}
|
|
}
|