diff --git a/main.cpp b/main.cpp index 9ef50628..346e18ab 100644 --- a/main.cpp +++ b/main.cpp @@ -74,28 +74,28 @@ class CDnsSeedOpts { {"testnet", no_argument, &fUseTestNet, 1}, {"wipeban", no_argument, &fWipeBan, 1}, {"wipeignore", no_argument, &fWipeBan, 1}, - {"help", no_argument, 0, 'h'}, + {"help", no_argument, 0, '?'}, {0, 0, 0, 0} }; int option_index = 0; - int c = getopt_long(argc, argv, "h:n:m:t:a:p:d:o:i:k:w:", long_options, &option_index); + int c = getopt_long(argc, argv, "h:n:m:t:a:p:d:o:i:k:w:?", long_options, &option_index); if (c == -1) break; switch (c) { case 'h': { host = optarg; break; } - + case 'm': { mbox = optarg; break; } - + case 'n': { ns = optarg; break; } - + case 't': { int n = strtol(optarg, NULL, 10); if (n > 0 && n < 1000) nThreads = n; @@ -174,7 +174,10 @@ class CDnsSeedOpts { filter_whitelist.insert(NODE_NETWORK_LIMITED | NODE_WITNESS | NODE_BLOOM); // x40c } if (host != NULL && ns == NULL) showHelp = true; - if (showHelp) fprintf(stderr, help, argv[0]); + if (showHelp) { + fprintf(stderr, help, argv[0]); + exit(0); + } } };