fix: keep shell program opt when checking
This commit is contained in:
parent
35b40328a1
commit
69c5dff3bb
1 changed files with 4 additions and 8 deletions
12
src/main.rs
12
src/main.rs
|
|
@ -107,14 +107,10 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||||
Some("--no-daemon") => {
|
Some("--no-daemon") => {
|
||||||
daemonize = false;
|
daemonize = false;
|
||||||
}
|
}
|
||||||
Some("-e") | Some("--command") => {
|
Some("-e") | Some("--command") | Some("--") => {
|
||||||
// Handle the '--command' or '-e' flag
|
// Handle the '--command' or '-e' flag
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Some("--") => {
|
|
||||||
// End of flags, the next args are shell-related
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
_ => {
|
_ => {
|
||||||
//TODO: should this throw an error?
|
//TODO: should this throw an error?
|
||||||
log::warn!("ignored argument {:?}", arg);
|
log::warn!("ignored argument {:?}", arg);
|
||||||
|
|
@ -123,7 +119,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||||
}
|
}
|
||||||
// After flags, process remaining shell program and args
|
// After flags, process remaining shell program and args
|
||||||
while let Some(arg) = raw_args.next_os(&mut cursor) {
|
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());
|
shell_args.push(arg.to_string_lossy().to_string());
|
||||||
} else {
|
} else {
|
||||||
shell_program_opt = Some(arg.to_string_lossy().to_string());
|
shell_program_opt = Some(arg.to_string_lossy().to_string());
|
||||||
|
|
@ -192,7 +188,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||||
startup_options,
|
startup_options,
|
||||||
term_config,
|
term_config,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Run the cosmic app
|
// Run the cosmic app
|
||||||
cosmic::app::run::<App>(settings, flags)?;
|
cosmic::app::run::<App>(settings, flags)?;
|
||||||
|
|
||||||
|
|
@ -203,7 +199,7 @@ fn print_help() {
|
||||||
println!(
|
println!(
|
||||||
r#"COSMIC Terminal
|
r#"COSMIC Terminal
|
||||||
Designed for the COSMIC™ desktop environment, cosmic-term is a libcosmic-based terminal emulator.
|
Designed for the COSMIC™ desktop environment, cosmic-term is a libcosmic-based terminal emulator.
|
||||||
|
|
||||||
Project home page: https://github.com/pop-os/cosmic-term
|
Project home page: https://github.com/pop-os/cosmic-term
|
||||||
Options:
|
Options:
|
||||||
--help Show this message
|
--help Show this message
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue