AppImageUpdate icon indicating copy to clipboard operation
AppImageUpdate copied to clipboard

appimageupdatetool --check-for-update returns 1 for missing files

Open JnCrMx opened this issue 1 year ago • 0 comments

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.

JnCrMx avatar Oct 30 '24 03:10 JnCrMx