mod analyze;
mod check;
mod verify;
pub use analyze::*;
pub use check::*;
use clap::{Args, Subcommand, ValueEnum};
pub use verify::*;
#[derive(Args, Debug, Clone)]
pub struct RapxArgs {
#[command(subcommand)]
pub command: Commands,
#[arg(long, help = "specify the timeout seconds in running rapx")]
pub timeout: Option<u64>,
#[arg(long, help = "specify the tested package in the workspace")]
pub test_crate: Option<String>,
}
#[derive(Debug, Clone, Subcommand)]
pub enum Commands {
#[command(arg_required_else_help = true)]
Analyze {
#[command(subcommand)]
kind: AnalysisKind,
},
Check(CheckArgs),
Verify(VerifyArgs),
}
#[derive(Debug, Clone, Copy, ValueEnum)]
pub enum OptLevel {
Report,
Default,
All,
}
impl RapxArgs {
pub fn init_env(&self) {
let Commands::Check(CheckArgs {
uaf: Some(level), ..
}) = &self.command
else {
return;
};
unsafe {
std::env::set_var("MOP", level.to_string());
}
}
}