|
@@ -36,6 +36,26 @@ fn main() {
|
|
let location = env::current_dir().unwrap().to_str().unwrap().to_string();
|
|
let location = env::current_dir().unwrap().to_str().unwrap().to_string();
|
|
repository::register(&mut configuration, &name, location, type_name, option_strings);
|
|
repository::register(&mut configuration, &name, location, type_name, option_strings);
|
|
},
|
|
},
|
|
|
|
+ Some("config") => if let Some(matches) = matches.subcommand_matches("config") {
|
|
|
|
+ let name = matches.value_of("name").unwrap().to_string();
|
|
|
|
+ if let Some(options) = matches.values_of("options") {
|
|
|
|
+ let mut option_strings: Vec<String> = Vec::new();
|
|
|
|
+ for str_thing in options {
|
|
|
|
+ option_strings.push(str_thing.to_string())
|
|
|
|
+ }
|
|
|
|
+ repository::update_options(&mut configuration, &name, option_strings);
|
|
|
|
+ }
|
|
|
|
+ match matches.value_of("autocreate") {
|
|
|
|
+ Some("YES") => repository::update_autocreate(&mut configuration, &name, true),
|
|
|
|
+ Some("NO") => repository::update_autocreate(&mut configuration, &name, false),
|
|
|
|
+ _ => {}
|
|
|
|
+ }
|
|
|
|
+ match matches.value_of("disable") {
|
|
|
|
+ Some("YES") => repository::update_disabled(&mut configuration, &name, true),
|
|
|
|
+ Some("NO") => repository::update_disabled(&mut configuration, &name, false),
|
|
|
|
+ _ => {}
|
|
|
|
+ }
|
|
|
|
+ },
|
|
Some("show") => if let Some(matches) = matches.subcommand_matches("show") {
|
|
Some("show") => if let Some(matches) = matches.subcommand_matches("show") {
|
|
let name = matches.value_of("name").unwrap().to_string();
|
|
let name = matches.value_of("name").unwrap().to_string();
|
|
let repository = configuration.repositories.get(&name);
|
|
let repository = configuration.repositories.get(&name);
|