summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2023-12-19 19:58:35 +0100
committerCyborus <cyborus@cyborus.xyz>2023-12-19 19:58:35 +0100
commit43773f10f94170adc24c7fa69a7f3afc7b71d337 (patch)
tree3a0fb957b9bb06f77a4a0762781743a331f2c2b4
parentMerge pull request 'fix attachment filename' (#30) from attach-fix into main (diff)
downloadforgejo-cli-43773f10f94170adc24c7fa69a7f3afc7b71d337.tar.xz
forgejo-cli-43773f10f94170adc24c7fa69a7f3afc7b71d337.zip
fix key including newline when read from stdin
-rw-r--r--src/auth.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/auth.rs b/src/auth.rs
index 44bf7b8..1625414 100644
--- a/src/auth.rs
+++ b/src/auth.rs
@@ -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