1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-05 00:28:52 +02:00

Add help for all internal options valid for default roles.

Fix the segfault when getting help for an internal option is requested by adding help for all internal options that are valid for a default command role.

Also print warnings about internal options in code rather than putting in each command/option description.
This commit is contained in:
David Steele
2021-04-23 11:46:03 -04:00
committed by GitHub
parent 2ad497ea4c
commit aaa15b9709
6 changed files with 238 additions and 62 deletions

View File

@ -67,24 +67,30 @@ testRun(void)
// *****************************************************************************************************************************
if (testBegin("helpRenderText()"))
{
TEST_RESULT_STR_Z(helpRenderText(strNew("this is a short sentence"), 0, false, 80), "this is a short sentence", "one line");
TEST_RESULT_STR_Z(
helpRenderText(strNew("this is a short sentence"), false, 0, false, 80), "this is a short sentence", "one line");
TEST_RESULT_STR_Z(
helpRenderText(strNew("this is a short sentence"), 4, false, 14),
helpRenderText(strNew("this is a short sentence"), false, 4, false, 14),
"this is a\n"
" short\n"
" sentence",
"three lines, no indent first");
TEST_RESULT_STR_Z(
helpRenderText(strNew("This is a short paragraph.\n\nHere is another one."), 2, true, 16),
helpRenderText(strNew("This is a short paragraph.\n\nHere is another one."), true, 2, true, 16),
" This is a\n"
" short\n"
" paragraph.\n"
"\n"
" Here is\n"
" another one.",
"two paragraphs, indent first");
" another one.\n"
"\n"
" FOR INTERNAL\n"
" USE ONLY. DO\n"
" NOT USE IN\n"
" PRODUCTION.",
"two paragraphs, indent first, internal");
}
// *****************************************************************************************************************************