You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
502 B
Rust
27 lines
502 B
Rust
3 years ago
|
mod clone;
|
||
|
mod uninstall;
|
||
|
mod help;
|
||
|
use crate::{clone::clone, help::help, uninstall::uninstall};
|
||
|
use std::{env, process::exit};
|
||
|
|
||
|
fn main() {
|
||
|
let args: Vec<String> = env::args().collect();
|
||
|
|
||
|
if args.len() < 3 {
|
||
|
help();
|
||
|
exit(0);
|
||
|
}
|
||
|
|
||
|
let oper = &args[1];
|
||
|
|
||
|
if oper == "-S" {
|
||
|
for arg in env::args().skip(2) {
|
||
|
clone(&arg);
|
||
|
}
|
||
|
} else if oper == "-R" {
|
||
|
for arg in env::args().skip(2) {
|
||
|
uninstall(&arg);
|
||
|
}
|
||
|
}
|
||
|
}
|