diff --git a/.gitignore b/.gitignore index db38427607ec0b382995057c607becfd79047c10..62f863d40f726805a9b168306d91ccf0867ea849 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target -config.toml \ No newline at end of file +config.toml +config.yaml \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index ee3acfcd2d5882c55ce31bd7964eebd119ffdca0..0c80836d0bedb2b16506508e5533ceaa7a0d4c69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -74,9 +74,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "3.1.6" +version = "3.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c93436c21e4698bacadf42917db28b23017027a4deccb35dbe47a7e7840123" +checksum = "71c47df61d9e16dc010b55dba1952a57d8c215dbb533fd13cdd13369aac73b1c" dependencies = [ "atty", "bitflags", @@ -91,9 +91,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.1.4" +version = "3.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da95d038ede1a964ce99f49cbe27a7fb538d1da595e4b4f70b8c8f338d17bf16" +checksum = "a3aab4734e083b809aaf5794e14e756d1c798d2c69c7f7de7a09a2f5214993c1" dependencies = [ "heck", "proc-macro-error", @@ -105,10 +105,11 @@ dependencies = [ [[package]] name = "collective" version = "0.1.2" -source = "git+https://gitlab.chromabits.com/etcinit/collective.git?branch=master#34c0ca961ce28f181012dc57bf017d62e1fc2609" +source = "git+https://gitlab.chromabits.com/etcinit/collective.git#29fcf5252b794afd51e066de2e79a6f7ae9fe805" dependencies = [ "clap", "figment", + "lazy_static", "log", "pretty_env_logger", "serde", diff --git a/Cargo.toml b/Cargo.toml index 1322ac48c07c1e2a126a02baae6f5caf648ca521..4c0a5472a1c7008e1367736059dba090d52216d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,8 +19,8 @@ dbus-tokio = "0.7.4" tokio = {version = "1.0", features=["time", "net", "macros", "rt-multi-thread", "signal", "process", "io-std", "io-util"]} tokio-stream = "0.1" futures-channel = "0.3.17" -collective = { git = "https://gitlab.chromabits.com/etcinit/collective.git", branch = "master" } -clap = {version = "3.1", features=["derive"]} +collective = { git = "https://gitlab.chromabits.com/etcinit/collective.git", reference = "29fcf5252b794afd51e066de2e79a6f7ae9fe805" } +clap = { version = "3.1", features = ["derive"]} serde = "1.0.115" serde_derive = "1.0.115" num-derive = "0.3.3" diff --git a/src/main.rs b/src/main.rs index 43c13d2d115ccbbbb33b88b50584d34aade8c7dc..6c0ae5c269e1bb13c8195919097ed382fab65f51 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,4 @@ -use collective::cli::{AppOpts, ConfigurableAppOpts}; -use collective::config::ConfigFileFormat; +use collective::{cli::{AppOpts, ConfigurableAppOpts}, config::ConfigFileFormat}; use dbus_tokio::connection; use std::{path::PathBuf, sync::Arc}; use tokio::{ @@ -52,17 +51,17 @@ impl AppOpts for Opts { } impl ConfigurableAppOpts<config::Config> for Opts { - fn get_config_file_format(&self) -> ConfigFileFormat { - ConfigFileFormat::Yaml - } - - fn get_additional_config_paths(&self) -> Vec<(PathBuf, std::option::Option<ConfigFileFormat>)> { + fn get_additional_config_paths(&self) -> Vec<(PathBuf, Option<ConfigFileFormat>)> { if let Some(config_path) = &self.config { vec![(config_path.clone(), None)] } else { vec![] } } + + fn get_config_file_format(&self) -> ConfigFileFormat { + ConfigFileFormat::Yaml + } } async fn inner_main() -> anyhow::Result<()> {