aboutsummaryrefslogtreecommitdiff
path: root/test.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'test.cxx')
-rw-r--r--test.cxx63
1 files changed, 63 insertions, 0 deletions
diff --git a/test.cxx b/test.cxx
index 18b8c69..597eaae 100644
--- a/test.cxx
+++ b/test.cxx
@@ -793,6 +793,69 @@ TEST_CASE("Subparser help works as expected", "[args]")
-f flag
)");
+
+ p.ParseArgs(std::vector<std::string>{});
+ s.str("");
+ s << p;
+ REQUIRE(s.str() == R"( git {OPTIONS}
+
+ git-like parser
+
+ OPTIONS:
+
+ -g global flag
+ add add file contents to the index
+ commit record changes to the repository
+
+)");
+
+
+ p.helpParams.showCommandChildren = true;
+ p.ParseArgs(std::vector<std::string>{});
+ s.str("");
+ s << p;
+ REQUIRE(s.str() == R"( git {OPTIONS}
+
+ git-like parser
+
+ OPTIONS:
+
+ -g global flag
+ add add file contents to the index
+ -f flag
+ commit record changes to the repository
+ -f flag
+
+)");
+
+ commit.Epilog("epilog");
+ p.helpParams.showCommandFullHelp = true;
+ p.ParseArgs(std::vector<std::string>{});
+ s.str("");
+ s << p;
+ REQUIRE(s.str() == R"( git {OPTIONS}
+
+ git-like parser
+
+ OPTIONS:
+
+ -g global flag
+ add {OPTIONS}
+
+ add file contents to the index
+
+ -f flag
+
+ commit {OPTIONS}
+
+ record changes to the repository
+
+ -f flag
+
+ epilog
+
+)");
+
}
#undef ARGS_HXX