scala main returns unit. How to set program's return value

Viewed 11340

The method prototype for main is:

def main(args: Array[String]): Unit

Typically, an application needs to specify a return code when it exits. How is that typically done in scala if main returns Unit? Should I call System.exit(n)?

Also, the docs warn that I should not use main at all, though this seems at odds with the getting started guide).

What's the best practice here?

1 Answers
Related