Why not run help when someone enters "help" (or "HELP ME!") on the
command line? \? is hardly an easy thing to remember (and some people
can't be bothered to actually read the screen...)

? NOTES
? README
? SUBMIT
? backslash_consistency.patch
? ddproblem.sql
? dfs.20071104
? pop
? psql
? scrap
? tab-complete.goodwithformatting.c
? tab-complete.muchnicer.c
? tabbo
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	20 Jan 2008 17:51:26 -0000
***************
*** 11,16 ****
--- 11,17 ----
  
  #include "command.h"
  #include "common.h"
+ #include "help.h"
  #include "input.h"
  #include "settings.h"
  
***************
*** 171,176 ****
--- 172,185 ----
  			continue;
  		}
  
+ 		/* A request for help? Be friendly and show them the slash way of doing things */
+ 		if (pset.cur_cmd_interactive && query_buf->len == 0 &&
+ 			pg_strncasecmp(line, "help", 4) == 0) {
+ 			free(line);
+ 			slashUsage(pset.popt.topt.pager);
+ 			continue;
+ 		}
+ 
  		/* echo back if flag is set */
  		if (pset.echo == PSQL_ECHO_ALL && !pset.cur_cmd_interactive)
  			puts(line);

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to