Moved the Create.Options model to its own file in the executable target.
This commit is contained in:
parent
1f738fe644
commit
afa7686407
@ -1,6 +1,5 @@
|
|||||||
import ArgumentParser
|
import ArgumentParser
|
||||||
import ColibriLibrary
|
import ColibriLibrary
|
||||||
import Foundation
|
|
||||||
|
|
||||||
extension Colibri {
|
extension Colibri {
|
||||||
struct Create: AsyncParsableCommand {
|
struct Create: AsyncParsableCommand {
|
||||||
@ -32,25 +31,3 @@ extension Colibri {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Options
|
|
||||||
|
|
||||||
extension Colibri.Create {
|
|
||||||
struct Options: ParsableArguments {
|
|
||||||
|
|
||||||
// MARK: Properties
|
|
||||||
|
|
||||||
@Option(name: .shortAndLong)
|
|
||||||
var name: String
|
|
||||||
|
|
||||||
@Option(name: .shortAndLong)
|
|
||||||
var location: String?
|
|
||||||
|
|
||||||
// MARK: Computed
|
|
||||||
|
|
||||||
var locationURL: URL? {
|
|
||||||
location.flatMap { URL(fileURLWithPath: $0) }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
22
Sources/Executable/Options/CreateOptions.swift
Normal file
22
Sources/Executable/Options/CreateOptions.swift
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import ArgumentParser
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
extension Colibri.Create {
|
||||||
|
struct Options: ParsableArguments {
|
||||||
|
|
||||||
|
// MARK: Properties
|
||||||
|
|
||||||
|
@Option(name: .shortAndLong)
|
||||||
|
var name: String
|
||||||
|
|
||||||
|
@Option(name: .shortAndLong)
|
||||||
|
var location: String?
|
||||||
|
|
||||||
|
// MARK: Computed
|
||||||
|
|
||||||
|
var locationURL: URL? {
|
||||||
|
location.flatMap { URL(fileURLWithPath: $0) }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user