chore(swabble): apply swiftformat

This commit is contained in:
Peter Steinberger
2025-12-09 15:36:41 +01:00
parent 336c9d6caa
commit 318457cb2c
13 changed files with 74 additions and 75 deletions

View File

@@ -24,12 +24,12 @@ struct TranscribeCommand: ParsableCommand {
init(parsed: ParsedValues) {
self.init()
if let positional = parsed.positional.first { self.inputFile = positional }
if let loc = parsed.options["locale"]?.last { self.locale = loc }
if parsed.flags.contains("censor") { self.censor = true }
if let out = parsed.options["output"]?.last { self.outputFile = out }
if let fmt = parsed.options["format"]?.last { self.format = fmt }
if let len = parsed.options["maxLength"]?.last, let intVal = Int(len) { self.maxLength = intVal }
if let positional = parsed.positional.first { inputFile = positional }
if let loc = parsed.options["locale"]?.last { locale = loc }
if parsed.flags.contains("censor") { censor = true }
if let out = parsed.options["output"]?.last { outputFile = out }
if let fmt = parsed.options["format"]?.last { format = fmt }
if let len = parsed.options["maxLength"]?.last, let intVal = Int(len) { maxLength = intVal }
}
mutating func run() async throws {
@@ -51,7 +51,7 @@ struct TranscribeCommand: ParsableCommand {
transcript += result.text
}
let output = outputFormat.text(for: transcript, maxLength: self.maxLength)
let output = outputFormat.text(for: transcript, maxLength: maxLength)
if let path = outputFile {
try output.write(to: URL(fileURLWithPath: path), atomically: false, encoding: .utf8)
} else {