volo-cli 0.12.1

volo-cli is the command line interface for volo, which provides the ability to generate default project layout and manage the idls used.
Documentation
use crate::context::Context;

pub trait CliCommand {
    fn run(&self, cx: Context) -> anyhow::Result<()>;
}

macro_rules! define_commands {
    {$name: ident {
        $($command:ident),+
    }} => {
        #[derive(Parser, Debug)]
        enum $name {
            $(
                $command($command),
            )*
        }

        impl CliCommand for $name {
            fn run(&self, cx: $crate::context::Context) -> anyhow::Result<()> {
                match self {
                    $(
                        $name::$command(c) => c.run(cx),
                    )*
                }
            }
        }
    };
}