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