feat: add the files into a settings parameter

macos-click-through
Sergio Ribera 2 years ago
parent 86aa2751a1
commit be8b826659

@ -22,6 +22,8 @@ pub struct CmdLineSettings {
pub neovim_bin: Option<String>,
pub wayland_app_id: String,
pub x11_wm_class: String,
// Command-line arguments with multiple files
pub files: Vec<String>,
}
impl Default for CmdLineSettings {
@ -45,6 +47,8 @@ impl Default for CmdLineSettings {
neovim_bin: None,
wayland_app_id: String::new(),
x11_wm_class: String::new(),
// Command-line arguments with multiple files
files: vec![],
}
}
}
@ -197,6 +201,11 @@ pub fn handle_command_line_arguments(args: Vec<String>) -> Result<(), String> {
.map(|v| v.to_owned())
.or_else(|| std::env::var("NEOVIDE_X11_WM_CLASS").ok())
.unwrap_or_else(|| "neovide".to_owned()),
// Command-line arguments with multiple files
files: matches
.values_of("files_to_open")
.map(|opt| opt.map(|v| v.to_owned()).collect())
.unwrap_or_default(),
});
Ok(())
}

Loading…
Cancel
Save