use clap::Parser;
use std::collections::HashMap;
use std::process::{Command, Stdio};
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
repo: String,
host: Option<String>,
checkout: Option<String>,
}
fn main() {
let args = Args::parse();
let mut info_map: HashMap<&String, Vec<Option<String>>> = HashMap::new();
let mut info_vec: Vec<Option<String>> = Vec::new();
info_vec.push(args.host);
info_vec.push(args.checkout);
info_map.insert(&args.repo, info_vec);
let mut git_uname = Command::new("git");
git_uname.arg("config").arg("--global").arg("user.name");
let git_uname = git_uname.stdout(Stdio::piped())
.output()
.unwrap();
let mut stdout = String::from_utf8(git_uname.stdout).unwrap();
stdout.pop();
let git_ssh_com: String = "git@github.com:".to_string();
let repo: String = args.repo.to_string();
let final_com = format!("{}{}/{}.git", git_ssh_com, stdout, repo);
let mut gegit_com = Command::new("git");
gegit_com.arg("clone").arg(final_com);
gegit_com.output().unwrap();
}