Peekaboo/peekaboo-cli/Sources/peekaboo/main.swift
Peter Steinberger 559349f198 Fix Swift 6 async execution with synchronous adapter
- Add AsyncAdapter.swift to bridge async/sync execution
- Change AsyncParsableCommand back to ParsableCommand
- Implement AsyncRunnable protocol for async execution
- Use DispatchSemaphore pattern for synchronous blocking
- Make ErrorBox thread-safe with @unchecked Sendable

This fixes the CLI execution issue where commands were showing help
instead of executing, by properly bridging the async/sync worlds
as required by ArgumentParser.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 11:34:53 +01:00

20 lines
No EOL
617 B
Swift

import ArgumentParser
import Foundation
@available(macOS 10.15, *)
struct PeekabooCommand: ParsableCommand, AsyncRunnable {
static let configuration = CommandConfiguration(
commandName: "peekaboo",
abstract: "A macOS utility for screen capture, application listing, and window management",
version: Version.current,
subcommands: [ImageCommand.self, ListCommand.self],
defaultSubcommand: ImageCommand.self
)
func runAsync() async throws {
// Root command doesn't do anything, subcommands handle everything
}
}
// Entry point
PeekabooCommand.main()