Prompt username/password on stderr so:
authorBruce Momjian
Fri, 9 Jun 2000 12:33:42 +0000 (12:33 +0000)
committerBruce Momjian
Fri, 9 Jun 2000 12:33:42 +0000 (12:33 +0000)
     pg_dump -o -u some_db >dump_file

works.

src/bin/pg_dump/pg_dump.c

index 407413160aa3550bbc4dd3075a4cadbb0d871f12..5482c9da149809429ca04f80f076aa5bf393d1bc 100644 (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 - [email protected] - 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");
 }