I use a .app
to bundle my command line tool (I use a framework).
To quit the app, I use NSapp.terminate(self)
and catch it:
func applicationWillTerminate(_ aNotification: Notification) {
if exitSuccessful {
print("successful")
} else {
print("not successful")
exit(1)
}
}
Doing so exits the application, but quite harshly, as no deconstruction/release or anything is done after exit(1). On my machine, exit code is set correctly, but I had reports it exits with code 132 (SIGILL).
I've found something related, but only for "pure" command line utilities: http://ericasadun.com/2014/06/13/swift-command-line-exit-codes/
Any idea?