Skip to content

Commit 5dc2409

Browse files
committed
use explicit stdout to show password input message
1 parent dc6f076 commit 5dc2409

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/cryptomator/cli/pwd/PasswordFromStdInputStrategy.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class PasswordFromStdInputStrategy implements PasswordStrategy {
1212
private static final Logger LOG = LoggerFactory.getLogger(PasswordFromStdInputStrategy.class);
1313

1414
private final String vaultName;
15+
private final String inputMessage = "Enter password for vault '%s': ";
1516

1617
public PasswordFromStdInputStrategy(final String vaultName) {
1718
this.vaultName = vaultName;
@@ -27,7 +28,7 @@ public String password() {
2728
LOG.warn("No console: non-interactive mode, instead use insecure replacement, PW is shown!");
2829

2930
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
30-
LOG.info("Enter password: ");
31+
System.out.println(String.format(inputMessage, vaultName));
3132

3233
try {
3334
password = reader.readLine();
@@ -36,7 +37,7 @@ public String password() {
3637
e.printStackTrace();
3738
}
3839
} else {
39-
LOG.info("Enter password: ");
40+
System.out.println(String.format(inputMessage, vaultName));
4041
password = new String(console.readPassword());
4142
}
4243

0 commit comments

Comments
 (0)