mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 04:45:15 +00:00
Write prompt to stderr instead of stdout
This commit is contained in:
parent
1789e6151d
commit
2e28b88e3a
@ -40,12 +40,12 @@ func readPassword(env string, prompt string) string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Print(prompt)
|
fmt.Fprint(os.Stderr, prompt)
|
||||||
pw, err := terminal.ReadPassword(int(os.Stdin.Fd()))
|
pw, err := terminal.ReadPassword(int(os.Stdin.Fd()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errx(2, "unable to read password: %v", err)
|
errx(2, "unable to read password: %v", err)
|
||||||
}
|
}
|
||||||
fmt.Println()
|
fmt.Fprintln(os.Stderr)
|
||||||
|
|
||||||
return string(pw)
|
return string(pw)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user