mirror of
https://github.com/apple/container.git
synced 2026-08-28 02:24:17 -05:00
Adds a warning when running a debug build (#201)
This PR adds a warning that the performance may be degraded when running a debug build. Debug build: ``` % bin/container run -it --rm alpine:latest date Warning! Running debug build. Performance may be degraded. Fri Jun 13 18:10:35 PDT 2025 ``` Release build: ``` % bin/container run -it --rm alpine:latest date Fri Jun 13 18:10:35 PDT 2025 ```
This commit is contained in:
@@ -150,6 +150,13 @@ struct Application: AsyncParsableCommand {
|
||||
public static func main() async throws {
|
||||
restoreCursorAtExit()
|
||||
|
||||
#if DEBUG
|
||||
let warning = "Running debug build. Performance may be degraded."
|
||||
let formattedWarning = "\u{001B}[33mWarning!\u{001B}[0m \(warning)\n"
|
||||
let warningData = Data(formattedWarning.utf8)
|
||||
FileHandle.standardError.write(warningData)
|
||||
#endif
|
||||
|
||||
let fullArgs = CommandLine.arguments
|
||||
let args = Array(fullArgs.dropFirst())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user