wasmer_cli/commands/journal/
mod.rs

1use crate::commands::CliCommand;
2
3mod compact;
4mod export;
5mod extract;
6mod filter;
7mod import;
8mod inspect;
9#[cfg(feature = "fuse")]
10mod mount;
11
12pub use compact::*;
13pub use export::*;
14pub use extract::*;
15pub use filter::*;
16pub use import::*;
17pub use inspect::*;
18#[cfg(feature = "fuse")]
19pub use mount::*;
20
21/// Manage Journal files.
22#[derive(clap::Subcommand, Debug)]
23pub enum CmdJournal {
24    /// Compacts a journal into a smaller size by removed redundant or duplicate events
25    Compact(CmdJournalCompact),
26    /// Exports the contents of a journal to stdout as JSON objects
27    Export(CmdJournalExport),
28    /// Imports the events into a journal as JSON objects
29    Import(CmdJournalImport),
30    /// Inspects the contents of a journal and summarizes it to `stdout`
31    Inspect(CmdJournalInspect),
32    /// Filters out certain events from a journal
33    Filter(CmdJournalFilter),
34    /// Mounts the journal at a particular directory
35    #[cfg(feature = "fuse")]
36    Mount(CmdJournalMount),
37    /// Extracts an element of a journal
38    Extract(CmdJournalExtract),
39}
40
41impl CliCommand for CmdJournal {
42    type Output = ();
43
44    fn run(self) -> Result<(), anyhow::Error> {
45        match self {
46            Self::Compact(cmd) => cmd.run(),
47            Self::Import(cmd) => cmd.run(),
48            Self::Export(cmd) => cmd.run(),
49            Self::Inspect(cmd) => cmd.run(),
50            Self::Filter(cmd) => cmd.run(),
51            #[cfg(feature = "fuse")]
52            Self::Mount(cmd) => cmd.run(),
53            Self::Extract(cmd) => cmd.run(),
54        }
55    }
56}