-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathQdsTool.swift
50 lines (41 loc) · 1.33 KB
/
QdsTool.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// Copyright (C) 2023 Devexperts LLC. All rights reserved.
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
import Foundation
import DXFeedFramework
class QdsTool: ToolsCommand {
var isTools: Bool = true
var cmd = "Qds"
var shortDescription = "A collection of tools ported from the Java qds-tools."
var fullDescription =
"""
Qds
=======
Usage:
Qds <arg> [<options>]
Where:
args (pos. 0) Required. Represents the arguments passed to the qds-tools.
-p, --properties Comma-separated list of properties (key-value pair separated by an equals sign).
"""
private lazy var arguments: Arguments = {
do {
let arguments = try Arguments(ProcessInfo.processInfo.arguments, requiredNumberOfArguments: 1)
return arguments
} catch {
print(fullDescription)
exit(0)
}
}()
func execute() {
do {
try arguments.properties.forEach { key, value in
try SystemProperty.setProperty(key, value)
}
try QdsUtils.execute(arguments.qdsCommandLine ?? [String]())
} catch {
print("Qds tool error: \(error)")
}
}
}