Re: Friendly help for psql - Mailing list pgsql-patches

From Greg Sabino Mullane
Subject Re: Friendly help for psql
Date
Msg-id ca94d2d612e4e10e7d2e001f3d376159@biglumber.com
Whole thread Raw
In response to Re: Friendly help for psql  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-patches
Index: mainloop.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/bin/psql/mainloop.c,v
retrieving revision 1.87
diff -c -r1.87 mainloop.c
*** mainloop.c    1 Jan 2008 19:45:56 -0000    1.87
--- mainloop.c    2 Apr 2008 12:51:36 -0000
***************
*** 171,176 ****
--- 171,187 ----
     continue;
     }

+    /* A request for help? Be friendly and give them some guidance */
+    if (pset.cur_cmd_interactive && query_buf->len == 0 &&
+      pg_strncasecmp(line, "help", 4) == 0) {
+      free(line);
+      puts("You are using psql, the command-line interface to PostgreSQL.");
+      puts("Enter SQL commands, or type \\? for a list of backslash options.");
+      puts("Use \\q to quit.");
+      puts("Visit http://postgresql.org for help on PostgreSQL\n");
+      continue;
+    }
+
     /* echo back if flag is set */
     if (pset.echo == PSQL_ECHO_ALL && !pset.cur_cmd_interactive)
       puts(line);



pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Show login privilege in psql \du command
Next
From: "Greg Sabino Mullane"
Date:
Subject: Re: Consistent \d commands in psql