Add visibility parameters to control scope of generated extension
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit

This commit is contained in:
2025-07-18 11:53:46 +02:00
parent beca2c6b2b
commit 7162f13166
61 changed files with 1511 additions and 791 deletions

View File

@ -72,7 +72,8 @@ struct Stringium: ParsableCommand {
inputFilename: options.inputFilenameWithoutExt,
extensionName: extensionName,
extensionFilePath: extensionFilePath,
extensionSuffix: options.extensionSuffix ?? ""
extensionSuffix: options.extensionSuffix ?? "",
visibility: options.extensionVisibility
)
}

View File

@ -7,6 +7,7 @@
import ArgumentParser
import Foundation
import ToolCore
// swiftlint:disable no_grouping_extension
@ -23,7 +24,7 @@ struct StringiumOptions: ParsableArguments {
@Option(
name: .customLong("output-path"),
help: "Path where to strings file.",
help: "Path where to find the .xcStrings file or the lproj folders.",
transform: { $0.replaceTiltWithHomeDirectoryPath() }
)
fileprivate var outputPathRaw: String
@ -49,6 +50,13 @@ struct StringiumOptions: ParsableArguments {
@Option(help: "Tell if it will generate xcStrings file or lproj file. True by default")
var xcStrings: Bool = true
@Option(
name: .customLong("visibility"),
help: "Visibility of extension and properties. Possibles values: public, private, package, internal. Default is internal",
completion: .list(["public", "private", "package", "internal"])
)
var extensionVisibility: ExtensionVisibility = .internal
@Option(
help: "Path where to generate the extension.",
transform: { $0.replaceTiltWithHomeDirectoryPath() }