diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-04-11 15:43:08 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-04-12 12:41:51 +0200 |
commit | 017536c5f0e2f9e584175a402583c7a0623c6ab3 (patch) | |
tree | e48209d8271b973c3c4e63d97acd8056bc056f73 /tool/src/commands/decrypt.rs | |
parent | b8742923d134c5c3a91a2521556ecba2085cece7 (diff) |
tool: Indent based on the terminal size.
Diffstat (limited to 'tool/src/commands/decrypt.rs')
-rw-r--r-- | tool/src/commands/decrypt.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tool/src/commands/decrypt.rs b/tool/src/commands/decrypt.rs index 0b7e33f7..4d000cc3 100644 --- a/tool/src/commands/decrypt.rs +++ b/tool/src/commands/decrypt.rs @@ -2,6 +2,7 @@ use failure::{self, ResultExt}; use std::collections::HashMap; use std::io; use rpassword; +extern crate termsize; extern crate sequoia_openpgp as openpgp; use sequoia_core::Context; @@ -77,7 +78,9 @@ impl<'a> Helper<'a> { key_hints: hints, dump_session_key: dump_session_key, dumper: if dump || hex { - Some(PacketDumper::new(80, false)) + let width = + termsize::get().map(|s| s.cols as usize).unwrap_or(80); + Some(PacketDumper::new(width, false)) } else { None }, |