How to set exit code value for a command line utility in Swift?

swift

Solution

Found it! You should just call:

exit(yourExitCode)

Note: there is no need at all to import "Darwin" or anything else. (For a decade now!) Simply `exit(0)` is fine.

Problem

I can't find it in the language reference. The standard template doesn't give a clue: ``` import Foundation println("Calculating") // How to set and exit code when I done? ```

Original source