From 69c5dff3bbd39b10f31d4ce7deff867db3bc8068 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Thu, 7 Aug 2025 23:44:53 -0400 Subject: [PATCH] fix: keep shell program opt when checking --- src/main.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0bd1fb0..bdb7b70 100644 --- a/src/main.rs +++ b/src/main.rs @@ -107,14 +107,10 @@ fn main() -> Result<(), Box> { Some("--no-daemon") => { daemonize = false; } - Some("-e") | Some("--command") => { + Some("-e") | Some("--command") | Some("--") => { // Handle the '--command' or '-e' flag break; } - Some("--") => { - // End of flags, the next args are shell-related - break; - } _ => { //TODO: should this throw an error? log::warn!("ignored argument {:?}", arg); @@ -123,7 +119,7 @@ fn main() -> Result<(), Box> { } // After flags, process remaining shell program and args while let Some(arg) = raw_args.next_os(&mut cursor) { - if let Some(program) = shell_program_opt.take() { + if shell_program_opt.is_some() { shell_args.push(arg.to_string_lossy().to_string()); } else { shell_program_opt = Some(arg.to_string_lossy().to_string()); @@ -192,7 +188,7 @@ fn main() -> Result<(), Box> { startup_options, term_config, }; - + // Run the cosmic app cosmic::app::run::(settings, flags)?; @@ -203,7 +199,7 @@ fn print_help() { println!( r#"COSMIC Terminal Designed for the COSMICâ„¢ desktop environment, cosmic-term is a libcosmic-based terminal emulator. - + Project home page: https://github.com/pop-os/cosmic-term Options: --help Show this message