make gui open whenever no args are supplied

This commit is contained in:
Daniella 2022-08-21 20:03:06 +02:00
parent e4ff6329ec
commit 1ebc3b4911
3 changed files with 7 additions and 4 deletions

2
Cargo.lock generated
View file

@ -346,7 +346,7 @@ dependencies = [
[[package]]
name = "qft"
version = "0.5.0"
version = "0.5.1"
dependencies = [
"iui",
"rand",

View file

@ -1,6 +1,6 @@
[package]
name = "qft"
version = "0.5.0"
version = "0.5.1"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -258,7 +258,7 @@ impl SafeReadWrite {
fn main() {
let args: Vec<String> = std::env::args().collect();
if args.len() <= 1 {
if args.len() == 0 {
print_args(&args);
}
match args
@ -271,7 +271,10 @@ fn main() {
"receiver" => receiver(&args, |_| {}),
"gui" => gui::gui().expect("can't use gui"),
"version" => println!("QFT version: {}", env!("CARGO_PKG_VERSION")),
_ => print_args(&args),
_ => match gui::gui() {
Ok(_) => {},
Err(_) => print_args(&args),
},
}
}