We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7f4b7e7 + 04566f0 commit 199cdedCopy full SHA for 199cded
1 file changed
Sources/MacLocalAPI/main.swift
@@ -637,8 +637,22 @@ if CommandLine.arguments.count > 1 && CommandLine.arguments[1] == "mlx" {
637
} else if CommandLine.arguments.count > 1 && CommandLine.arguments[1] == "vision" {
638
let args = Array(CommandLine.arguments.dropFirst(2))
639
do {
640
- var cmd = try VisionCommand.parseAsRoot(args)
641
- try cmd.run()
+ let cmd = try VisionCommand.parse(args)
+ let group = DispatchGroup()
642
+ var caughtError: Error?
643
+ group.enter()
644
+ Task {
645
+ do {
646
+ try await cmd.run()
647
+ } catch {
648
+ caughtError = error
649
+ }
650
+ group.leave()
651
652
+ group.wait()
653
+ if let error = caughtError {
654
+ throw error
655
656
} catch {
657
VisionCommand.exit(withError: error)
658
}
0 commit comments