1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-11-08 03:22:25 +03:00

Start work on C handle io object and use it to output help.

This commit is contained in:
David Steele
2018-03-25 11:39:24 -04:00
parent 9001b9b957
commit c1ab7b3c98
8 changed files with 76 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ Help Command
#include <string.h>
#include <unistd.h>
#include "common/io/handle.h"
#include "common/memContext.h"
#include "common/type.h"
#include "config/config.h"
@@ -337,10 +338,7 @@ cmdHelp()
{
MEM_CONTEXT_TEMP_BEGIN()
{
String *help = helpRender();
if (write(STDOUT_FILENO, strPtr(help), strSize(help)) != (int)strSize(help)) // {uncovered - write does not fail}
THROW_SYS_ERROR(FileWriteError, "unable to write help to stdout"); // {uncovered+}
ioHandleWriteOneStr(STDOUT_FILENO, helpRender());
}
MEM_CONTEXT_TEMP_END();
}