Skip to content

Commit

Permalink
Merge pull request #22 from stelabouras/feature/status-filter
Browse files Browse the repository at this point in the history
Feature/status filter
  • Loading branch information
Nikos Vasileiou authored Feb 24, 2023
2 parents c10750e + b49d234 commit 2a4fcb2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,8 @@ argument of the push command.

- Allows users to enter a `.xcworkspace` as a `project` argument and handles it correctly.

## Transifex Command Line Tool 1.0.6

*February 23, 2023*

- Introduces status filter option in pull command.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"repositoryURL": "https://github.com/transifex/transifex-swift",
"state": {
"branch": null,
"revision": "7c1326b1a80fb37923cb4782d63293766ce8ffa7",
"version": "1.0.1"
"revision": "bb5067a395e7343a9c5697bb365baffff3d178f8",
"version": "1.0.4"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let package = Package(
dependencies: [
.package(name: "transifex",
url: "https://github.com/transifex/transifex-swift",
from: "1.0.1"),
from: "1.0.4"),
.package(url: "https://github.com/apple/swift-argument-parser",
from: "0.3.0"),
.package(url: "https://github.com/kiliankoe/CLISpinner",
Expand Down
18 changes: 15 additions & 3 deletions Sources/TXCli/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ that can be bundled with the iOS application.
The tool can be also used to force CDS cache invalidation so that the next pull
command will fetch fresh translations from CDS.
""",
version: "1.0.5",
version: "1.0.6",
subcommands: [Push.self, Pull.self, Invalidate.self])
}

Expand Down Expand Up @@ -110,7 +110,8 @@ the CDS server.

@Flag(name: .long, inversion: .prefixedEnableDisable,
exclusivity: .exclusive, help: """
Control whether the keys of strings to be pushed should be hashed or not.
Control whether the keys of strings to be pushed should be hashed (true) or not
(false).
""")
private var hashKeys: Bool = true

Expand Down Expand Up @@ -327,9 +328,19 @@ will try to create it (alongside any intermediate folders).

@Option(name: .long, parsing: .upToNextOption, help: """
If set, only the strings that have all of the given tags will be downloaded.
This option can be used alongside the --with-status-only option.
""")
private var withTagsOnly: [String] = []

@Option(name: .long, help: """
If set, only the strings that have the provided status assigned will be
downloaded.
This option can be used alongside the --with-tags-only option.
""")
private var withStatusOnly: String?

func run() throws {
let logHandler = CliLogHandler()
logHandler.verbose = options.verbose
Expand Down Expand Up @@ -363,7 +374,8 @@ If set, only the strings that have all of the given tags will be downloaded.
var appTranslations: [String: TXLocaleStrings] = [:]
var appErrors: [Error] = []

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

0 comments on commit 2a4fcb2

Please sign in to comment.