From 2ff8e788f7cd8c54e35604b50dc48f052b8f631d Mon Sep 17 00:00:00 2001 From: Gaius Date: Thu, 20 Apr 2023 20:01:46 +0800 Subject: [PATCH] feat: add log_dir to dfget args (#14) Signed-off-by: Gaius --- src/bin/dfget/main.rs | 11 ++++------- src/config/dfget.rs | 7 +------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/bin/dfget/main.rs b/src/bin/dfget/main.rs index 8e7d103d..4023ac71 100644 --- a/src/bin/dfget/main.rs +++ b/src/bin/dfget/main.rs @@ -15,6 +15,7 @@ */ use clap::Parser; +use client::config::dfget::*; use std::path::PathBuf; use tracing::Level; @@ -34,9 +35,6 @@ struct Args { )] output: PathBuf, - #[arg(short = 'c', long = "config", help = "Specify config file to use")] - config: PathBuf, - #[arg( short = 'l', long, @@ -46,12 +44,11 @@ struct Args { log_level: Level, #[arg( - short, long, - default_value_t = false, - help = "Print more information about the download progress" + default_value_os_t = default_dfget_log_dir(), + help = "Specify the log directory" )] - verbose: bool, + log_dir: PathBuf, } fn main() { diff --git a/src/config/dfget.rs b/src/config/dfget.rs index e25ed2ac..c82eebdb 100644 --- a/src/config/dfget.rs +++ b/src/config/dfget.rs @@ -14,14 +14,9 @@ * limitations under the License. */ -use crate::config::{default_config_dir, default_log_dir}; +use crate::config::default_log_dir; use std::path::PathBuf; -// default_dfget_config_path is the default config path for dfget. -pub fn default_dfget_config_path() -> PathBuf { - default_config_dir().join("dfget.yaml") -} - // default_dfget_log_dir is the default log directory for dfget. pub fn default_dfget_log_dir() -> PathBuf { default_log_dir().join("dfget")