ironflow_cli/commands/
mod.rs1use std::str::FromStr;
4
5pub mod api_key;
6pub mod audit_log;
7pub mod logs;
8pub mod run;
9pub mod secret;
10pub mod stats;
11pub mod template;
12pub mod user;
13pub mod workflow;
14
15pub(crate) fn parse_enum<T: FromStr + ToString>(
25 raw: &str,
26 accepted: &[T],
27 noun: &str,
28) -> Result<T, String> {
29 T::from_str(raw).map_err(|_| {
30 let accepted: Vec<String> = accepted.iter().map(ToString::to_string).collect();
31 format!("unknown {noun} '{raw}'; accepted: {}", accepted.join(", "))
32 })
33}