mirror of
https://github.com/JonasunderscoreJones/moddah.git
synced 2025-10-26 14:09:18 +01:00
added rust files
This commit is contained in:
parent
4b1ca233a5
commit
90373f7b29
3 changed files with 82 additions and 0 deletions
22
src/main.rs
Normal file
22
src/main.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
use std::env;
|
||||
|
||||
mod cliargs;
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
for i in args.iter()
|
||||
{
|
||||
match i.as_str()
|
||||
{
|
||||
"--help" => cliargs::help(),
|
||||
_ => {
|
||||
if !args.iter().position(|r| r.as_str() == i).unwrap().parse() == 0
|
||||
{
|
||||
println!("Error")
|
||||
} else {
|
||||
println!("{}", args.iter().position(|r| r.as_str() == i).unwrap());
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue