It seems so simple but this does not compile:
procedure Main is
begin
exit 1;
end Main;
When compiled with gprbuild, yields:
Compile
[Ada] main.adb
main.adb:3:04: cannot exit from program unit or accept statement
main.adb:3:08: missing ";"
gprbuild: *** compilation phase failed
The exit keyword in Ada clearly doesn't do what it does in other programming languages. So how do you exit from the ada main procedure with an error code?