]> git.r.bdr.sh - rbdr/blog/blobdiff - src/command/mod.rs
Deal with all lints
[rbdr/blog] / src / command / mod.rs
index 211b10f6dbf757da70a02eb127597ec90738b2d5..2807193780af589d91360200e0702bc4efc92805 100644 (file)
@@ -1,35 +1,41 @@
 pub mod add;
 pub mod add;
+pub mod add_remote;
 pub mod generate;
 pub mod generate;
-pub mod update;
+pub mod help;
 pub mod publish;
 pub mod publish_archive;
 pub mod publish;
 pub mod publish_archive;
-pub mod add_remote;
 pub mod remove_remote;
 pub mod remove_remote;
-pub mod sync_up;
-pub mod sync_down;
 pub mod status;
 pub mod status;
+pub mod sync_down;
+pub mod sync_up;
+pub mod update;
 pub mod version;
 pub mod version;
-pub mod help;
-
 
 use std::io::Result;
 
 use add::Add;
 
 use std::io::Result;
 
 use add::Add;
+use add_remote::AddRemote;
 use generate::Generate;
 use generate::Generate;
-use update::Update;
+use help::Help;
 use publish::Publish;
 use publish_archive::PublishArchive;
 use publish::Publish;
 use publish_archive::PublishArchive;
-use add_remote::AddRemote;
 use remove_remote::RemoveRemote;
 use remove_remote::RemoveRemote;
-use sync_up::SyncUp;
+use status::Status;
 use sync_down::SyncDown;
 use sync_down::SyncDown;
+use sync_up::SyncUp;
+use update::Update;
 use version::Version;
 use version::Version;
-use status::Status;
-use help::Help;
+
+use crate::configuration::Configuration;
 
 pub trait Command {
     fn before_dependencies(&self) -> Vec<Box<dyn Command>>;
 
 pub trait Command {
     fn before_dependencies(&self) -> Vec<Box<dyn Command>>;
-    fn execute(&self, input: Option<&String>) -> Result<()>;
+    fn execute(
+        &self,
+        input: Option<&String>,
+        configuration: &Configuration,
+        command: &str,
+    ) -> Result<()>;
     fn after_dependencies(&self) -> Vec<Box<dyn Command>>;
     fn command(&self) -> &'static str;
     fn help(&self) -> &'static str;
     fn after_dependencies(&self) -> Vec<Box<dyn Command>>;
     fn command(&self) -> &'static str;
     fn help(&self) -> &'static str;
@@ -48,6 +54,6 @@ pub fn available_commands() -> Vec<Box<dyn Command>> {
         Box::new(SyncDown::new()),
         Box::new(Status::new()),
         Box::new(Version::new()),
         Box::new(SyncDown::new()),
         Box::new(Status::new()),
         Box::new(Version::new()),
-        Box::new(Help::new())
+        Box::new(Help::new()),
     ]
 }
     ]
 }