From d12ca190e0bcc36dcdd520b5815d76c80d883b8c Mon Sep 17 00:00:00 2001 From: Sam Deane Date: Thu, 29 Aug 2024 18:17:43 +0100 Subject: [PATCH] added workspace option --- Sources/ReleaseTools/OptionParser.swift | 2 +- Sources/ReleaseTools/RootCommand.swift | 1 + Sources/ReleaseTools/SharedOptions.swift | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/ReleaseTools/OptionParser.swift b/Sources/ReleaseTools/OptionParser.swift index e7929d7..2341529 100644 --- a/Sources/ReleaseTools/OptionParser.swift +++ b/Sources/ReleaseTools/OptionParser.swift @@ -155,7 +155,7 @@ class OptionParser { // if we've specified the scheme or user, we also need the workspace if requirements.contains(.workspace) || scheme != nil || user != nil { - if let workspace = defaultWorkspace { + if let workspace = options.workspace ?? defaultWorkspace { self.workspace = workspace } else { throw GeneralError.missingWorkspace diff --git a/Sources/ReleaseTools/RootCommand.swift b/Sources/ReleaseTools/RootCommand.swift index ee6528d..e4d32bc 100644 --- a/Sources/ReleaseTools/RootCommand.swift +++ b/Sources/ReleaseTools/RootCommand.swift @@ -25,6 +25,7 @@ import Runner struct RootCommand: AsyncParsableCommand { static var configuration: CommandConfiguration { CommandConfiguration( + commandName: "rt", abstract: "Assorted tools for iOS/macOS releases.", subcommands: [ AppcastCommand.self, diff --git a/Sources/ReleaseTools/SharedOptions.swift b/Sources/ReleaseTools/SharedOptions.swift index b0dacac..0c06ee3 100644 --- a/Sources/ReleaseTools/SharedOptions.swift +++ b/Sources/ReleaseTools/SharedOptions.swift @@ -64,4 +64,6 @@ struct UpdatesOption: ParsableArguments { struct CommonOptions: ParsableArguments { @Flag(help: "Show the external commands that we're executing, and the output from them.") var showOutput = false @Flag(help: "Show extra logging.") var verbose = false + @Option(help: "The workspace we're operating on.") + var workspace: String? }