diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-08-12 00:40:59 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-08-12 00:40:59 +0000 |
commit | 568e709372abad30075c299be28956b5922219b4 (patch) | |
tree | a442b37de7ab7a32d59d4612f92fe3d1a5fe1ffa /src/bin/psql/help.c | |
parent | a4a3ef344e189d714d06224892e636c3153e8103 (diff) | |
download | postgresql-568e709372abad30075c299be28956b5922219b4.tar.gz postgresql-568e709372abad30075c299be28956b5922219b4.zip |
Extend psql's \e and \ef commands so that a line number can be specified,
and the editor's cursor will be initially placed on that line. In \e the
lines are counted with respect to the query buffer, while in \ef they are
counted with line 1 = first line of function body. These choices are useful
for positioning the cursor on the line of a previously-reported error.
To avoid assumptions about what switch the user's editor takes for this
purpose, invent a new psql variable EDITOR_LINENUMBER_SWITCH with (at
present) no default value.
One incompatibility from previous behavior is that "\e 1234" will now
take "1234" as a line number not a file name. There are at least two
ways to select a numerically-named file if you really want to.
Pavel Stehule, reviewed by Jan Urbanski, with further editing by Robert Haas
and Tom Lane
Diffstat (limited to 'src/bin/psql/help.c')
-rw-r--r-- | src/bin/psql/help.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index 8351c5fb02b..69a073a2b39 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2010, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.160 2010/07/20 03:54:19 rhaas Exp $ + * $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.161 2010/08/12 00:40:59 tgl Exp $ */ #include "postgres_fe.h" @@ -162,7 +162,7 @@ slashUsage(unsigned short int pager) { FILE *output; - output = PageOutput(87, pager); + output = PageOutput(89, pager); /* if you add/remove a line here, change the row count above */ @@ -174,8 +174,8 @@ slashUsage(unsigned short int pager) fprintf(output, "\n"); fprintf(output, _("Query Buffer\n")); - fprintf(output, _(" \\e [FILE] edit the query buffer (or file) with external editor\n")); - fprintf(output, _(" \\ef [FUNCNAME] edit function definition with external editor\n")); + fprintf(output, _(" \\e [FILE] [LINE] edit the query buffer (or file) with external editor\n")); + fprintf(output, _(" \\ef [FUNCNAME [LINE]] edit function definition with external editor\n")); fprintf(output, _(" \\p show the contents of the query buffer\n")); fprintf(output, _(" \\r reset (clear) the query buffer\n")); #ifdef USE_READLINE |