From 267b9065ffba08967f2aee954bdf41a212249365 Mon Sep 17 00:00:00 2001 From: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> Date: Fri, 9 Jan 2026 10:13:05 -0500 Subject: [PATCH] =?UTF-8?q?Output=20error=20when=20`uninstall=20--all=20=E2=80=A6`=20=20or=20`uninstall`=20without=20args.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> --- Sources/mas/Commands/Uninstall.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/mas/Commands/Uninstall.swift b/Sources/mas/Commands/Uninstall.swift index 898d24e9..ab3dbefc 100644 --- a/Sources/mas/Commands/Uninstall.swift +++ b/Sources/mas/Commands/Uninstall.swift @@ -25,6 +25,16 @@ extension MAS { @OptionGroup private var installedAppIDsOptionGroup: InstalledAppIDsOptionGroup + func validate() throws { + if isUninstallingAll != installedAppIDsOptionGroup.appIDs.isEmpty { + throw ValidationError( + isUninstallingAll + ? "Cannot specify both --all & app IDs" // swiftformat:disable:this indent + : "Must specify either --all or at least one app ID", + ) + } + } + func run() async throws { try run(installedApps: try await installedApps) }