From 57da0593791d05e16f576a53b65f01e38114cf77 Mon Sep 17 00:00:00 2001 From: Revertron Date: Fri, 19 Mar 2021 15:20:18 +0100 Subject: [PATCH] Fixed GUI/NoGUI logic in builds. --- Cargo.toml | 2 +- src/main.rs | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8d885b9..7f17d53 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "alfis" -version = "0.3.1" +version = "0.3.2" authors = ["Revertron "] edition = "2018" build = "build.rs" diff --git a/src/main.rs b/src/main.rs index d85e866..a82c54d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,7 +18,7 @@ use winapi::um::wincon::{ATTACH_PARENT_PROCESS, AttachConsole, FreeConsole}; use alfis::{Block, Bytes, Chain, Miner, Context, Network, Settings, dns_utils, Keystore}; use alfis::blockchain::BLOCK_DIFFICULTY; -#[cfg(webui)] +#[cfg(feature = "webgui")] mod web_ui; const SETTINGS_FILENAME: &str = "alfis.toml"; @@ -38,8 +38,7 @@ fn main() { let mut opts = Options::new(); opts.optflag("h", "help", "Print this help menu"); - #[cfg(webui)] - opts.optflag("n", "nogui", "Run without graphic user interface"); + opts.optflag("n", "nogui", "Run without graphic user interface (default for no gui builds)"); opts.optflag("v", "verbose", "Show more debug messages"); opts.optflag("d", "debug", "Show trace messages, more than debug"); opts.optflag("l", "list", "List blocks from DB and exit"); @@ -56,9 +55,9 @@ fn main() { return; } - #[cfg(webui)] + #[cfg(feature = "webgui")] let no_gui = opt_matches.opt_present("n"); - #[cfg(not(webui))] + #[cfg(not(feature = "webgui"))] let no_gui = true; let mut level = LevelFilter::Info; @@ -116,7 +115,7 @@ fn main() { thread::sleep(sleep); } } else { - #[cfg(webui)] + #[cfg(feature = "webgui")] web_ui::run_interface(context.clone(), miner.clone()); }