wasmer_cli/commands/journal/
mod.rs

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