style: Apply SwiftFormat formatting

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Peter Steinberger 2025-06-08 07:29:37 +01:00
parent 141502d668
commit 9837e7bea8
4 changed files with 32 additions and 30 deletions

View file

@ -250,11 +250,12 @@ struct ImageCommand: ParsableCommand {
let targetApp: NSRunningApplication
do {
targetApp = try ApplicationFinder.findApplication(identifier: appIdentifier)
} catch ApplicationError.notFound(let identifier) {
} catch let ApplicationError.notFound(identifier) {
throw CaptureError.appNotFound(identifier)
} catch ApplicationError.ambiguous(let identifier, let matches) {
} catch let ApplicationError.ambiguous(identifier, matches) {
let appNames = matches.map { $0.localizedName ?? $0.bundleIdentifier ?? "Unknown" }
throw CaptureError.unknownError("Multiple applications match '\(identifier)': \(appNames.joined(separator: ", "))")
throw CaptureError
.unknownError("Multiple applications match '\(identifier)': \(appNames.joined(separator: ", "))")
}
if captureFocus == .foreground || (captureFocus == .auto && !targetApp.isActive) {
@ -304,11 +305,12 @@ struct ImageCommand: ParsableCommand {
let targetApp: NSRunningApplication
do {
targetApp = try ApplicationFinder.findApplication(identifier: appIdentifier)
} catch ApplicationError.notFound(let identifier) {
} catch let ApplicationError.notFound(identifier) {
throw CaptureError.appNotFound(identifier)
} catch ApplicationError.ambiguous(let identifier, let matches) {
} catch let ApplicationError.ambiguous(identifier, matches) {
let appNames = matches.map { $0.localizedName ?? $0.bundleIdentifier ?? "Unknown" }
throw CaptureError.unknownError("Multiple applications match '\(identifier)': \(appNames.joined(separator: ", "))")
throw CaptureError
.unknownError("Multiple applications match '\(identifier)': \(appNames.joined(separator: ", "))")
}
if captureFocus == .foreground || (captureFocus == .auto && !targetApp.isActive) {
@ -507,7 +509,7 @@ struct ImageCommand: ParsableCommand {
// Only consider it a permission error if it mentions both "permission" and capture-related terms
if errorString.contains("permission") &&
(errorString.contains("capture") || errorString.contains("recording") || errorString.contains("screen")) {
(errorString.contains("capture") || errorString.contains("recording") || errorString.contains("screen")) {
return true
}

View file

@ -74,12 +74,12 @@ struct AppsSubcommand: ParsableCommand {
Foundation.exit(captureError.exitCode)
}
internal func printApplicationList(_ applications: [ApplicationInfo]) {
func printApplicationList(_ applications: [ApplicationInfo]) {
let output = formatApplicationList(applications)
print(output)
}
internal func formatApplicationList(_ applications: [ApplicationInfo]) -> String {
func formatApplicationList(_ applications: [ApplicationInfo]) -> String {
var output = "Running Applications (\(applications.count)):\n\n"
for (index, app) in applications.enumerated() {