Add a verbose/quiet pair of flags
This commit is contained in:
parent
782cde2663
commit
8726a1c6bf
4 changed files with 24 additions and 4 deletions
|
@ -39,7 +39,12 @@ mod utils;
|
|||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
color_eyre::install()?;
|
||||
pretty_env_logger::init();
|
||||
|
||||
let args = args::Opts::parse();
|
||||
|
||||
pretty_env_logger::formatted_timed_builder()
|
||||
.filter_level(args.verbose.log_level_filter())
|
||||
.init();
|
||||
|
||||
let mut conf_extractor = Figment::new();
|
||||
if let Some(project_dirs) = ProjectDirs::from("fr", "enoent", "Immich Tools") {
|
||||
|
@ -53,8 +58,6 @@ async fn main() -> Result<()> {
|
|||
warn!("Unable to determine configuration file path");
|
||||
}
|
||||
|
||||
let args = args::Opts::parse();
|
||||
|
||||
let conf: Config = conf_extractor
|
||||
.merge(FileAdapter::wrap(Env::prefixed("IMMICH_TOOLS_")))
|
||||
.merge(Serialized::defaults(&args))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue