diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-11-13 09:40:39 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-11-13 11:27:21 +0200 |
commit | 38b51382e710dda515e6d0df8fdc4f0b253d9cd7 (patch) | |
tree | 5a012e63ef7aa6ae63c31f459d56631bc008b0b5 /src/cmd/list.rs | |
parent | 179993f3bdd5e5d4dd728fc2a8f5d63274f95966 (diff) | |
download | obnam2-38b51382e710dda515e6d0df8fdc4f0b253d9cd7.tar.gz |
refactor: put all client functionality into one program
Diffstat (limited to 'src/cmd/list.rs')
-rw-r--r-- | src/cmd/list.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cmd/list.rs b/src/cmd/list.rs new file mode 100644 index 0000000..1972144 --- /dev/null +++ b/src/cmd/list.rs @@ -0,0 +1,13 @@ +use crate::client::{BackupClient, ClientConfig}; +use std::path::Path; + +pub fn list(config: &Path) -> anyhow::Result<()> { + let config = ClientConfig::read_config(&config)?; + let client = BackupClient::new(&config.server_name, config.server_port)?; + + for gen_id in client.list_generations()? { + println!("{}", gen_id); + } + + Ok(()) +} |