Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Preview/PreviewApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,15 @@ private struct Options {
let raw = try Self.value(after: argument, from: &iterator)
try set(argument, to: raw, explicitSize: &explicitSize)
default:
// Xcode launches the app with NSUserDefaults-style arguments
// such as `-NSDocumentRevisionsDebugMode YES`. Rejecting those
// means Run quits before the window ever appears, so skip any
// single-dash flag and the value that follows it. A misspelt
// `--option` still fails loudly.
guard argument.hasPrefix("--") else {
_ = iterator.next()
continue
}
throw OptionError("unknown argument: \(argument)")
}
}
Expand Down
Loading