From be8b82665922ea08d4584e1e7ed7a5779cd6b4d5 Mon Sep 17 00:00:00 2001 From: Sergio Ribera Date: Sat, 16 Apr 2022 02:02:58 -0400 Subject: [PATCH] feat: add the files into a settings parameter --- src/cmd_line.rs | 9 +++++++++ 1 file changed, 9 insertions(+) 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(()) }