Link command WIP
This commit is contained in:
19
src/application/mod.rs
Normal file
19
src/application/mod.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use crate::command::Command;
|
||||
use crate::commands;
|
||||
|
||||
pub fn run(args: Vec<String>) {
|
||||
if args.len() < 2 {
|
||||
println!("No command provided");
|
||||
return;
|
||||
}
|
||||
|
||||
let command: Option<Box<dyn Command>> = match args[1].as_str() {
|
||||
"link" => Some(Box::new(commands::link::LinkCommand {})),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
match command {
|
||||
Some(command) => command.run(&args[2..]),
|
||||
None => println!("Invalid command: {}", args[1]),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user