MCPcopy Create free account
hub / github.com/Kudaes/MFTool / parse_args

Function parse_args

utils/src/lib.rs:10–35  ·  view source on GitHub ↗
(input: &str)

Source from the content-addressed store, hash-verified

8use windows::Win32::Foundation::HANDLE;
9
10pub fn parse_args(input: &str) -> Vec<String> {
11 let mut args = Vec::new();
12 let mut current = String::new();
13 let mut in_quotes = false;
14
15 for c in input.chars() {
16 match c {
17 '"' => {
18 in_quotes = !in_quotes;
19 }
20 ' ' if !in_quotes => {
21 if !current.is_empty() {
22 args.push(current.clone());
23 current.clear();
24 }
25 }
26 _ => current.push(c),
27 }
28 }
29
30 if !current.is_empty() {
31 args.push(current);
32 }
33
34 args
35}
36
37pub fn print_help() {
38 let help_text = lc!(r#"

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected