fix key including newline when read from stdin

This commit is contained in:
Cyborus 2023-12-19 13:58:35 -05:00
parent 700b8ed9d9
commit 43773f10f9
No known key found for this signature in database

View file

@ -36,7 +36,7 @@ impl AuthCommand {
AuthCommand::AddKey { host, user, key } => {
let key = match key {
Some(key) => key,
None => crate::readline("new key: ").await?,
None => crate::readline("new key: ").await?.trim().to_string(),
};
if keys.hosts.get(&user).is_none() {
keys.hosts