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 clap::Parser;
|
||||||
|
use client::config::dfget::*;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use tracing::Level;
|
use tracing::Level;
|
||||||
|
|
||||||
|
|
@ -34,9 +35,6 @@ struct Args {
|
||||||
)]
|
)]
|
||||||
output: PathBuf,
|
output: PathBuf,
|
||||||
|
|
||||||
#[arg(short = 'c', long = "config", help = "Specify config file to use")]
|
|
||||||
config: PathBuf,
|
|
||||||
|
|
||||||
#[arg(
|
#[arg(
|
||||||
short = 'l',
|
short = 'l',
|
||||||
long,
|
long,
|
||||||
|
|
@ -46,12 +44,11 @@ struct Args {
|
||||||
log_level: Level,
|
log_level: Level,
|
||||||
|
|
||||||
#[arg(
|
#[arg(
|
||||||
short,
|
|
||||||
long,
|
long,
|
||||||
default_value_t = false,
|
default_value_os_t = default_dfget_log_dir(),
|
||||||
help = "Print more information about the download progress"
|
help = "Specify the log directory"
|
||||||
)]
|
)]
|
||||||
verbose: bool,
|
log_dir: PathBuf,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use crate::config::{default_config_dir, default_log_dir};
|
use crate::config::default_log_dir;
|
||||||
use std::path::PathBuf;
|
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.
|
// default_dfget_log_dir is the default log directory for dfget.
|
||||||
pub fn default_dfget_log_dir() -> PathBuf {
|
pub fn default_dfget_log_dir() -> PathBuf {
|
||||||
default_log_dir().join("dfget")
|
default_log_dir().join("dfget")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue