From 97a736429b937c54f83c77551d375bee4fd6ed0d Mon Sep 17 00:00:00 2001 From: Bjoern Forsberg Date: Fri, 17 Mar 2017 14:03:20 +0100 Subject: [PATCH] More general check for help-flag(s) --- src/args.cpp | 5 +++++ src/autopicker.cpp | 2 +- src/ml_optimiser.cpp | 7 ------- src/ml_optimiser_mpi.cpp | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/args.cpp b/src/args.cpp index 7bdd3a482..d12fe11de 100644 --- a/src/args.cpp +++ b/src/args.cpp @@ -249,6 +249,11 @@ void IOParser::writeCommandLine(std::ostream &out) bool IOParser::checkForErrors(int verb) { + if(argc==1 || checkParameter(argc, argv, "--help") || checkParameter(argc, argv, "-h")) + { + writeUsage(std::cout); + exit(0); + } // First check the command line for unknown arguments checkForUnknownArguments(); diff --git a/src/autopicker.cpp b/src/autopicker.cpp index ffffd8535..87142c8ed 100644 --- a/src/autopicker.cpp +++ b/src/autopicker.cpp @@ -141,7 +141,7 @@ void AutoPicker::read(int argc, char **argv) int expert_section = parser.addSection("Expert options"); verb = textToInteger(parser.getOption("--verb", "Verbosity", "1")); random_seed = textToInteger(parser.getOption("--random_seed", "Number for the random seed generator", "1")); - workFrac = textToFloat(parser.getOption("--shrink", "Reduce micrograph to this fraction size, during correlation calc (saves emory and time)", "1.0")); + workFrac = textToFloat(parser.getOption("--shrink", "Reduce micrograph to this fraction size, during correlation calc (saves memory and time)", "1.0")); // Check for errors in the command-line option if (parser.checkForErrors()) diff --git a/src/ml_optimiser.cpp b/src/ml_optimiser.cpp index 5c1e7701d..e6b00abf3 100644 --- a/src/ml_optimiser.cpp +++ b/src/ml_optimiser.cpp @@ -110,13 +110,6 @@ void MlOptimiser::read(int argc, char **argv, int rank) // Start a new run from scratch parseInitial(argc, argv); } - - if(argc==1 || checkParameter(argc, argv, "--help") || checkParameter(argc, argv, "-h")) - { - usage(); - exit(0); - } - } void MlOptimiser::parseContinue(int argc, char **argv) diff --git a/src/ml_optimiser_mpi.cpp b/src/ml_optimiser_mpi.cpp index a31cf85a6..dd1d37463 100644 --- a/src/ml_optimiser_mpi.cpp +++ b/src/ml_optimiser_mpi.cpp @@ -429,7 +429,7 @@ void MlOptimiserMpi::initialise() use an estimated image-size of " << LowBoxLim << " pixels during the last iteration...\n\n\ ...but your input box-size (image_size) is however " << t_ori_size << ". This means that \n\ you will likely run out of memory on the GPU(s), and will have to then re-start \n\ -from the last completed iteration (i.e. continue from it) with the use of GPUs.\n " << std::endl; +from the last completed iteration (i.e. continue from it) *without* the use of GPUs.\n " << std::endl; if(is_split) {