asimov_cli/commands/
snapshot.rs1use clientele::{StandardOptions, SysexitsError, crates::clap::Subcommand};
4use std::{string::String, vec::Vec};
5
6#[derive(Debug, Subcommand)]
7pub enum SnapshotCommand {
8 #[clap(external_subcommand)]
10 Snapshot(Vec<String>),
11
12 List,
14
15 Log {
17 url: String,
19 },
20
21 Compact {
23 urls: Vec<String>,
25 },
26}
27
28impl SnapshotCommand {
29 pub async fn run(&self, flags: &StandardOptions) -> Result<(), SysexitsError> {
30 use SnapshotCommand::*;
31 match self {
32 Snapshot(urls) => snapshot(urls, &flags).await,
33 List => list(&flags).await,
34 Log { url } => log(&url, &flags).await,
35 Compact { urls } => compact(&urls, &flags).await,
36 }
37 }
38}
39
40mod compact;
41pub use compact::*;
42
43mod list;
44pub use list::*;
45
46mod log;
47pub use log::*;
48
49mod snapshot;
50pub use snapshot::*;