resgen.swift/Sources/Strings/Twine/TwineOptions.swift
Thibaut Schmitt a54a264447
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Bugs fixes, Lint fixes, Refactoring
2022-08-29 13:38:49 +02:00

38 lines
1.0 KiB
Swift

//
// File.swift
//
//
// Created by Thibaut Schmitt on 10/01/2022.
//
import Foundation
import ArgumentParser
struct TwineOptions: ParsableArguments {
@Flag(name: [.customShort("f"), .customShort("F")], help: "Should force generation")
var forceGeneration = false
@Argument(help: "Input files where strings ared defined.", transform: { $0.replaceTiltWithHomeDirectoryPath() })
var inputFile: String
@Option(help: "Path where to strings file.", transform: { $0.replaceTiltWithHomeDirectoryPath() })
var outputPath: String
@Option(name: .customLong("langs"), help: "Langs to generate.")
fileprivate var langsRaw: String
@Option(help: "Default langs.")
var defaultLang: String
@Option(help: "Path where to generate the extension.", transform: { $0.replaceTiltWithHomeDirectoryPath() })
var extensionOutputPath: String
}
extension TwineOptions {
var langs: [String] {
langsRaw
.split(separator: " ")
.map { String($0) }
}
}