Skip to main content

stmo_cli/commands/
mod.rs

1pub mod archive;
2pub mod dashboards;
3pub mod datasources;
4pub mod deploy;
5pub mod discover;
6pub mod dynamic_dates;
7pub mod execute;
8pub mod fetch;
9pub mod init;
10pub mod schedule;
11pub mod update;
12
13use anyhow::{Result, bail};
14
15#[derive(Debug, Clone, Copy)]
16pub enum OutputFormat {
17    Json,
18    Table,
19}
20
21impl std::str::FromStr for OutputFormat {
22    type Err = anyhow::Error;
23
24    fn from_str(s: &str) -> Result<Self> {
25        match s.to_lowercase().as_str() {
26            "json" => Ok(Self::Json),
27            "table" => Ok(Self::Table),
28            _ => bail!("Invalid format. Use: json or table"),
29        }
30    }
31}