Macro extract_all

Source
macro_rules! extract_all {
    (@check_type $variant_val:ident, { $type:ident }) => { ... };
    (@check_type $variant_val:ident, { $module:ident::$type:ident }) => { ... };
    (@check_type $variant_val:ident, {}) => { ... };
    (@extract_config $config_id:ident, { $type:ident }) => { ... };
    (@extract_config $config_id:ident, { $module:ident::$type:ident }) => { ... };
    (@extract_config $config_id:ident, {}) => { ... };
    ($command_path: ident, $E:path, $($variant:ident = $cmd:tt,)*) => { ... };
}
Expand description

Call extract_config on each SubCommand so it could not be forget to implement it. All variant must be listed otherwise there is a compilation error. The associated command to the variant must be the right one otherwise there is a compilation error.

§Example

fn extract_config(command_path: String) -> HashMap<String, StructDoc> {
    extract_all!(
        command_path,
        PseudoCommand,
        CommandA = { PseudoCommandA },
        CommandB = { pseudo_module::PseudoCommandB },
    )
}