aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-12-21 16:18:41 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-12-21 16:18:41 -0500
commit0f2abd05441f524a67bc58ef5f0cc32054f7fb66 (patch)
treeb5f833e80590a53b2c766be5dae79b10fc5ee5e4 /src
parent1fada5d81e6769ded832a4ca62ee9371bac3fb9f (diff)
downloadpostgresql-0f2abd05441f524a67bc58ef5f0cc32054f7fb66.tar.gz
postgresql-0f2abd05441f524a67bc58ef5f0cc32054f7fb66.zip
Add help & tab-complete support for psql's \getenv.
I forgot about these details in 33d3eeadb :-(. Noted by Christoph Berg. Discussion: https://postgr.es/m/YcI8i/mduMi91uXY@msg.df7cb.de
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/help.c3
-rw-r--r--src/bin/psql/tab-complete.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index db12a8b2f33..8cadfbb1032 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -166,7 +166,7 @@ slashUsage(unsigned short int pager)
* Use "psql --help=commands | wc" to count correctly. It's okay to count
* the USE_READLINE line even in builds without that.
*/
- output = PageOutput(136, pager ? &(pset.popt.topt) : NULL);
+ output = PageOutput(137, pager ? &(pset.popt.topt) : NULL);
fprintf(output, _("General\n"));
fprintf(output, _(" \\copyright show PostgreSQL usage and distribution terms\n"));
@@ -309,6 +309,7 @@ slashUsage(unsigned short int pager)
fprintf(output, _("Operating System\n"));
fprintf(output, _(" \\cd [DIR] change the current working directory\n"));
+ fprintf(output, _(" \\getenv PSQLVAR ENVVAR fetch environment variable\n"));
fprintf(output, _(" \\setenv NAME [VALUE] set or unset environment variable\n"));
fprintf(output, _(" \\timing [on|off] toggle timing of commands (currently %s)\n"),
ON(pset.timing));
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index b524dc87fc1..cf30239f6db 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -1519,7 +1519,7 @@ psql_completion(const char *text, int start, int end)
"\\echo", "\\edit", "\\ef", "\\elif", "\\else", "\\encoding",
"\\endif", "\\errverbose", "\\ev",
"\\f",
- "\\g", "\\gdesc", "\\gexec", "\\gset", "\\gx",
+ "\\g", "\\gdesc", "\\getenv", "\\gexec", "\\gset", "\\gx",
"\\help", "\\html",
"\\if", "\\include", "\\include_relative", "\\ir",
"\\list", "\\lo_import", "\\lo_export", "\\lo_list", "\\lo_unlink",