diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-12-30 13:33:57 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-12-30 13:56:20 +0200 |
commit | c492bc19aaf404ab4115b8d7f06eff81a6480b4e (patch) | |
tree | 99bb10c1cfc99bded3b7187f18541c9e7c676ead /src/cmd | |
parent | 48639d00710cf945cff7298cf927efc7275364e2 (diff) | |
download | obnam2-c492bc19aaf404ab4115b8d7f06eff81a6480b4e.tar.gz |
feat! store and show timestamp for each backup generation
This changes the output format of "obnam list".
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/list.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cmd/list.rs b/src/cmd/list.rs index 6c48244..70aa0a7 100644 --- a/src/cmd/list.rs +++ b/src/cmd/list.rs @@ -3,8 +3,10 @@ use crate::client::{BackupClient, ClientConfig}; pub fn list(config: &ClientConfig) -> anyhow::Result<()> { let client = BackupClient::new(&config.server_url)?; - for gen_id in client.list_generations()? { - println!("{}", gen_id); + let mut generations = client.list_generations()?; + generations.sort_by_cached_key(|gen| gen.ended().to_string()); + for finished in generations { + println!("{} {}", finished.id(), finished.ended()); } Ok(()) |