Is there a way to check if the program was started with -ea so that I can exit/fail if it wasn’t? If an assertion fails, I want to be informed about it. Therefore, I consider it a critical error to start up without this.
Is there a way to check if the program was started with -ea so
Share
Make an assertion guaranteed to fail.
If code after that assertion runs, assertions weren’t enabled.
That said, I’m not 100% convinced forcing assertions is a great idea. IMO assertions are more for development rather than normal error checking/handling.