From be229d25d602b5dc59ce42d15031dd82264432e8 Mon Sep 17 00:00:00 2001 From: tastytea Date: Tue, 25 May 2021 07:12:13 +0200 Subject: [PATCH] Don't demand required options if --help or --version is requested. Bump version to 0.1.2. --- CMakeLists.txt | 2 +- src/options.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 635283d..0bfa657 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The type of build.") set(XGETTEXT_CMD "xgettext" CACHE STRING "The command for xgettext.") project(epubgrep - VERSION 0.1.1 + VERSION 0.1.2 DESCRIPTION "Search tool for EPUB ebooks" LANGUAGES CXX) diff --git a/src/options.cpp b/src/options.cpp index 087f3e4..fad0942 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -102,8 +102,11 @@ po::variables_map parse_options(int argc, char *argv[]) } catch (const boost::program_options::required_option &e) { - cout << options_visible; - std::rethrow_exception(std::current_exception()); + if (vm.count("help") + vm.count("version") == 0) + { + cout << options_visible; + std::rethrow_exception(std::current_exception()); + } } if (vm.count("help") != 0)