1
Programming / Any standard on exit codes?
« on: April 30, 2024, 12:54:24 am »
Hi everyone,
I am writing a few tools that can report a number of different conditions, e.g. "target file does not exist," "file can't be read," "wrong file type," "parameter out of range," etc. While well-chosen error messages are the best you can give users, when tools are to be chained, it is better to pass along different numeric return codes. Now the question is, in order to cooperate most properly, every tool must know at least the error codes of the previous one, so I wondered whether we have any kind of standard or guidelines regarding this, instead of having a plethora of necessarily arbitrary values.
Thank you in advance.
I am writing a few tools that can report a number of different conditions, e.g. "target file does not exist," "file can't be read," "wrong file type," "parameter out of range," etc. While well-chosen error messages are the best you can give users, when tools are to be chained, it is better to pass along different numeric return codes. Now the question is, in order to cooperate most properly, every tool must know at least the error codes of the previous one, so I wondered whether we have any kind of standard or guidelines regarding this, instead of having a plethora of necessarily arbitrary values.
Thank you in advance.