From 25889959ae441ffc7abecdfd107a97db92721042 Mon Sep 17 00:00:00 2001 From: LDprg Date: Mon, 9 Oct 2023 10:27:54 +0200 Subject: [PATCH] Fix stdout freerdp and clean up after merge of #26 --- winapps-cli/src/main.rs | 10 ++++------ winapps/src/freerdp.rs | 4 ++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/winapps-cli/src/main.rs b/winapps-cli/src/main.rs index b06a96d..4b6113a 100644 --- a/winapps-cli/src/main.rs +++ b/winapps-cli/src/main.rs @@ -1,4 +1,4 @@ -use clap::Command; +use clap::{arg, Command}; use winapps::freerdp::freerdp_back::Freerdp; use winapps::quickemu::{create_vm, kill_vm, start_vm}; use winapps::RemoteClient; @@ -33,28 +33,26 @@ fn main() { let matches = cli.clone().get_matches(); let client: &dyn RemoteClient = &Freerdp {}; + let config = winapps::load_config(None); match matches.subcommand() { Some(("check", _)) => { println!("Checking remote connection"); + client.check_depends(config); } Some(("connect", _)) => { println!("Connecting to remote"); - - let config = winapps::load_config(None); + client.run_app(config, None); } Some(("app", sub_matches)) => { println!("Connecting to app on remote"); - let config = winapps::load_config(None); client.run_app(config, sub_matches.get_one::("APP")); } Some(("vm", command)) => { - let config = winapps::load_config(None); - match command.subcommand() { Some(("create", _)) => { println!("Creating windows 10 vm.."); diff --git a/winapps/src/freerdp.rs b/winapps/src/freerdp.rs index 9041663..af13b1d 100644 --- a/winapps/src/freerdp.rs +++ b/winapps/src/freerdp.rs @@ -9,6 +9,7 @@ pub mod freerdp_back { fn check_depends(&self, config: Config) { let mut xfreerdp = Command::new("xfreerdp"); xfreerdp.stdout(Stdio::null()); + xfreerdp.stderr(Stdio::null()); xfreerdp.args(["-h"]); xfreerdp .spawn() @@ -17,6 +18,7 @@ pub mod freerdp_back { println!("All dependencies found!"); println!("Running explorer as test!"); + println!("Check yourself if it appears correctly!"); self.run_app(config, Some(&"explorer.exe".to_string())); @@ -25,6 +27,8 @@ pub mod freerdp_back { fn run_app(&self, config: Config, app: Option<&String>) { let mut xfreerdp = Command::new("xfreerdp"); + xfreerdp.stdout(Stdio::null()); + xfreerdp.stderr(Stdio::null()); match app { Some(exe) => { xfreerdp.args([