Skip to content

Commit

Permalink
cli: improve text input
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed May 26, 2024
1 parent 47012df commit 3a95fb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ fn main() {

let passwd = rpassword::prompt_password("Password for the private key: ")
.expect("unable to read password");
let msg = get_message(text, file);
let signer = runtime
.find_signer(ssi, &passwd)
.expect("unknown signing identity");
eprintln!("Using key {signer}");
let msg = get_message(text, file);
let cert = signer.sign(msg);
if full {
println!("{cert:#}");
Expand Down Expand Up @@ -306,6 +306,7 @@ fn get_message(text: Option<String>, file: Option<PathBuf>) -> Vec<u8> {
(Some(t), None) => t.into_bytes(),
(None, Some(f)) => fs::read(f).expect("unable to read the file"),
(None, None) => {
eprintln!("Type or paste your message and press Ctrl+D on the last empty line:");
let mut s = String::new();
stdin()
.read_to_string(&mut s)
Expand Down

0 comments on commit 3a95fb7

Please sign in to comment.