From ae2d59e5c229d3a223aea52b543e21c6600f6a67 Mon Sep 17 00:00:00 2001 From: Fedor Korotkov Date: Tue, 19 Mar 2024 04:28:27 -0400 Subject: [PATCH] Revert "Do not magically set --no-graphics when --vnc is passed (#763) * Revert "Do not magically set `--no-graphics` when `--vnc` is passed (#732)" This reverts commit a48f4d4ec937a227d5f90efd79e989c661d48ccd. * Mark `--graphics` as private --- Sources/tart/Commands/Run.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Sources/tart/Commands/Run.swift b/Sources/tart/Commands/Run.swift index 07c138d..84e3e28 100644 --- a/Sources/tart/Commands/Run.swift +++ b/Sources/tart/Commands/Run.swift @@ -33,7 +33,7 @@ struct Run: AsyncParsableCommand { )) var serialPath: String? - @Flag(help: ArgumentHelp("Force open a UI window, even when VNC is enabled.", visibility: .hidden)) + @Flag(help: ArgumentHelp("Force open a UI window, even when VNC is enabled.", visibility: .private)) var graphics: Bool = false @Flag(help: "Disable audio pass-through to host.") @@ -149,8 +149,8 @@ struct Run: AsyncParsableCommand { throw ValidationError("--net-bridged, --net-softnet and --net-host are mutually exclusive") } - if graphics { - print("--graphics is deprecated and will be removed in the future.\n") + if graphics && noGraphics { + throw ValidationError("--graphics and --no-graphics are mutually exclusive") } if (noGraphics || vnc || vncExperimental) && captureSystemKeys { @@ -349,7 +349,8 @@ struct Run: AsyncParsableCommand { } sigusr1Src.activate() - if noGraphics { + let useVNCWithoutGraphics = (vnc || vncExperimental) && !graphics + if noGraphics || useVNCWithoutGraphics { // enter the main even loop, without bringing up any UI, // and just wait for the VM to exit. NSApplication.shared.run()