// this code can be compiled to a native binary so that the application can be invoked without explicitly using mono or setting up binfmt
// this also is useful as mono does not use the PATH environment variable to find assemblies - it only looks in the current working directory.

use std::env;
use std::process::Command;

fn main() {
    let mut args: Vec<String> = env::args().collect();

    args.remove(0);

    let mut gui_process_cmd = Command::new("mono");

    gui_process_cmd.arg("/usr/bin/csharp_sshuttle_gui.exe");

    for arg in args {
        gui_process_cmd.arg(arg);
    }

    let mut gui_process = gui_process_cmd.spawn().unwrap();
    let _ = gui_process.wait();
}