1mod analyze;
2mod check;
3mod verify;
4
5pub use analyze::*;
6pub use check::*;
7use clap::{Args, Subcommand};
8pub use verify::PostfixRepeat;
9pub use verify::*;
10
11#[derive(Args, Debug, Clone)]
12pub struct RapxArgs {
13 #[command(subcommand)]
14 pub command: Commands,
15 #[arg(long, help = "specify the timeout seconds in running rapx")]
16 pub timeout: Option<u64>,
17 #[arg(long, help = "specify the tested package in the workspace")]
18 pub test_crate: Option<String>,
19}
20
21#[derive(Debug, Clone, Subcommand)]
24pub enum Commands {
25 #[command(arg_required_else_help = true)]
27 Analyze {
28 #[command(subcommand)]
29 kind: AnalysisKind,
30 },
31 Check(CheckArgs),
34 Opt,
36 Verify(VerifyArgs),
38}
39
40impl RapxArgs {
41 pub fn init_env(&self) {
42 let Commands::Check(CheckArgs {
43 uaf: Some(level), ..
44 }) = &self.command
45 else {
46 return;
47 };
48 unsafe {
49 std::env::set_var("MOP", level.to_string());
50 }
51 }
52}