From bc94bb76c624448be7e75b550e562de71db32ccb Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sat, 13 Apr 2019 14:48:21 +0200 Subject: [PATCH] fixed return value when invoking software with help flag --- src/main.cc | 1 - src/parseargs.cc | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.cc b/src/main.cc index b062385..fe76031 100644 --- a/src/main.cc +++ b/src/main.cc @@ -19,5 +19,4 @@ int main(int ac, char** av) ImageManipulator image_process{input_file, output_file, iterations}; image_process.exec_method(method, controlled_size); image_process.write_file(); - return 0; } diff --git a/src/parseargs.cc b/src/parseargs.cc index c60f611..b5bbd42 100644 --- a/src/parseargs.cc +++ b/src/parseargs.cc @@ -43,7 +43,7 @@ void processFilenames(po::variables_map const& vm, po::notify(vm); if (vm.count("help") || !vm.count("input")) { std::cout << desc << "\n"; - std::exit(1); + std::exit(!vm.count("help")); } auto const input_path = vm["input"].as();