Skip to content

Instantly share code, notes, and snippets.

@kourbou
Created April 29, 2024 13:11
Show Gist options
  • Select an option

  • Save kourbou/6abfedf9d18d82a674e411b8312269a5 to your computer and use it in GitHub Desktop.

Select an option

Save kourbou/6abfedf9d18d82a674e411b8312269a5 to your computer and use it in GitHub Desktop.
Quick'n'dirty executable wrapper in Rust.
use std::env;
use std::io::Result;
use std::process::{Command, ExitCode, Stdio};
fn main() -> Result<ExitCode> {
let status = Command::new(r"C:\Program Files\Git\usr\bin\vim.exe")
.args(env::args().skip(1))
.stdin(Stdio::inherit())
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.status()?
.code()
.unwrap_or(1) as u8;
Ok(ExitCode::from(status))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment