I am trying to create a Mac application that in some cases should return an error code. This is an Intel package. (This is a Carbon C ++ project, but it probably doesn't matter.)
The standard way to do this in C ++ should be for the main function to return a value, and that I do, so I believe that this part is correct. (I also tried to explicitly call exit(42))
Question: how do I get this value?
When I launch the application from the terminal using open myapp, the return value is always 0, even if I always return a different number. (verified using echo $?)
Is this the return value from the open command and is the missing value of the application returned by me somewhere?
I also always get a return code 0if I run it from another program using execve(this is how the application is assigned to be used).
Can I get a return code from the application?
Sidenote : I need the program to be bundled.
source
share