From ed72c6f9a1b156b64e05a8fc5e236e6568657d0a Mon Sep 17 00:00:00 2001 From: David Steele Date: Fri, 11 Oct 2024 12:05:23 +0300 Subject: [PATCH] Render command help summaries the same as option help summaries. Option help summaries do not have initial capitals (except in special cases) and final periods so it makes sense to render the command summaries the same way. Use the same function for both so they are consistent. --- src/command/help/help.c | 5 +++- test/src/module/command/helpTest.c | 40 +++++++++++++++--------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/command/help/help.c b/src/command/help/help.c index bfdacec81..b5b8517b5 100644 --- a/src/command/help/help.c +++ b/src/command/help/help.c @@ -404,7 +404,10 @@ helpRender(const Buffer *const helpData) strCatFmt( result, " %s%*s%s\n", cfgParseCommandName(commandId), (int)(commandSizeMax - strlen(cfgParseCommandName(commandId)) + 2), "", - strZ(helpRenderText(commandData[commandId].summary, false, false, commandSizeMax + 6, false, CONSOLE_WIDTH))); + strZ( + helpRenderText( + helpRenderSummary(commandData[commandId].summary), false, false, commandSizeMax + 6, false, + CONSOLE_WIDTH))); } // Construct message for more help diff --git a/test/src/module/command/helpTest.c b/test/src/module/command/helpTest.c index 585e6d483..d88c7a3a3 100644 --- a/test/src/module/command/helpTest.c +++ b/test/src/module/command/helpTest.c @@ -53,26 +53,26 @@ testRun(void) " pgbackrest [options] [command]\n" "\n" "Commands:\n" - " annotate Add or modify backup annotation.\n" - " archive-get Get a WAL segment from the archive.\n" - " archive-push Push a WAL segment to the archive.\n" - " backup Backup a database cluster.\n" - " check Check the configuration.\n" - " expire Expire backups that exceed retention.\n" - " help Get help.\n" - " info Retrieve information about backups.\n" - " repo-get Get a file from a repository.\n" - " repo-ls List files in a repository.\n" - " restore Restore a database cluster.\n" - " server pgBackRest server.\n" - " server-ping Ping pgBackRest server.\n" - " stanza-create Create the required stanza data.\n" - " stanza-delete Delete a stanza.\n" - " stanza-upgrade Upgrade a stanza.\n" - " start Allow pgBackRest processes to run.\n" - " stop Stop pgBackRest processes from running.\n" - " verify Verify contents of the repository.\n" - " version Get version.\n" + " annotate add or modify backup annotation\n" + " archive-get get a WAL segment from the archive\n" + " archive-push push a WAL segment to the archive\n" + " backup backup a database cluster\n" + " check check the configuration\n" + " expire expire backups that exceed retention\n" + " help get help\n" + " info retrieve information about backups\n" + " repo-get get a file from a repository\n" + " repo-ls list files in a repository\n" + " restore restore a database cluster\n" + " server pgBackRest server\n" + " server-ping ping pgBackRest server\n" + " stanza-create create the required stanza data\n" + " stanza-delete delete a stanza\n" + " stanza-upgrade upgrade a stanza\n" + " start allow pgBackRest processes to run\n" + " stop stop pgBackRest processes from running\n" + " verify verify contents of the repository\n" + " version get version\n" "\n" "Use 'pgbackrest help [command]' for more information.\n", helpVersion);