From 695be6e4337f5f95ef193e583e0ed7fce698e636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20W=C3=B6lzer?= <martin@libclapp.org> Date: Wed, 24 Aug 2022 17:27:37 +0200 Subject: [PATCH] doc/doc.md: updated formatting of simple_main_parser --- doc/doc.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/doc.md b/doc/doc.md index 49c91a3c..5291cae3 100644 --- a/doc/doc.md +++ b/doc/doc.md @@ -580,7 +580,8 @@ class cli_parser_t : public clapp::basic_main_parser_t { clapp::bool_option_t bool_opt{*this, "bool", 'b', "Bool option."}; - clapp::string_param_option_t string_opt{*this, "str", 's', "String option."}; + clapp::string_param_option_t string_opt{*this, "str", 's', + "String option."}; clapp::string_argument_t string_arg{*this, "string-arg", "String argument"}; @@ -601,9 +602,12 @@ int main(int argc, char *argv[]) { if (exit) { return exit.value().get_exit_code(); } - Ensures(clip.string_arg); // parser ensures mandatory arguments are given - Ensures(clip.bool_opt); // parser ensures mandatory bool-option is given - Ensures(clip.string_opt); // parser ensures mandatory string-option is given + Ensures( + clip.string_arg); // parser ensures mandatory arguments are given + Ensures( + clip.bool_opt); // parser ensures mandatory bool-option is given + Ensures(clip.string_opt); // parser ensures mandatory string-option is + // given std::cout << "string-opt: " << clip.string_opt.value() << std::endl; std::cout << "string-arg: " << clip.string_arg.value() << std::endl; } catch (std::exception &e) { -- GitLab