mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-03 20:35:17 +02:00
Fix exit codes:
- `--help`, `--version` etc should exit with `0` i.e. no error ("not enough args" case should still trigger an error)
- error reading config file should exit with `1`
Slightly refactor AppInitRPC/AppInitRawTx to return standard exit codes (EXIT_FAILURE/EXIT_SUCCESS) or CONTINUE_EXECUTION (-1)
This commit is contained in:
@@ -573,7 +573,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
HelpMessageDialog help(NULL, mapArgs.count("-version"));
|
||||
help.showOrPrint();
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// 5. Now that settings and translations are available, ask user for data directory
|
||||
@@ -594,7 +594,7 @@ int main(int argc, char *argv[])
|
||||
} catch (const std::exception& e) {
|
||||
QMessageBox::critical(0, QObject::tr(PACKAGE_NAME),
|
||||
QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what()));
|
||||
return false;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/// 7. Determine network (and switch to network specific options)
|
||||
|
||||
Reference in New Issue
Block a user