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