MCPcopy Create free account
hub / github.com/apache/cloudberry / exec_command_help

Function exec_command_help

src/bin/psql/command.c:1548–1574  ·  view source on GitHub ↗

* \help [topic] -- print help about SQL commands */

Source from the content-addressed store, hash-verified

1546 * \help [topic] -- print help about SQL commands
1547 */
1548static backslashResult
1549exec_command_help(PsqlScanState scan_state, bool active_branch)
1550{
1551 if (active_branch)
1552 {
1553 char *opt = psql_scan_slash_option(scan_state,
1554 OT_WHOLE_LINE, NULL, false);
1555 size_t len;
1556
1557 /* strip any trailing spaces and semicolons */
1558 if (opt)
1559 {
1560 len = strlen(opt);
1561 while (len > 0 &&
1562 (isspace((unsigned char) opt[len - 1])
1563 || opt[len - 1] == ';'))
1564 opt[--len] = '\0';
1565 }
1566
1567 helpSQL(opt, pset.popt.topt.pager);
1568 free(opt);
1569 }
1570 else
1571 ignore_slash_whole_line(scan_state);
1572
1573 return PSQL_CMD_SKIP_LINE;
1574}
1575
1576/*
1577 * \H and \html -- toggle HTML formatting

Callers 1

exec_commandFunction · 0.85

Calls 2

helpSQLFunction · 0.85
ignore_slash_whole_lineFunction · 0.85

Tested by

no test coverage detected