# HG changeset patch # User Jiri Vanek # Date 1547456078 -3600 # Node ID cc006da2a3f6d415441b987c2d4af112bc3fdf83 # Parent e5394f3f30d351163e78e94734253679569b9cfa Added support for -J options * rust-launcher/src/main.rs: arguments are now copied to sub-process in two steps First those with -J prefix are having it stripped and are given to JVM. Those withou J are suffixed to the itw itself diff -r e5394f3f30d3 -r cc006da2a3f6 ChangeLog --- a/ChangeLog Mon Jan 14 09:48:26 2019 +0100 +++ b/ChangeLog Mon Jan 14 09:54:38 2019 +0100 @@ -1,3 +1,10 @@ +2019-01-14 Jiri Vanek + + Added support for -J options + * rust-launcher/src/main.rs: arguments are now copied to sub-process in two steps + First those with -J prefix are having it stripped and are given to JVM. Those withou J are + suffixed to the itw itself + 2019-01-14 Jiri Vanek Added code-coverage for rust launchers diff -r e5394f3f30d3 -r cc006da2a3f6 rust-launcher/src/main.rs --- a/rust-launcher/src/main.rs Mon Jan 14 09:48:26 2019 +0100 +++ b/rust-launcher/src/main.rs Mon Jan 14 09:54:38 2019 +0100 @@ -101,7 +101,22 @@ bin_name.push_str(¤t_name); bin_location.push_str(&dirs_paths_helper::path_to_string(¤t_bin)); + let a = env::args(); + let s = a.skip(1); + let c: std::vec::Vec = s.collect(); + let mut all_args = std::vec::Vec::new(); + for f in c.iter() { + if f.to_string().starts_with("-J") { + let s = String::from(f.to_string().get(2..).expect("-J should be substring-able by 2")); + if s.is_empty() { + os.info("Warning, empty -J switch") + } else { + all_args.push(s); + } + } + } + all_args.push(bootcp); all_args.push(String::from("-classpath")); all_args.push(cp); @@ -109,12 +124,10 @@ all_args.push(bin_location); all_args.push(hardcoded_paths::get_main().to_string()); - - let a = env::args(); - let s = a.skip(1); - let c: std::vec::Vec = s.collect(); for f in c.iter() { - all_args.push(f.to_string()); + if !f.to_string().starts_with("-J") { + all_args.push(f.to_string()); + } } let mut child = os.spawn_java_process(&java_dir, &all_args);