util: improve bitcoin-wallet exit codes#24428
Closed
fanquake wants to merge 2 commits intobitcoin:masterfrom
Closed
util: improve bitcoin-wallet exit codes#24428fanquake wants to merge 2 commits intobitcoin:masterfrom
fanquake wants to merge 2 commits intobitcoin:masterfrom
Conversation
maflcko
reviewed
Feb 23, 2022
Adjust the exit codes / functionality of bitcoin-wallet such that it's not returning a non-zero exit code if there isn't a problem. This is a followup from bitcoin#24263, and should allow us to add and additional check=True to our gen-manpages.py script.
Now that bitcoin-wallet no-longer returns a non-zero exit code when it shouldn't do, we can add check=True to our subprocess call. Follows up to the comments in bitcoin#24263 (comment).
394fdcc to
dd532ee
Compare
laanwj
reviewed
Feb 23, 2022
| } | ||
|
|
||
| static bool WalletAppInit(ArgsManager& args, int argc, char* argv[]) | ||
| static int WalletAppInit(ArgsManager& args, int argc, char* argv[]) |
Member
There was a problem hiding this comment.
Could maybe make this option<int>, a categorical difference seems slightly neater to me than reserving a return code for continuing execution.
Member
There was a problem hiding this comment.
Especially since EXIT_SUCCESS and EXIT_FAILURE are not guaranteed to be non--1 :)
Member
|
Concept ACK |
1 similar comment
Contributor
|
Concept ACK |
luke-jr
reviewed
Mar 11, 2022
Comment on lines
+116
to
+118
| if (ret != CONTINUE_EXECUTION) { | ||
| return ret; | ||
| } |
Member
There was a problem hiding this comment.
Maybe it'd be better to just have WalletAppInit call exit(2) directly?
Contributor
|
Concept ACK |
Member
|
Alternative in #26067 using |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactors
bitcoin-walletso that it doesn't return a non-zero exit code by default, and makes the option handling more inline with the other binaries. i.e outputtingError: too few parametersif you don't pass any options.Fixing this means we can check the process output in
gen-manpages.py; which addresses the remaining review comment from #24263.