From 9d6830e8d2da920699a861d880137b91369f6563 Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Sun, 1 Jul 2018 09:04:38 +0200 Subject: [PATCH] Adding more to documentation --- include/CLI/App.hpp | 2 ++ include/CLI/FormatterFwd.hpp | 2 ++ include/CLI/Option.hpp | 6 +++++- include/CLI/Timer.hpp | 1 + include/CLI/TypeTools.hpp | 12 +++++++++--- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/include/CLI/App.hpp b/include/CLI/App.hpp index e5a89f34..80c31ba1 100644 --- a/include/CLI/App.hpp +++ b/include/CLI/App.hpp @@ -1632,6 +1632,7 @@ class App { namespace FailureMessage { +/// Printout a clean, simple message on error (the default in CLI11 1.5+) inline std::string simple(const App *app, const Error &e) { std::string header = std::string(e.what()) + "\n"; if(app->get_help_ptr() != nullptr) @@ -1639,6 +1640,7 @@ inline std::string simple(const App *app, const Error &e) { return header; } +/// Printout the full help string on error (if this fn is set, the old default for CLI11) inline std::string help(const App *app, const Error &e) { std::string header = std::string("ERROR: ") + e.get_name() + ": " + e.what() + "\n"; header += app->help(); diff --git a/include/CLI/FormatterFwd.hpp b/include/CLI/FormatterFwd.hpp index 92bfe651..cfd5fd10 100644 --- a/include/CLI/FormatterFwd.hpp +++ b/include/CLI/FormatterFwd.hpp @@ -97,6 +97,8 @@ class FormatterLambda final : public FormatterBase { } }; +/// This is the default Formatter for CLI11. It pretty prints help output, and is broken into quite a few +/// overridable methods, to be highly customizable with minimal effort. class Formatter : public FormatterBase { public: Formatter() = default; diff --git a/include/CLI/Option.hpp b/include/CLI/Option.hpp index 58c2911e..48b0f7b5 100644 --- a/include/CLI/Option.hpp +++ b/include/CLI/Option.hpp @@ -30,6 +30,8 @@ using Option_p = std::unique_ptr