Skip to content

Commit 3a95fb7

Browse files
committed
cli: improve text input
1 parent 47012df commit 3a95fb7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,11 @@ fn main() {
225225

226226
let passwd = rpassword::prompt_password("Password for the private key: ")
227227
.expect("unable to read password");
228-
let msg = get_message(text, file);
229228
let signer = runtime
230229
.find_signer(ssi, &passwd)
231230
.expect("unknown signing identity");
232231
eprintln!("Using key {signer}");
232+
let msg = get_message(text, file);
233233
let cert = signer.sign(msg);
234234
if full {
235235
println!("{cert:#}");
@@ -306,6 +306,7 @@ fn get_message(text: Option<String>, file: Option<PathBuf>) -> Vec<u8> {
306306
(Some(t), None) => t.into_bytes(),
307307
(None, Some(f)) => fs::read(f).expect("unable to read the file"),
308308
(None, None) => {
309+
eprintln!("Type or paste your message and press Ctrl+D on the last empty line:");
309310
let mut s = String::new();
310311
stdin()
311312
.read_to_string(&mut s)

0 commit comments

Comments
 (0)