* \help [topic] -- print help about SQL commands */
| 1546 | * \help [topic] -- print help about SQL commands |
| 1547 | */ |
| 1548 | static backslashResult |
| 1549 | exec_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 |
no test coverage detected