-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow extra command line arguments #297
Comments
Evcxr has two processes, both of which are the So I think it would be possible to pass extra arguments to this subprocess, which would, by default, ignore them. If you clone the evcxr repository, then edit diff --git a/evcxr/src/child_process.rs b/evcxr/src/child_process.rs
index ef15635..1bdaf90 100644
--- a/evcxr/src/child_process.rs
+++ b/evcxr/src/child_process.rs
@@ -37,6 +37,7 @@ impl ChildProcess {
bail!("Our current binary doesn't call runtime_hook()");
}
command
+ .arg("--foo")
.env(runtime::EVCXR_IS_RUNTIME_VAR, "1")
.env("RUST_BACKTRACE", "1")
.stdin(std::process::Stdio::piped()) If you then run
Hopefully that helps |
“Allow extra command line arguments” evcxr#297
This now works similarly to how it works with the python REPL. All arguments after -- get passed to the subprocess. #297
Rust newbies (trust me) sometimes need to see what gets passed in as command-line arguments, via env::args or more complicated techniques. Currently std::env::args() just has something like
Args { inner: ["~/.cargo/bin/evcxr"] }
, even if--opt 2
was passed, and extra arguments stop evcxr from launching. Currently I need to pass in and inspect a bunch of arguments escaped in different ways, so I’d like evcxr just to accept them and put them in std::env::args(), perhaps after an--extra-args
argument.The text was updated successfully, but these errors were encountered: