]> git.r.bdr.sh - rbdr/blog/blobdiff - src/main.rs
Add part of the implementation for add
[rbdr/blog] / src / main.rs
index bf1e1844a2162646f2046f728af45de84a187aef..4cb8036f7fb92f803f007f05e0ee3ccf091c0ab5 100644 (file)
@@ -1,13 +1,17 @@
 // mod argument_parser;
 mod configuration;
 mod command;
+mod constants;
+mod metadata;
 
 use std::iter::once;
 use std::env::args;
 use std::io::Result;
 use command::{available_commands, Command, help::Help};
+use configuration::Configuration;
 
 fn main() -> Result<()> {
+    let configuration = Configuration::new();
     let commands = available_commands();
     let arguments: Vec<String> = args().collect();
 
@@ -23,7 +27,7 @@ fn main() -> Result<()> {
                 .collect();
 
             for command in command_chain {
-                let result = command.execute(arguments.get(2));
+                let result = command.execute(arguments.get(2), &configuration, command_name);
                 if let Err(_) = result {
                     return result;
                 }
@@ -33,5 +37,5 @@ fn main() -> Result<()> {
         }
     }
 
-    Help::new().execute(None)
+    Help::new().execute(None, &configuration, &"help".to_string())
 }