mintrt 0.1.0

Security-featured runtime for lua.
//     <<*>> Revenge of snowflake.
//     -^v-  SASWE
//     @ This source code is licensed under a dual license model:
//       1. MPL-2.0 for non-commercial use only
//       2. Commercial License for commercial use
//       See LICENSE and LICENSE_COMMERCIAL files for details.
use thunder::thunderclap;


struct CLI;

#[thunderclap(author = "SASWE", version = "0.1.0",
    about = "")]
impl CLI {
    /// 显示版本
    fn version() {
        println!("Version: {}", CLI_VERSION);
    }

    /// 交互式填充元数据
    fn ask() {
        println!("Filling metadata interactively...");
    }

    /// 运行实体
    #[thunder::thunderclap(short = 'r', long = "raw", value_name = "entity_ron_or_binfile", help = "Run entity from ron or binary")]
    fn raw(entity_ron: String) {
        println!("Running entity from: {}", entity_ron);
    }

    /// 开发模式
    #[arg(long = "dev", help = "Run manually by filling metadata")]
    #[arg(long = "nickname", value_name = "app_name", help = "Set application nickname")]
    #[arg(long = "authority", value_name = "app_authority", help = "Set application authority")]
    // #[arg(long = "engine", value_name = "engine_type", help = "Specify Lua engine (luau/jit/lua54/luajit)")]
    #[arg(long = "raw-thinker", value_name = "thinker_script", help = "Specify thinker script, ".sdq" text only.")]
    #[arg(long = "executor", value_name = "type content", help = "Specify executor type and content, ".rb" binary only")]
    #[arg(long = "runtime-permission", value_name = "su or current user", help = "Specify runtime authority")]
    
    fn dev(
        nickname: String,
        authority: String,
        engine: String,
        thinker: String,
        executor: String
    ) {
        println!("Running in dev mode with:");
        println!("Nickname: {}", nickname);
        println!("Authority: {}", authority);
        println!("Engine: {}", engine);
        println!("Thinker: {}", thinker);
        println!("Executor: {}", executor);
    }
}

const CLI_VERSION: &str = "0.1.0";