dump978 icon indicating copy to clipboard operation
dump978 copied to clipboard

Incorrect exit code with `--version`

Open mikenye opened this issue 5 years ago • 5 comments

When running dump978-fa --version, the exit code is non-zero:

root@3f8f97a4cbae:/# dump978-fa --version
dump978-fa db4c8c9
root@3f8f97a4cbae:/# echo $?
64

I believe when running dump978-fa --version that the exit code should be 0 (as no error has occurred with execution).

mikenye avatar May 08 '20 16:05 mikenye

Currently it does this because we don't want the systemd service to continuously restart it if someone incorrectly puts --version on the (service) command line

mutability avatar May 08 '20 16:05 mutability

.. though I guess that wouldn't happen with a zero exit code either, since the service is set up with Restart=on-failure

mutability avatar May 08 '20 16:05 mutability

OK. Thanks for the info.

Is the exit code of 64 specific to --version?

For example, if I'm writing a script that runs dump978 --version after building dump978 (to make sure it executes after building), can I check for exit code 64?

mikenye avatar May 08 '20 16:05 mikenye

I'm fine with changing it to 0, I think that still works with the way the service is set up

mutability avatar May 08 '20 16:05 mutability

OK cool.

My C is... not great. Otherwise I'd fork/change/pull. Apologies I can't help more. :)

mikenye avatar May 08 '20 16:05 mikenye