For an odd use case, I'm developing a macOS application (yes, a .app) which uses the Swift package ArgumentParser.
When launching an app, macOS inserts the command-line argument -NSDocumentRevisionsDebugMode YES
. I do not need the value of this argument, but my ParsableCommand
must declare it as an @Option
anyhow. Otherwise, my app prints to the console Error: Unknown option … Usage: …
, and then quits.
This -NSDocumentRevisionsDebugMode YES
was not in macOS app launches 20 years ago. If in the future Apple adds some other weird argument to app launching, my app will break.
Is there any way to tell ArgumentParser to just relax and ignore unknown arguments?