diff --git a/src/cmd_line.rs b/src/cmd_line.rs index adee7be..510d341 100644 --- a/src/cmd_line.rs +++ b/src/cmd_line.rs @@ -22,6 +22,8 @@ pub struct CmdLineSettings { pub neovim_bin: Option, pub wayland_app_id: String, pub x11_wm_class: String, + // Command-line arguments with multiple files + pub files: Vec, } 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) -> 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(()) }