Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

swift

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?
like image 782
Alfa07 Avatar asked Jun 05 '14 09:06

Alfa07


1 Answers

Found it! You should just call:

exit(yourExitCode)
like image 123
Alfa07 Avatar answered Oct 18 '22 20:10

Alfa07