mirror of
https://github.com/winapps-org/winapps.git
synced 2025-06-06 15:17:19 +02:00
Fix stdout freerdp and clean up after merge of #26
This commit is contained in:
parent
61374be7ad
commit
25889959ae
@ -1,4 +1,4 @@
|
|||||||
use clap::Command;
|
use clap::{arg, Command};
|
||||||
use winapps::freerdp::freerdp_back::Freerdp;
|
use winapps::freerdp::freerdp_back::Freerdp;
|
||||||
use winapps::quickemu::{create_vm, kill_vm, start_vm};
|
use winapps::quickemu::{create_vm, kill_vm, start_vm};
|
||||||
use winapps::RemoteClient;
|
use winapps::RemoteClient;
|
||||||
@ -33,28 +33,26 @@ fn main() {
|
|||||||
let matches = cli.clone().get_matches();
|
let matches = cli.clone().get_matches();
|
||||||
|
|
||||||
let client: &dyn RemoteClient = &Freerdp {};
|
let client: &dyn RemoteClient = &Freerdp {};
|
||||||
|
let config = winapps::load_config(None);
|
||||||
|
|
||||||
match matches.subcommand() {
|
match matches.subcommand() {
|
||||||
Some(("check", _)) => {
|
Some(("check", _)) => {
|
||||||
println!("Checking remote connection");
|
println!("Checking remote connection");
|
||||||
|
|
||||||
client.check_depends(config);
|
client.check_depends(config);
|
||||||
}
|
}
|
||||||
Some(("connect", _)) => {
|
Some(("connect", _)) => {
|
||||||
println!("Connecting to remote");
|
println!("Connecting to remote");
|
||||||
|
|
||||||
let config = winapps::load_config(None);
|
|
||||||
client.run_app(config, None);
|
client.run_app(config, None);
|
||||||
}
|
}
|
||||||
Some(("app", sub_matches)) => {
|
Some(("app", sub_matches)) => {
|
||||||
println!("Connecting to app on remote");
|
println!("Connecting to app on remote");
|
||||||
|
|
||||||
let config = winapps::load_config(None);
|
|
||||||
client.run_app(config, sub_matches.get_one::<String>("APP"));
|
client.run_app(config, sub_matches.get_one::<String>("APP"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(("vm", command)) => {
|
Some(("vm", command)) => {
|
||||||
let config = winapps::load_config(None);
|
|
||||||
|
|
||||||
match command.subcommand() {
|
match command.subcommand() {
|
||||||
Some(("create", _)) => {
|
Some(("create", _)) => {
|
||||||
println!("Creating windows 10 vm..");
|
println!("Creating windows 10 vm..");
|
||||||
|
@ -9,6 +9,7 @@ pub mod freerdp_back {
|
|||||||
fn check_depends(&self, config: Config) {
|
fn check_depends(&self, config: Config) {
|
||||||
let mut xfreerdp = Command::new("xfreerdp");
|
let mut xfreerdp = Command::new("xfreerdp");
|
||||||
xfreerdp.stdout(Stdio::null());
|
xfreerdp.stdout(Stdio::null());
|
||||||
|
xfreerdp.stderr(Stdio::null());
|
||||||
xfreerdp.args(["-h"]);
|
xfreerdp.args(["-h"]);
|
||||||
xfreerdp
|
xfreerdp
|
||||||
.spawn()
|
.spawn()
|
||||||
@ -17,6 +18,7 @@ pub mod freerdp_back {
|
|||||||
|
|
||||||
println!("All dependencies found!");
|
println!("All dependencies found!");
|
||||||
println!("Running explorer as test!");
|
println!("Running explorer as test!");
|
||||||
|
println!("Check yourself if it appears correctly!");
|
||||||
|
|
||||||
self.run_app(config, Some(&"explorer.exe".to_string()));
|
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>) {
|
fn run_app(&self, config: Config, app: Option<&String>) {
|
||||||
let mut xfreerdp = Command::new("xfreerdp");
|
let mut xfreerdp = Command::new("xfreerdp");
|
||||||
|
xfreerdp.stdout(Stdio::null());
|
||||||
|
xfreerdp.stderr(Stdio::null());
|
||||||
match app {
|
match app {
|
||||||
Some(exe) => {
|
Some(exe) => {
|
||||||
xfreerdp.args([
|
xfreerdp.args([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user