Browse Source

Start updating run configuration

Samuel W. Flint 3 years ago
parent
commit
d40b36d1b4
3 changed files with 13 additions and 8 deletions
  1. 1 0
      src/lib/mod.rs
  2. 9 6
      src/lib/run.rs
  3. 3 2
      src/main.rs

+ 1 - 0
src/lib/mod.rs

@@ -3,3 +3,4 @@ pub mod config;
 pub mod group;
 pub mod repository;
 pub mod repotype;
+pub mod run;

+ 9 - 6
src/lib/run.rs

@@ -1,11 +1,14 @@
 use clap::Values;
-use config::{
-    Config,
-    Repository
-}
+use crate::lib::{
+    config::Config,
+    repository::Repository,
+    group::Group,
+    repotype::RepoType,
+    action::Action
+};
 
-pub fn run(names: Values<'_>) {
+pub fn run(config: &Config, names: Values<'_>) {
     for name in names {
-        println!("Name: {}", name)
+        println!("Running {}...", name)
     }
 }

+ 3 - 2
src/main.rs

@@ -16,7 +16,8 @@ use crate::lib::{
     repository,
     action,
     group,
-    repotype
+    repotype,
+    run
 };
 
 fn main() {
@@ -27,7 +28,7 @@ fn main() {
     let mut configuration: Config = read_configuration_file(&config_file);
 
     match matches.subcommand_name() {
-        Some("run") => println!("Running..."),
+        Some("run") => run::run(&configuration, matches.subcommand_matches("run").unwrap().values_of("name").unwrap()),
         Some("repository") => if let Some(matches) = matches.subcommand_matches("repository") {
             match matches.subcommand_name() {
                 Some("register") => if let Some(matches) = matches.subcommand_matches("register") {