Created
April 29, 2024 13:11
-
-
Save kourbou/6abfedf9d18d82a674e411b8312269a5 to your computer and use it in GitHub Desktop.
Quick'n'dirty executable wrapper in Rust.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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