feat: migrate Mac mini services into Reyna CLI
This commit is contained in:
@@ -5,6 +5,19 @@ import Foundation
|
||||
// Headless design: socket-server or stdin JSON-lines mode only.
|
||||
|
||||
public func runReynaCLIHost(arguments: [String] = CommandLine.arguments) -> Never {
|
||||
let hasSocket = arguments.contains("--socket")
|
||||
let hasPython = arguments.contains("--python")
|
||||
|
||||
if hasSocket && hasPython {
|
||||
fputs("error: --python cannot be combined with --socket\n", stderr)
|
||||
Darwin.exit(2)
|
||||
}
|
||||
|
||||
if let idx = arguments.firstIndex(of: "--python") {
|
||||
let forwardedArguments = Array(arguments.dropFirst(idx + 1))
|
||||
Darwin.exit(runPythonCLI(forwardedArguments: forwardedArguments))
|
||||
}
|
||||
|
||||
if let idx = arguments.firstIndex(of: "--socket") {
|
||||
let nextIdx = idx + 1
|
||||
guard nextIdx < arguments.count else {
|
||||
|
||||
Reference in New Issue
Block a user