-
Notifications
You must be signed in to change notification settings - Fork 1.7k
--help option returns 1, not 0 #8851
Comments
Thanks for reporting, @MarkusTeufelberger. Confirming this is happening and is not as we want it to be. Looks like we are not properly using docopts to figure out, whether we have a fatal or non-fatal exit. I have a patch for that.
Can you tell me which ones show that behaviour? |
Did you try the official binaries or are you building from master? I tried the binaries (1.10.6 as mentioned above) and all 4 had this behavior in a ubuntu:18.04 docker container from dockerhub. |
Docopt handles `--help` automatically for us, however we've handled those Errors the same as all others: by exiting with Return Code `1`, which is wrong for a totally appropriate a quit on `--help`. Fortunately `docopt:Error` provides an `exit` helper function that discriminates properly between fatal and non-fatal errors and exist appropriately. This patch makes sure we use that handy function in case we encounter such an error in the CLI of ethkey, ethstore and whisper. Thus those are now giving the appropriate Return code on `--help`. fixes openethereum#8851
@MarkusTeufelberger yes, I am checking this against I was able to confirm the bug on the CLI of |
Thanks! :-) |
Docopt handles `--help` automatically for us, however we've handled those Errors the same as all others: by exiting with Return Code `1`, which is wrong for a totally appropriate a quit on `--help`. Fortunately `docopt:Error` provides an `exit` helper function that discriminates properly between fatal and non-fatal errors and exist appropriately. This patch makes sure we use that handy function in case we encounter such an error in the CLI of ethkey, ethstore and whisper. Thus those are now giving the appropriate Return code on `--help`. fixes #8851
Docopt handles `--help` automatically for us, however we've handled those Errors the same as all others: by exiting with Return Code `1`, which is wrong for a totally appropriate a quit on `--help`. Fortunately `docopt:Error` provides an `exit` helper function that discriminates properly between fatal and non-fatal errors and exist appropriately. This patch makes sure we use that handy function in case we encounter such an error in the CLI of ethkey, ethstore and whisper. Thus those are now giving the appropriate Return code on `--help`. fixes #8851
Your issue description goes here below. Try to include actual vs. expected behavior and steps to reproduce the issue.
Expected behavior:
ethkeys --help
(and the other binaries too) display a help message and exist the binary with code 0.Actual behavior:
All binaries return with 1 instead. This usually indicates some failure mode.
The text was updated successfully, but these errors were encountered: