From 528d6167775e24e3cb54e3a556d732bdab6a05da Mon Sep 17 00:00:00 2001 From: John Doty Date: Tue, 20 Dec 2022 07:20:16 -0800 Subject: [PATCH] Single binary for browsing Some systems require a single binary for the BROWSER variable, and rather than muck about with shell scripts we have this small thing instead. --- Cargo.toml | 5 +++++ src/bin/fwd-browse.rs | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/bin/fwd-browse.rs diff --git a/Cargo.toml b/Cargo.toml index 7df30ed..ced816f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,11 @@ homepage = "https://github.com/DeCarabas/fwd" repository = "https://github.com/DeCarabas/fwd" readme = "README.md" +[[bin]] +name = "fwd-browse" +test = false +bench = false + [dependencies] anyhow = "1.0" bytes = "1" diff --git a/src/bin/fwd-browse.rs b/src/bin/fwd-browse.rs new file mode 100644 index 0000000..bbebcdf --- /dev/null +++ b/src/bin/fwd-browse.rs @@ -0,0 +1,13 @@ +// TODO: An actual proper UI. + +#[tokio::main] +async fn main() { + let args: Vec = std::env::args().collect(); + + if args.len() < 2 { + eprintln!("Usage: fwd-browse "); + std::process::exit(1); + } + + fwd::browse_url(&args[1]).await; +}