aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 39b5777bcb2..5d90ca28edf 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1491,7 +1491,19 @@ exec_command(const char *cmd,
/* \? -- slash command help */
else if (strcmp(cmd, "?") == 0)
- slashUsage(pset.popt.topt.pager);
+ {
+ char *opt0 = psql_scan_slash_option(scan_state,
+ OT_NORMAL, NULL, false);
+
+ if (!opt0 || strcmp(opt0, "commands") == 0)
+ slashUsage(pset.popt.topt.pager);
+ else if (strcmp(opt0, "options") == 0)
+ usage(pset.popt.topt.pager);
+ else if (strcmp(opt0, "variables") == 0)
+ helpVariables(pset.popt.topt.pager);
+ else
+ slashUsage(pset.popt.topt.pager);
+ }
#if 0