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