Finish FVM package
This commit is contained in:
parent
f2bf17fde9
commit
3c390e5396
13 changed files with 178 additions and 28 deletions
35
src/linux/mod.rs
Normal file
35
src/linux/mod.rs
Normal file
|
@ -0,0 +1,35 @@
|
|||
|
||||
use structopt::{
|
||||
StructOpt,
|
||||
clap::{
|
||||
arg_enum
|
||||
}
|
||||
};
|
||||
|
||||
arg_enum! {
|
||||
#[derive(Debug)]
|
||||
enum Tool {
|
||||
Fvm
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
#[structopt(name = "autoconfig", about = "Auto install local config.")]
|
||||
struct Opt {
|
||||
#[structopt(short = "i", long = "install", help = "Available values : fvm (Flutter version manager)")]
|
||||
tools: Vec<Tool>,
|
||||
}
|
||||
|
||||
|
||||
pub fn start() {
|
||||
let opt = Opt::from_args();
|
||||
for tool in &opt.tools {
|
||||
let result = match tool {
|
||||
Tool::Fvm => super::common::fvm::install()
|
||||
};
|
||||
|
||||
if let Err(err) = result {
|
||||
eprintln!("[ERROR] {}", err);
|
||||
}
|
||||
}
|
||||
}
|
Reference in a new issue