Prompt username/password on stderr so:

pg_dump -o -u some_db >dump_file

works.
This commit is contained in:
Bruce Momjian 2000-06-09 12:33:42 +00:00
parent e6487cc4d7
commit a672e9650a
1 changed files with 4 additions and 6 deletions

View File

@ -22,7 +22,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.149 2000/06/02 15:57:38 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.150 2000/06/09 12:33:42 momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
@ -490,11 +490,9 @@ prompt_for_password(char *username, char *password)
#ifdef HAVE_TERMIOS_H
struct termios t_orig,
t;
#endif
printf("Username: ");
fprintf(stderr, "Username: ");
fgets(username, 100, stdin);
length = strlen(username);
/* skip rest of the line */
@ -508,7 +506,7 @@ prompt_for_password(char *username, char *password)
if (length > 0 && username[length - 1] == '\n')
username[length - 1] = '\0';
printf("Password: ");
fprintf(stderr, "Password: ");
#ifdef HAVE_TERMIOS_H
tcgetattr(0, &t);
t_orig = t;
@ -532,7 +530,7 @@ prompt_for_password(char *username, char *password)
if (length > 0 && password[length - 1] == '\n')
password[length - 1] = '\0';
printf("\n\n");
fprintf(stderr, "\n\n");
}