Skip to content

Commit

Permalink
Initialization should happen right after parsing arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
alevinval committed Jul 9, 2023
1 parent 5501928 commit cc2f521
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions helix-term/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ FLAGS:

let args = Args::parse_args().context("could not parse arguments")?;

helix_loader::initialize_config_file(args.config_file.clone());
helix_loader::initialize_log_file(args.log_file.clone());

setup_logging(args.verbosity).context("failed to initialize logging")?;

// Help has a higher priority and should be handled separately.
if args.display_help {
print!("{}", help);
Expand Down Expand Up @@ -109,11 +114,6 @@ FLAGS:
return Ok(0);
}

helix_loader::initialize_config_file(args.config_file.clone());
helix_loader::initialize_log_file(args.log_file.clone());

setup_logging(args.verbosity).context("failed to initialize logging")?;

let config = match Config::load_default() {
Ok(config) => config,
Err(ConfigLoadError::Error(err)) if err.kind() == std::io::ErrorKind::NotFound => {
Expand Down

0 comments on commit cc2f521

Please sign in to comment.