MCPcopy Index your code
hub / github.com/Rust-API/Rust-API-Bypass-Checker / from_args

Method from_args

src/analysis/option.rs:51–136  ·  view source on GitHub ↗
(args: &mut Vec<String>)

Source from the content-addressed store, hash-verified

49
50impl AnalysisOption {
51 pub fn from_args(args: &mut Vec<String>) -> Self {
52 let mut indeices_to_remove = vec![];
53 let mut res = Self::default();
54 for (i, arg) in args.iter().enumerate() {
55 if arg.starts_with("--") {
56 match &arg[2..] {
57 "show_all_entries" => {
58 res.show_all_entries = true;
59 indeices_to_remove.push(i);
60 }
61 "show_reachable_entries" =>{
62 res.show_reachable_entries = true;
63 indeices_to_remove.push(i);
64 }
65 "deny_warnings" => {
66 res.deny_warnings = true;
67 indeices_to_remove.push(i);
68 }
69 "domain" => {
70 if let Some(domain_type) = Self::get_domain_type(&args[i + 1]) {
71 res.domain_type = domain_type;
72 } else {
73 warn!("Unknown domain type, use interval as default");
74 }
75 indeices_to_remove.push(i);
76 indeices_to_remove.push(i + 1);
77 }
78 "entry_def_id_index" => {
79 if let Ok(def_id_index) = args[i + 1].parse() {
80 res.entry_def_id_index = Some(def_id_index);
81 } else {
82 warn!("Invalid entry DefId index, use None as default");
83 }
84 indeices_to_remove.push(i);
85 indeices_to_remove.push(i + 1);
86 }
87 "auto_analysis" => {
88 res.auto_analysis = true;
89 indeices_to_remove.push(i);
90 }
91 "widening_delay" => {
92 if let Ok(widening_delay) = args[i + 1].parse() {
93 res.widening_delay = widening_delay;
94 } else {
95 warn!("Invalid widening delay, use 5 as default");
96 }
97 indeices_to_remove.push(i);
98 indeices_to_remove.push(i + 1);
99 }
100 "narrowing_iteration" => {
101 if let Ok(narrowing_iteration) = args[i + 1].parse() {
102 res.narrowing_iteration = narrowing_iteration;
103 } else {
104 warn!("Invalid narrowing iteration, use 5 as default");
105 }
106 indeices_to_remove.push(i);
107 indeices_to_remove.push(i + 1);
108 }

Callers

nothing calls this directly

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected