merge_args_with

Function merge_args_with 

Source
pub fn merge_args_with<'k, 'v, T, U>(
    matches: &ArgMatches,
    id_values: &[(&'k str, &'v [T])],
    convert: impl FnMut(&'k str, &'v T) -> U,
) -> Vec<U>
Expand description

Merges multiple clap args in order of appearance.

The id_values is a list of (id, values) pairs, where id is the name of the clap Arg, and values are the parsed values for that arg. The convert function transforms each (id, value) pair to e.g. an enum.

This is a workaround for https://github.com/clap-rs/clap/issues/3146.