aboutsummaryrefslogtreecommitdiff
path: root/src/config
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2022-06-07 12:28:18 +0200
committerMaximilian Manz <maximilian.manz@de.clara.net>2022-06-20 11:33:04 +0200
commite9dc01ffb547d0fa605bfe38b34672ddd5161be4 (patch)
tree5ca50547512b7cc2256ef457d468c4252ae23a0b /src/config
parentimplement cloning of new repos (diff)
reorganize file structure and cleanup lints
Diffstat (limited to 'src/config')
-rw-r--r--src/config/args.rs9
-rw-r--r--src/config/mod.rs6
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()
}
ons'>-65/+300 2021-10-22remove wolfram alpha url shorteningMax Audron-1/+2 2021-10-20remove failing wolfram alpha test casesMax Audron-105/+55 2021-10-20bump version to 1.6.2Max Audron-3/+2 2021-10-20prepare for release on crates.ioMax Audron-39/+65 2021-10-20add async docs to macro crate and bump versionMax Audron-9/+10 2021-10-20change hook errors to be logged as warningsMax Audron-3/+3 2021-10-20fix configuration not loading correctly on release buildsMax Audron-8/+23 2021-10-19replace sedregex crate8-rework-sedMax Audron-20/+358 2021-10-19add formatting trait for irc codesMax Audron-0/+129 2021-10-17fix links in readmeMax Audron-2/+2