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