Created the basis of the Create command in the executable target.
This commit is contained in:
parent
15d1e22f1c
commit
db1df0ec62
@ -1,13 +1,13 @@
|
|||||||
import ArgumentParser
|
import ArgumentParser
|
||||||
import ColibriLibrary
|
|
||||||
|
|
||||||
@main
|
@main
|
||||||
struct Colibri: AsyncParsableCommand {
|
struct Colibri: AsyncParsableCommand {
|
||||||
|
|
||||||
// MARK: Functions
|
// MARK: Properties
|
||||||
|
|
||||||
func run() async throws {
|
static let configuration = CommandConfiguration(
|
||||||
// ...
|
abstract: "The utility to manage your Hummingbird projects",
|
||||||
}
|
subcommands: [Create.self]
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
41
Sources/Executable/Commands/Create.swift
Normal file
41
Sources/Executable/Commands/Create.swift
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import ArgumentParser
|
||||||
|
import ColibriLibrary
|
||||||
|
|
||||||
|
extension Colibri {
|
||||||
|
struct Create: AsyncParsableCommand {
|
||||||
|
|
||||||
|
// MARK: Properties
|
||||||
|
|
||||||
|
static let configuration = CommandConfiguration(
|
||||||
|
commandName: "create project",
|
||||||
|
abstract: "Create a new, tailored Colibri project.",
|
||||||
|
helpNames: .shortAndLong,
|
||||||
|
aliases: ["create"]
|
||||||
|
)
|
||||||
|
|
||||||
|
@OptionGroup var options: Options
|
||||||
|
|
||||||
|
// MARK: Functions
|
||||||
|
|
||||||
|
mutating func run() async throws {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Options
|
||||||
|
|
||||||
|
extension Colibri.Create {
|
||||||
|
struct Options: ParsableArguments {
|
||||||
|
|
||||||
|
// MARK: Properties
|
||||||
|
|
||||||
|
@Option(name: .shortAndLong)
|
||||||
|
var name: String
|
||||||
|
|
||||||
|
@Option(name: .shortAndLong)
|
||||||
|
var location: String?
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -11,6 +11,6 @@ extension URL {
|
|||||||
static let someExistingFile = URL(at: "/some/existing/file")
|
static let someExistingFile = URL(at: "/some/existing/file")
|
||||||
static let someNewFolder = URL(at: "/some/new/folder")
|
static let someNewFolder = URL(at: "/some/new/folder")
|
||||||
static let someNewFile = URL(at: "/some/new/file")
|
static let someNewFile = URL(at: "/some/new/file")
|
||||||
static let someRandomURL = URL(string: "some.random.url")!
|
static let someRandomURL = URL(string: "http://some.random.url")!
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user