Skip to main content

alias_problems

Function alias_problems 

Source
pub(crate) fn alias_problems(
    choices: &[&str],
    aliases: &[MatchArgAlias],
) -> Vec<String>
Expand description

What is wrong with the aliases of a type whose choices are choices, one sentence per bad alias, in order (empty when they are fine): an alias that is empty or "NA", a choice, given twice, or a prefix of a choice other than its own (typing it would select something else than without the alias), and a target that is not a choice. #[derive(MatchArg)] refuses the same at compile time, with the same words; the wrappers writer checks a hand-written impl with this (crate::registry::match_arg_aliases_arg).