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