From c93be2ee3c98c5b8517e0a1a40a36fe05b2cf0a9 Mon Sep 17 00:00:00 2001 From: bartosz_sobol Date: Wed, 26 Jun 2019 22:41:43 +0200 Subject: [PATCH] add_options variant with initializer list --- include/cxxopts.hpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 1381ab3..9eed260 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -1220,6 +1220,14 @@ namespace cxxopts std::vector m_sequential; }; + + struct Option + { + std::string opts; + std::string desc; + std::shared_ptr value = ::cxxopts::value(); + std::string arg_help = ""; + }; class Options { @@ -1272,6 +1280,13 @@ namespace cxxopts OptionAdder add_options(std::string group = ""); + + void + add_options + ( + const std::string& group, + std::initializer_list