diff options
Diffstat (limited to 'tool/src/commands/mod.rs')
-rw-r--r-- | tool/src/commands/mod.rs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/tool/src/commands/mod.rs b/tool/src/commands/mod.rs index 4450c8d6..af7469ca 100644 --- a/tool/src/commands/mod.rs +++ b/tool/src/commands/mod.rs @@ -3,7 +3,6 @@ use std::cmp::Ordering; use std::collections::{HashMap, HashSet}; use std::fs::File; use std::io::{self, Write}; -use time; use rpassword; extern crate sequoia_openpgp as openpgp; @@ -36,18 +35,13 @@ mod decrypt; pub use self::decrypt::decrypt; mod sign; pub use self::sign::sign; -mod dump; +pub mod dump; +use dump::Convert; pub use self::dump::dump; mod inspect; pub use self::inspect::inspect; pub mod key; -const TIMEFMT: &'static str = "%Y-%m-%dT%H:%M"; - -fn tm2str(t: &time::Tm) -> String { - time::strftime(TIMEFMT, t).expect("TIMEFMT is correct") -} - /// Returns suitable signing keys from a given list of TPKs. fn get_signing_keys(tpks: &[openpgp::TPK]) -> Result<Vec<crypto::KeyPair< @@ -506,20 +500,20 @@ pub fn mapping_print_stats(mapping: &store::Mapping, label: &str) -> Result<()> fn print_stamps(st: &store::Stamps) -> Result<()> { println!("{} messages using this key", st.count); if let Some(t) = st.first { - println!(" First: {}", tm2str(&time::at(t))); + println!(" First: {}", t.convert()); } if let Some(t) = st.last { - println!(" Last: {}", tm2str(&time::at(t))); + println!(" Last: {}", t.convert()); } Ok(()) } fn print_stats(st: &store::Stats) -> Result<()> { if let Some(t) = st.created { - println!(" Created: {}", tm2str(&time::at(t))); + println!(" Created: {}", t.convert()); } if let Some(t) = st.updated { - println!(" Updated: {}", tm2str(&time::at(t))); + println!(" Updated: {}", t.convert()); } print!(" Encrypted "); print_stamps(&st.encryption)?; |