Skip to content

Commit

Permalink
feat: option to disable automatically opening a browser
Browse files Browse the repository at this point in the history
  • Loading branch information
frectonz committed Aug 6, 2024
1 parent f999f89 commit 7451dd3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ struct Args {
/// Base path to be provided to the UI. [e.g /sql-studio]
#[clap(short, long)]
base_path: Option<String>,

/// Don't open URL in the system browser.
#[clap(short, long)]
no_browser: bool,
}

#[derive(Debug, Subcommand)]
Expand Down Expand Up @@ -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:?}");
}
Expand Down

0 comments on commit 7451dd3

Please sign in to comment.