From 8fb9ef4a05f90410dcf658de33449faac8d27bad Mon Sep 17 00:00:00 2001 From: galister <22305755+galister@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:28:32 +0900 Subject: [PATCH] openvr: fix autolaunch --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9a4e6a8..a7cd7f6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,7 +21,7 @@ use clap::Parser; use flexi_logger::{Duplicate, FileSpec, LogSpecification}; /// The lightweight desktop overlay for OpenVR and OpenXR -#[derive(Parser, Debug)] +#[derive(Default, Parser, Debug)] #[command(version, about, long_about = None)] struct Args { #[cfg(feature = "openvr")] @@ -57,7 +57,11 @@ struct Args { } fn main() -> Result<(), Box> { - let mut args = Args::parse(); + let mut args = if std::env::args().skip(1).any(|a| !a.is_empty()) { + Args::parse() + } else { + Args::default() + }; if !args.multi && !ensure_single_instance(args.replace) { println!("Looks like WlxOverlay-S is already running.");