Skip to content

Commit 411169f

Browse files
committed
2/2 Skip Xcode CLI args instead of aborting CLI args parsing alltogether
1 parent 1d8f0ba commit 411169f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Sources/AppBundle/initAppBundle.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ private func initServerArgs() {
8787
case "--read-only": // todo rename to '--disabled' and unite with disabled feature
8888
_serverArgs.isReadOnly = true
8989
case "-NSDocumentRevisionsDebugMode" where isDebug:
90-
printStderr("Running from Xcode. Skip args parsing... The args were: \(CommandLine.arguments.dropFirst())")
91-
return
90+
// Skip Xcode CLI args.
91+
// Usually it's '-NSDocumentRevisionsDebugMode NO'/'-NSDocumentRevisionsDebugMode YES'
92+
while args.getOrNil(atIndex: index)?.starts(with: "-") == false { index += 1 }
9293
default:
9394
cliError("Unrecognized flag '\(args.first.orDie())'")
9495
}

0 commit comments

Comments
 (0)