Skip to content

Commit

Permalink
use file name as command
Browse files Browse the repository at this point in the history
  • Loading branch information
jswh committed Jun 25, 2018
1 parent ef4f4f7 commit 3a4c198
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::env;
use std::path::Path;
use std::process::{Command, Stdio};
use std::io::{self, Write};
use std::borrow::Cow;
Expand Down Expand Up @@ -70,11 +71,14 @@ fn use_interactive_shell() -> bool {
true
}


fn main() {
let mut cmd_args = Vec::new();
let mut git_args: Vec<String> = vec![String::from("git")];
let mut git_args: Vec<String> = vec![];
let git_cmd: String;
let exe: String = env::args().next().unwrap();
let path = Path::new(&exe);
let file_stem = path.file_stem().unwrap().to_str().unwrap();
git_args.push(String::from(file_stem));

// process git command arguments
git_args.extend(env::args().skip(1)
Expand Down

0 comments on commit 3a4c198

Please sign in to comment.