From 7451dd382bc3a81f9e55844627a88c08e7127e99 Mon Sep 17 00:00:00 2001 From: frectonz Date: Wed, 7 Aug 2024 02:50:47 +0300 Subject: [PATCH] feat: option to disable automatically opening a browser --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 217234c..06a6996 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,6 +22,10 @@ struct Args { /// Base path to be provided to the UI. [e.g /sql-studio] #[clap(short, long)] base_path: Option, + + /// Don't open URL in the system browser. + #[clap(short, long)] + no_browser: bool, } #[derive(Debug, Subcommand)] @@ -142,7 +146,7 @@ async fn main() -> color_eyre::Result<()> { .recover(rejections::handle_rejection) .with(cors); - if args.base_path.is_none() { + if args.base_path.is_none() && !args.no_browser { let res = open::that(format!("http://{}", args.address)); tracing::info!("tried to open in browser: {res:?}"); }