Skip to content

Commit f72c9bc

Browse files
authored
Merge pull request #10 from rofle100lvl/RefactoringBranch
Refactoring
2 parents 94ceb0c + aaf6221 commit f72c9bc

File tree

2 files changed

+9
-26
lines changed

2 files changed

+9
-26
lines changed

Sources/UseGraphPeriphery/UseGraphDynamic.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,9 @@ public struct UseGraphPeripheryBuildCommand: AsyncParsableCommand {
5555
@Option(help: "Path to project (.xcodeproj)")
5656
var projectPath: String? = nil
5757

58-
@Argument(help: "Schemes to analyze")
58+
@Option(help: "Schemes to analyze")
5959
var schemes: String
6060

61-
@Argument(help: "Targets to analyze")
62-
var targets: String
63-
6461
public func run() async throws {
6562
let configuration = Configuration()
6663
if let projectPath {

Sources/UseGraphPeriphery/UseGraphPeripheryCommand.swift

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,25 @@ public struct UseGraphPeripheryAnalyzeCommand: AsyncParsableCommand {
1717
version: "0.0.1"
1818
)
1919

20-
@Argument(help: "Path to project (.xcodeproj)")
20+
@Option(help: "Path to project (.xcodeproj)")
2121
var projectPath: String? = nil
2222

23-
@Argument(help: "Paths to folder with sources - \"path1,path2,path3\"")
24-
var folderPaths: String? = nil
23+
@Option(help: "Paths to folder with sources - \"path1,path2,path3\"")
24+
var folderPaths: String
2525

26-
@Argument(help: "Schemes to analyze")
26+
@Option(help: "Schemes to analyze")
2727
var schemes: String
2828

29-
@Argument(help: "Targets to analyze")
30-
var targets: String
31-
32-
@Option(help: "Use if you want to exclude any entity names")
33-
var excludedNames: String? = nil
34-
35-
@Option(help: "Use if you want to exclude any targets")
36-
var excludedTargets: String? = nil
37-
3829
public func run() async throws {
3930
var projectURL: URL?
40-
var folderURLs: [String] = []
31+
let folderURLs: [String] = try folderPaths.split(separator: ",").map {
32+
guard let folderURL = URL(string: String($0)) else { throw PathError.pathIsNotCorrect }
33+
return folderURL.path()
34+
}
4135

4236
if let projectPath {
4337
projectURL = URL(string: projectPath)
4438
}
45-
if let folderPaths {
46-
folderURLs = try folderPaths.split(separator: ",").map {
47-
guard let folderURL = URL(string: String($0)) else { throw PathError.pathIsNotCorrect }
48-
return folderURL.path()
49-
}
50-
} else {
51-
throw PathError.pathIsNotCorrect
52-
}
5339

5440
guard let projectURL else { throw PathError.pathIsNotCorrect }
5541
let configuration = Configuration()

0 commit comments

Comments
 (0)