Implemented the Open subcommand. #9

Merged
javier merged 4 commits from command/open-project into main 2025-02-19 23:27:22 +00:00
3 changed files with 51 additions and 0 deletions
Showing only changes of commit 77363a7c0e - Show all commits

View File

@ -0,0 +1,29 @@
import ArgumentParser
import ColibriLibrary
extension Colibri {
struct Open: AsyncParsableCommand {
// MARK: Properties
static let configuration = CommandConfiguration(
commandName: "open-project",
abstract: "Open a Hummingbird app",
helpNames: .shortAndLong,
aliases: ["open"]
)
@OptionGroup var options: Options
// MARK: Functions
mutating func run() async throws {
let terminalService = TerminalService()
let openProject = OpenProjectTask(terminalService: terminalService)
try await openProject(with: options.ide, at: options.locationURL)
}
}
}

View File

@ -0,0 +1,6 @@
import ArgumentParser
import ColibriLibrary
// MARK: - ExpressibleByArgument
extension IDE: ExpressibleByArgument {}

View File

@ -0,0 +1,16 @@
import ArgumentParser
import ColibriLibrary
extension Colibri.Open {
struct Options: ParsableArguments, Locationable {
// MARK: Properties
@Option(name: .shortAndLong)
var ide: IDE = .xcode
@Option(name: .shortAndLong)
var location: String?
}
}