From a52cfb295c74aaacfd4d2c5e6f033eafa9bf947e Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Wed, 19 Feb 2025 00:47:03 +0100 Subject: [PATCH] Implemented the OutdatedCommand command in the executable target. --- .../Sources/Commands/OutdatedCommand.swift | 29 +++++++++++++++++++ .../Sources/Options/OutdatedOptions.swift | 13 +++++++++ 2 files changed, 42 insertions(+) create mode 100644 Executable/Sources/Commands/OutdatedCommand.swift create mode 100644 Executable/Sources/Options/OutdatedOptions.swift diff --git a/Executable/Sources/Commands/OutdatedCommand.swift b/Executable/Sources/Commands/OutdatedCommand.swift new file mode 100644 index 0000000..686da2b --- /dev/null +++ b/Executable/Sources/Commands/OutdatedCommand.swift @@ -0,0 +1,29 @@ +import ArgumentParser +import ColibriLibrary + +extension Colibri { + struct Outdated: AsyncParsableCommand { + + // MARK: Properties + + static let configuration = CommandConfiguration( + commandName: "outdated-dependencies", + abstract: "Check for outdated package dependencies in a Hummingbird app", + helpNames: .shortAndLong, + aliases: ["outdated"] + ) + + @OptionGroup var options: Options + + // MARK: Functions + + mutating func run() async throws { + let terminalService = TerminalService() + + let outdatedDependencies = OutdatedDependenciesTask(terminalService: terminalService) + + try await outdatedDependencies(at: options.locationURL) + } + + } +} diff --git a/Executable/Sources/Options/OutdatedOptions.swift b/Executable/Sources/Options/OutdatedOptions.swift new file mode 100644 index 0000000..ab501b9 --- /dev/null +++ b/Executable/Sources/Options/OutdatedOptions.swift @@ -0,0 +1,13 @@ +import ArgumentParser +import ColibriLibrary + +extension Colibri.Outdated { + struct Options: ParsableArguments, Locationable { + + // MARK: Properties + + @Option(name: .shortAndLong) + var location: String? + + } +}