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