If I run appimageupdatetool -j file-that-does-not-exist it returns the exit code 1 indicating that an update is available. The same happens if no positional argument at all gets passed to the program.
Looking at src/cli/main.cpp this happens because the file argument is checked before the mode of operation is considered.
However, this creates a contradiction with the help text "Exits with code 1 if changes are available, 0 if there are not,other non-zero code in case of errors" and makes using appimageupdatetool within scripts or other programs very annoying, since it is impossible to tell if the program exited with code 1 because the file is not available (or the argument missing if I simple use $APPIMAGE) or because an update is really available.
It would be very helpful and more robust to have completely distinct exit codes, so either a different exit code for the cases of a missing argument/missing file or a different exit code to indicate that an update is available.
If I run
appimageupdatetool -j file-that-does-not-existit returns the exit code 1 indicating that an update is available. The same happens if no positional argument at all gets passed to the program.Looking at
src/cli/main.cppthis happens because the file argument is checked before the mode of operation is considered.However, this creates a contradiction with the help text "Exits with code 1 if changes are available, 0 if there are not,other non-zero code in case of errors" and makes using
appimageupdatetoolwithin scripts or other programs very annoying, since it is impossible to tell if the program exited with code 1 because the file is not available (or the argument missing if I simple use$APPIMAGE) or because an update is really available.It would be very helpful and more robust to have completely distinct exit codes, so either a different exit code for the cases of a missing argument/missing file or a different exit code to indicate that an update is available.