aboutsummaryrefslogtreecommitdiff
path: root/src/bench
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2018-04-28 19:40:51 -0400
committerAndrew Chow <achow101-github@achow101.com>2018-05-30 11:27:50 -0400
commit4f8704d57f8fb2958a43534779b20201b77eecae (patch)
tree4ccb64e2e65e99726786919d6d0feecde2e26377 /src/bench
parent174f7c80801383cde5ea514b19fb8b108b56b31c (diff)
downloadbitcoin-4f8704d57f8fb2958a43534779b20201b77eecae.tar.xz
Give an error and exit if there are unknown parameters
If an unknown option is given via either the command line args or the conf file, throw an error and exit Update tests for ArgsManager knowing args Ignore unknown options in the config file for bitcoin-cli Fix tests and bitcoin-cli to match actual options used
Diffstat (limited to 'src/bench')
-rw-r--r--src/bench/bench_bitcoin.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bench/bench_bitcoin.cpp b/src/bench/bench_bitcoin.cpp
index 1a2671e8d1..a820d67fa8 100644
--- a/src/bench/bench_bitcoin.cpp
+++ b/src/bench/bench_bitcoin.cpp
@@ -33,13 +33,21 @@ static void SetupBenchArgs()
gArgs.AddArg("-plot-plotlyurl=<uri>", strprintf("URL to use for plotly.js (default: %s)", DEFAULT_PLOT_PLOTLYURL), false, OptionsCategory::OPTIONS);
gArgs.AddArg("-plot-width=<x>", strprintf("Plot width in pixel (default: %u)", DEFAULT_PLOT_WIDTH), false, OptionsCategory::OPTIONS);
gArgs.AddArg("-plot-height=<x>", strprintf("Plot height in pixel (default: %u)", DEFAULT_PLOT_HEIGHT), false, OptionsCategory::OPTIONS);
+
+ // Hidden
+ gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN);
+ gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN);
}
int
main(int argc, char** argv)
{
SetupBenchArgs();
- gArgs.ParseParameters(argc, argv);
+ std::string error;
+ if (!gArgs.ParseParameters(argc, argv, error)) {
+ fprintf(stderr, "Error parsing command line arguments: %s\n", error.c_str());
+ return false;
+ }
if (HelpRequested(gArgs)) {
std::cout << gArgs.GetHelpMessage();