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 user;
12pub mod workflow;
13
14pub(crate) fn parse_enum<T: FromStr + ToString>(
24 raw: &str,
25 accepted: &[T],
26 noun: &str,
27) -> Result<T, String> {
28 T::from_str(raw).map_err(|_| {
29 let accepted: Vec<String> = accepted.iter().map(ToString::to_string).collect();
30 format!("unknown {noun} '{raw}'; accepted: {}", accepted.join(", "))
31 })
32}