mock_gen 0.1.22

Interface and mock generator for C++ classes
use crate::prelude::*;
use clap::{Args, Parser, Subcommand};

#[derive(Debug, Parser)]
#[clap(author, version, about)]
pub struct MockGen {
    #[command(subcommand)]
    pub commands: Commands,
}

#[derive(Debug, Subcommand)]
pub enum Commands {
    ///generate cmock from direct functions
    ApiMock(ApiMockCmd),
    ///generate interface for class
    Interface(InterfaceCmd),
    ///generate mock from interface
    Mock(MockCmd),
    ///generate mock and interface
    IMock(IMockCmd),
}

#[derive(Debug, Args)]
pub struct InterfaceCmd {
    ///file name to find class
    pub file: String,

    ///class to implement interface for
    pub class: String,
}

#[derive(Debug, Args)]
pub struct MockCmd {
    ///file name to find interface to mock
    pub file: String,

    ///interface to create mock from
    pub class: String,

    ///output mock location
    pub output: Option<String>,
}

#[derive(Debug, Args)]
pub struct ApiMockCmd {
    ///file name to generate mock from
    pub file: String,

    ///output for mock files
    pub output: Option<String>,
}

#[derive(Debug, Args)]
pub struct IMockCmd {
    ///file name to generate mock from
    pub file: String,

    ///interface to create mock from
    pub class: String,

    ///output for mock files
    pub output: Option<String>,
}