From 6508966a2b4aaebb6fa183193cf4ea5d3ef38ce2 Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Mon, 23 Oct 2023 06:49:05 +0200
Subject: [PATCH] MISC: Don't need to build an 'open' bin, just need the
 library functionalities

---
 lektor_utils/Cargo.toml       |  6 ------
 lektor_utils/src/open/main.rs | 24 ------------------------
 2 files changed, 30 deletions(-)
 delete mode 100644 lektor_utils/src/open/main.rs

diff --git a/lektor_utils/Cargo.toml b/lektor_utils/Cargo.toml
index a0c54bbe..b938a47e 100644
--- a/lektor_utils/Cargo.toml
+++ b/lektor_utils/Cargo.toml
@@ -6,12 +6,6 @@ authors.workspace = true
 license.workspace = true
 description = "Utilities in common for all the crates in the workspace"
 
-[[bin]]
-test = false
-doc = false
-name = "open"
-path = "src/open/main.rs"
-
 [lib]
 doctest = false
 
diff --git a/lektor_utils/src/open/main.rs b/lektor_utils/src/open/main.rs
deleted file mode 100644
index 0c532be5..00000000
--- a/lektor_utils/src/open/main.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-use lektor_utils::open;
-use std::env;
-
-fn main() -> Result<(), Box<dyn std::error::Error>> {
-    let mut args = env::args();
-    let path_or_url = match args.nth(1) {
-        Some(arg) => arg,
-        None => return Err("usage: open <path-or-url> [--with|-w program]".into()),
-    };
-
-    match args.next() {
-        Some(arg) if arg == "--with" || arg == "-w" => {
-            let program = args
-                .next()
-                .ok_or("--with must be followed by the program to use for opening")?;
-            open::with(&path_or_url, program)
-        }
-        Some(arg) => return Err(format!("Argument '{arg}' is invalid").into()),
-        None => open::that(&path_or_url),
-    }?;
-
-    println!("Opened '{}' successfully.", path_or_url);
-    Ok(())
-}
-- 
GitLab