diff -C 5 ./command.c new/command.c *** ./command.c Wed Mar 21 22:00:18 2001 --- new/command.c Mon Mar 26 08:36:22 2001 *************** *** 251,260 **** --- 251,278 ---- 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 + { + 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 -C 5 ./help.c new/help.c *** ./help.c Wed Mar 21 22:00:20 2001 --- new/help.c Mon Mar 26 08:37:13 2001 *************** *** 194,203 **** --- 194,204 ---- /* 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 table title\n"); + fprintf(fout, " \\cd <dir> change the current working directory\n"); fprintf(fout, " \\copy ... perform SQL COPY with data stream to the client machine\n"); fprintf(fout, " \\copyright show PostgreSQL usage and distribution terms\n"); fprintf(fout, " \\d <table> describe table (or view, index, sequence)\n"); fprintf(fout, " \\d{t|i|s|v} list tables/indices/sequences/views\n"); fprintf(fout, " \\d{p|S|l} list permissions/system tables/lobjects\n");