diff options
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/args.rs | 9 | ||||
| -rw-r--r-- | src/config/mod.rs | 6 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/config/args.rs b/src/config/args.rs index 9c0973f..446c5ce 100644 --- a/src/config/args.rs +++ b/src/config/args.rs @@ -1,9 +1,7 @@ -use clap::{Parser, Subcommand, ArgEnum}; +use clap::{Parser, Subcommand}; #[derive(Parser, Clone, Debug)] -#[clap( - override_usage("gtree <SUBCOMMAND> [SCOPE]") -)] +#[clap(override_usage("gtree <SUBCOMMAND> [SCOPE]"))] /// Sync Gitlab Trees pub struct Args { #[clap(subcommand)] @@ -14,8 +12,7 @@ pub struct Args { pub scope: Option<String>, } -#[derive(PartialEq, Clone, Debug)] -#[derive(Subcommand)] +#[derive(PartialEq, Clone, Debug, Subcommand)] pub enum Commands { /// Download new repositories and delete old ones, also update Sync, diff --git a/src/config/mod.rs b/src/config/mod.rs index 26d80f4..781aedf 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -2,7 +2,7 @@ pub mod args; use serde::{Deserialize, Serialize}; -use std::{collections::BTreeMap, ops::Deref, path::Path}; +use std::{collections::BTreeMap, ops::Deref}; use figment::{ providers::{Format, Toml}, @@ -19,7 +19,7 @@ use anyhow::{Context, Result}; // TODO make forge optional pub struct Config { #[serde(flatten)] - config: BTreeMap<String, ForgeConfig> + config: BTreeMap<String, ForgeConfig>, } impl Deref for Config { @@ -32,7 +32,7 @@ impl Deref for Config { impl Config { // Allow the configuration to be extracted from any `Provider`. - fn from<T: Provider>(provider: T) -> Result<Config, Error> { + pub fn from<T: Provider>(provider: T) -> Result<Config, Error> { Figment::from(provider).extract() } |
