So apparently in case of ./test, the exit code was 0. The same holds true for ./text --param 1. In both cases, something went wrong (invalid parameter values, CommandFunc returned an error). It is common practice (and necessary requirement for every sysadmin to detect problems by looking for non-zero exit codes) to return non-zero if the software could not complete its main task correctly.
Technically, it seems to be the responsibility of the main routine to return the exit code. However, the whole information regarding the exit code is lost in the abstractions of cli. Therefore I am requesting for appropriate fixes to give a proper exit code.
Consider the following example:
Now let us run this example:
So apparently in case of
./test
, the exit code was 0. The same holds true for./text --param 1
. In both cases, something went wrong (invalid parameter values, CommandFunc returned an error). It is common practice (and necessary requirement for every sysadmin to detect problems by looking for non-zero exit codes) to return non-zero if the software could not complete its main task correctly.Technically, it seems to be the responsibility of the main routine to return the exit code. However, the whole information regarding the exit code is lost in the abstractions of cli. Therefore I am requesting for appropriate fixes to give a proper exit code.