diff -U 5 ./command.c new/command.c --- ./command.c Wed Mar 21 22:00:18 2001 +++ new/command.c Mon Mar 26 11:57:55 2001 @@ -251,10 +251,32 @@ free(opt1); free(opt2); } + /* \cd */ + else if (strcasecmp(cmd, "cd") == 0) + { + if ( chdir( options_string )) + { + psql_error("\\%s: could not change directory to '%s'\n", + cmd, options_string ); + success = false; + } + else + { + char *cwd; + cwd = getcwd( NULL, 512 ); + printf( "Current directory is now '%s'.\n", cwd ); + free( cwd ); + success = true; + } + /* wind pointer to end of line */ + if (string) + string += strlen(string); + } + /* \copy */ else if (strcasecmp(cmd, "copy") == 0) { success = do_copy(options_string); if (options_string) diff -U 5 ./help.c new/help.c --- ./help.c Wed Mar 21 22:00:20 2001 +++ new/help.c Mon Mar 26 11:58:34 2001 @@ -194,10 +194,11 @@ /* if you add/remove a line here, change the row test above */ fprintf(fout, " \\a toggle between unaligned and aligned mode\n"); fprintf(fout, " \\c[onnect] [dbname|- [user]]\n" " connect to new database (currently '%s')\n", PQdb(pset.db)); fprintf(fout, " \\C