Skip to content

Commit a0b1826

Browse files
authored
feat(keyring): improve password save prompt handling (#190)
- Added support for empty input and lowercase 'y'/'n' in save prompt. - Enhanced user experience by allowing more intuitive responses using default.
1 parent 6d1ac88 commit a0b1826

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/keyring.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ pub fn get_password(connection_name: &str, username: &str) -> Result<Password> {
3131
io::stdout().flush()?;
3232
io::stdin().read_line(&mut save)?;
3333
match save.trim() {
34-
"Y" => {
34+
"" | "Y" | "y" => {
3535
entry.set_password(&password)?;
3636
println!("Password saved in keyring");
3737
Ok(())
3838
},
39-
"n" => {
39+
"n" | "N" => {
4040
println!("Password not saved in keyring");
4141
Ok(())
4242
},

0 commit comments

Comments
 (0)