23 lines
562 B
Swift
23 lines
562 B
Swift
import ArgumentParser
|
|
import Dependencies
|
|
|
|
// TODO: Need to add a step to build prior to generating file.
|
|
struct GenerateLatexCommand: AsyncParsableCommand {
|
|
static let commandName = "latex"
|
|
|
|
static let configuration = CommandConfiguration(
|
|
commandName: commandName
|
|
)
|
|
|
|
@OptionGroup var globals: GenerateOptions
|
|
|
|
mutating func run() async throws {
|
|
@Dependency(\.pandocClient) var pandocClient
|
|
|
|
let output = try await pandocClient.run.generateLatex(
|
|
globals.pandocRunOptions(commandName: Self.commandName)
|
|
)
|
|
print(output)
|
|
}
|
|
}
|