Skip to content

Commit

Permalink
Fix stdout freerdp and clean up after merge of #26
Browse files Browse the repository at this point in the history
  • Loading branch information
LDprg committed Oct 9, 2023
1 parent 61374be commit 2588995
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 4 additions & 6 deletions winapps-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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::<String>("APP"));
}

Some(("vm", command)) => {
let config = winapps::load_config(None);

match command.subcommand() {
Some(("create", _)) => {
println!("Creating windows 10 vm..");
Expand Down
4 changes: 4 additions & 0 deletions winapps/src/freerdp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()));

Expand All @@ -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([
Expand Down

0 comments on commit 2588995

Please sign in to comment.