Skip to content
Snippets Groups Projects
Verified Commit 186d5b26 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

0.2.19 - redoxer env will behave like env command

parent a02f9e98
No related branches found
No related tags found
No related merge requests found
...@@ -823,7 +823,7 @@ dependencies = [ ...@@ -823,7 +823,7 @@ dependencies = [
[[package]] [[package]]
name = "redoxer" name = "redoxer"
version = "0.2.18" version = "0.2.19"
dependencies = [ dependencies = [
"dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-mounts 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "proc-mounts 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
......
[package] [package]
name = "redoxer" name = "redoxer"
version = "0.2.18" version = "0.2.19"
description = "Method for quickly running programs inside of Redox from a KVM capable OS." description = "Method for quickly running programs inside of Redox from a KVM capable OS."
license = "MIT" license = "MIT"
authors = ["Jeremy Soller <jackpot51@gmail.com>"] authors = ["Jeremy Soller <jackpot51@gmail.com>"]
......
...@@ -35,20 +35,8 @@ pub fn command<S: AsRef<ffi::OsStr>>(program: S) -> io::Result<process::Command> ...@@ -35,20 +35,8 @@ pub fn command<S: AsRef<ffi::OsStr>>(program: S) -> io::Result<process::Command>
} }
fn inner<I: Iterator<Item=String>>(args: I) -> io::Result<()> { fn inner<I: Iterator<Item=String>>(args: I) -> io::Result<()> {
let mut program_opt = None; command("env")?
let mut arguments = Vec::new(); .args(args)
for arg in args.skip(2) {
if program_opt.is_none() {
program_opt = Some(arg);
} else {
arguments.push(arg);
}
}
//TODO: get user's default shell?
let program = program_opt.unwrap_or("bash".to_string());
command(program)?
.args(arguments)
.status() .status()
.and_then(status_error)?; .and_then(status_error)?;
...@@ -56,7 +44,7 @@ fn inner<I: Iterator<Item=String>>(args: I) -> io::Result<()> { ...@@ -56,7 +44,7 @@ fn inner<I: Iterator<Item=String>>(args: I) -> io::Result<()> {
} }
pub fn main(args: &[String]) { pub fn main(args: &[String]) {
match inner(args.iter().cloned()) { match inner(args.iter().cloned().skip(2)) {
Ok(()) => { Ok(()) => {
process::exit(0); process::exit(0);
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment