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