Skip to content

Commit

Permalink
Add support for fetch tags in Pull command
Browse files Browse the repository at this point in the history
Adds fetch tags support in Pull command by introducing the
`--with-tags-only` argument.

This commit depends on transifex/transifex-swift#30

Ref:
https://trello.com/c/1rLV8xLY/50-cli-pull-content-with-tags-only
  • Loading branch information
stelabouras committed Jun 22, 2021
1 parent 993f08a commit b21c2c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/TXCli/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ will try to create it (alongside any intermediate folders).
""")
private var output: String

@Option(name: .long, parsing: .upToNextOption, help: """
If set, only the strings that have all of the given tags will be downloaded.
""")
private var withTagsOnly: [String]

func run() throws {
let logHandler = CliLogHandler()
logHandler.verbose = options.verbose
Expand Down Expand Up @@ -273,7 +278,7 @@ will try to create it (alongside any intermediate folders).
var appTranslations: [String: TXLocaleStrings] = [:]
var appErrors: [Error] = []

TXNative.fetchTranslations(nil) { (fetchedTranslations, errors) in
TXNative.fetchTranslations(tags: withTagsOnly) { (fetchedTranslations, errors) in
appErrors = errors
appTranslations = fetchedTranslations
semaphore.signal()
Expand Down

0 comments on commit b21c2c5

Please sign in to comment.