feat: add log_dir to dfget args (#14)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
c09b340ac7
commit
2ff8e788f7
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in New Issue