#include "postgres_fe.h"
#include <unistd.h>
#include <sys/ioctl.h>
#include "help.h"
#include "input.h"
#include "settings.h"
#include "sql_help.h"
Go to the source code of this file.
|
void | usage (unsigned short int pager) |
|
void | slashUsage (unsigned short int pager) |
|
◆ HELP0
◆ HELPN
◆ ON
#define ON |
( |
|
var | ) |
((var) ? _("on") : _("off")) |
◆ VALUE_OR_NULL
#define VALUE_OR_NULL |
( |
|
a | ) |
((a) ? (a) : "") |
◆ slashUsage()
void slashUsage |
( |
unsigned short int |
pager | ) |
|
Definition at line 148 of file help.c.
References _, buf, ClosePager(), _psqlSettings::db, printTableOpt::expanded, printTableOpt::format, HELP0, HELPN, initPQExpBuffer(), ON, output, PageOutput(), _psqlSettings::popt, PQdb(), PRINT_HTML, pset, termPQExpBuffer(), _psqlSettings::timing, printQueryOpt::topt, and printTableOpt::tuples_only.
Referenced by exec_command_slash_command_help(), and parse_psql_options().
◆ usage()
void usage |
( |
unsigned short int |
pager | ) |
|
Definition at line 48 of file help.c.
60 HELP0(
"psql is the PostgreSQL interactive terminal.\n\n");
62 HELP0(
" psql [OPTION]... [DBNAME [USERNAME]]\n\n");
64 HELP0(
"General options:\n");
65 HELP0(
" -c, --command=COMMAND run only single command (SQL or internal) and exit\n");
66 HELP0(
" -d, --dbname=DBNAME database name to connect to\n");
67 HELP0(
" -f, --file=FILENAME execute commands from file, then exit\n");
68 HELP0(
" -l, --list list available databases, then exit\n");
69 HELP0(
" -v, --set=, --variable=NAME=VALUE\n"
70 " set psql variable NAME to VALUE\n"
71 " (e.g., -v ON_ERROR_STOP=1)\n");
72 HELP0(
" -V, --version output version information, then exit\n");
73 HELP0(
" -X, --no-psqlrc do not read startup file (~/.psqlrc)\n");
74 HELP0(
" -1 (\"one\"), --single-transaction\n"
75 " execute as a single transaction (if non-interactive)\n");
76 HELP0(
" -?, --help[=options] show this help, then exit\n");
77 HELP0(
" --help=commands list backslash commands, then exit\n");
78 HELP0(
" --help=variables list special variables, then exit\n");
80 HELP0(
"\nInput and output options:\n");
81 HELP0(
" -a, --echo-all echo all input from script\n");
82 HELP0(
" -b, --echo-errors echo failed commands\n");
83 HELP0(
" -e, --echo-queries echo commands sent to server\n");
84 HELP0(
" -E, --echo-hidden display queries that internal commands generate\n");
85 HELP0(
" -L, --log-file=FILENAME send session log to file\n");
86 HELP0(
" -n, --no-readline disable enhanced command line editing (readline)\n");
87 HELP0(
" -o, --output=FILENAME send query results to file (or |pipe)\n");
88 HELP0(
" -q, --quiet run quietly (no messages, only query output)\n");
89 HELP0(
" -s, --single-step single-step mode (confirm each query)\n");
90 HELP0(
" -S, --single-line single-line mode (end of line terminates SQL command)\n");
92 HELP0(
"\nOutput format options:\n");
93 HELP0(
" -A, --no-align unaligned table output mode\n");
94 HELP0(
" --csv CSV (Comma-Separated Values) table output mode\n");
95 HELPN(
" -F, --field-separator=STRING\n"
96 " field separator for unaligned output (default: \"%s\")\n",
98 HELP0(
" -H, --html HTML table output mode\n");
99 HELP0(
" -P, --pset=VAR[=ARG] set printing option VAR to ARG (see \\pset command)\n");
100 HELP0(
" -R, --record-separator=STRING\n"
101 " record separator for unaligned output (default: newline)\n");
102 HELP0(
" -t, --tuples-only print rows only\n");
103 HELP0(
" -T, --table-attr=TEXT set HTML table tag attributes (e.g., width, border)\n");
104 HELP0(
" -x, --expanded turn on expanded table output\n");
105 HELP0(
" -z, --field-separator-zero\n"
106 " set field separator for unaligned output to zero byte\n");
107 HELP0(
" -0, --record-separator-zero\n"
108 " set record separator for unaligned output to zero byte\n");
110 HELP0(
"\nConnection options:\n");
111 HELP0(
" -h, --host=HOSTNAME database server host or socket directory\n");
112 HELP0(
" -p, --port=PORT database server port\n");
113 HELP0(
" -U, --username=USERNAME database user name\n");
114 HELP0(
" -w, --no-password never prompt for password\n");
115 HELP0(
" -W, --password force password prompt (should happen automatically)\n");
117 HELP0(
"\nFor more information, type \"\\?\" (for internal commands) or \"\\help\" (for SQL\n"
118 "commands) from within psql, or consult the psql section in the PostgreSQL\n"
119 "documentation.\n\n");
120 HELPN(
"Report bugs to <%s>.\n", PACKAGE_BUGREPORT);
121 HELPN(
"%s home page: <%s>\n", PACKAGE_NAME, PACKAGE_URL);
125 for (
const char *ptr =
buf.data; *ptr; ptr++)
void ClosePager(FILE *pagerpipe)
FILE * PageOutput(int lines, const printTableOpt *topt)
void initPQExpBuffer(PQExpBuffer str)
void termPQExpBuffer(PQExpBuffer str)
#define DEFAULT_FIELD_SEP
References buf, ClosePager(), DEFAULT_FIELD_SEP, HELP0, HELPN, initPQExpBuffer(), output, PageOutput(), _psqlSettings::popt, pset, termPQExpBuffer(), and printQueryOpt::topt.