mirror of https://github.com/helix-editor/helix
Avoid allocating the `--help` message (#12243)
parent
3b36cf1a15
commit
250d9fa8fe
|
@ -40,7 +40,14 @@ fn main() -> Result<()> {
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main_impl() -> Result<i32> {
|
async fn main_impl() -> Result<i32> {
|
||||||
let help = format!(
|
let mut 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());
|
||||||
|
|
||||||
|
// Help has a higher priority and should be handled separately.
|
||||||
|
if args.display_help {
|
||||||
|
print!(
|
||||||
"\
|
"\
|
||||||
{} {}
|
{} {}
|
||||||
{}
|
{}
|
||||||
|
@ -75,15 +82,6 @@ FLAGS:
|
||||||
env!("CARGO_PKG_DESCRIPTION"),
|
env!("CARGO_PKG_DESCRIPTION"),
|
||||||
helix_loader::default_log_file().display(),
|
helix_loader::default_log_file().display(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut 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());
|
|
||||||
|
|
||||||
// Help has a higher priority and should be handled separately.
|
|
||||||
if args.display_help {
|
|
||||||
print!("{}", help);
|
|
||||||
std::process::exit(0);
|
std::process::exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue