use super::handler_spec;
use super::types::DispatchKind;
pub(crate) fn fallback_flag_sets(cmd_name: &str) -> Option<(&'static [String], &'static [String])> {
let spec = handler_spec(cmd_name)?;
let DispatchKind::Custom { fallback, .. } = &spec.kind else {
return None;
};
let f = fallback.as_ref()?;
Some((f.policy.standalone.as_slice(), f.policy.valued.as_slice()))
}
pub(crate) fn handler_policy_flag_sets(cmd_name: &str, key: &str) -> Option<(&'static [String], &'static [String])> {
let spec = handler_spec(cmd_name)?;
let DispatchKind::Custom { handler_policies, .. } = &spec.kind else {
return None;
};
let policy = handler_policies.get(key)?;
Some((policy.standalone.as_slice(), policy.valued.as_slice()))
}