 	/**
 	Wait until process is finished.
 
-	- throws: `ShellError.ReturnedErrorCode (command: String, errorcode: Int32)` if the exit code is anything but 0.
+	- throws: `ShellError.ReturnedErrorCode (command: String, errorcode: Int)` if the exit code is anything but 0.
 	*/
 	public func finish() throws {
 		self.waitUntilExit()
 		guard self.terminationStatus == 0 else {
-			throw ShellError.ReturnedErrorCode(command: commandAsString()!, errorcode: self.terminationStatus)
+			throw ShellError.ReturnedErrorCode(command: commandAsString()!, errorcode: Int(self.terminationStatus))
 		}
 	}
 

	main.stderror.write(file + ":\(line): ")
	main.stderror.writeln(errormessage)
	exit(Int32(errorcode))
}

/**
Print message to standard error and halt execution.

- parameter errormessage: the error message.
- parameter errorcode: exit code for the entire program. Defaults to 1.
- returns: not.
*/
public func exit <T> (errormessage: T, errorcode: Int32, file: String = #file, line: Int = #line) -> Never  {
	main.stderror.write(file + ":\(line): ")
	main.stderror.writeln(errormessage)
	exit(errorcode)
}

/**

public enum ShellError: Error, Equatable {

	/** Exit code was not zero. */
	case ReturnedErrorCode (command: String, errorcode: Int)

	/** Command could not be executed. */
	case InAccessibleExecutable (path: String)

	/** Exit code for this error. */
	var errorcode: Int {
		switch self {
		case .ReturnedErrorCode(_, let code):
			return code
