Description: rename executable binary for co-existence with Python tool
Author: Jonas Smedegaard <dr@jones.dk>
Forwarded: not-needed
Last-Update: 2024-04-16
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,6 +10,10 @@
 keywords = ["hypothesis", "annotation", "api", "cli"]
 categories = ["api-bindings", "command-line-utilities"]
 
+[[bin]]
+path = "src/main.rs"
+name = "hypothesis-client"
+
 [features]
 default = ["cli"]
 
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -15,7 +15,7 @@
 
 #[derive(Debug, Parser)]
 #[clap(
-    name = "hypothesis",
+    name = "hypothesis-client",
     about = "Call the Hypothesis API from the comfort of your terminal"
 )]
 pub enum HypothesisCLI {
--- a/tests/cli.rs
+++ b/tests/cli.rs
@@ -12,7 +12,7 @@
     key: &str,
     group_id: &str,
 ) -> color_eyre::Result<String> {
-    let mut cmd = Command::cargo_bin("hypothesis")?;
+    let mut cmd = Command::cargo_bin("hypothesis-client")?;
     let output = cmd
         .env("HYPOTHESIS_NAME", username)
         .env("HYPOTHESIS_KEY", key)
@@ -41,7 +41,7 @@
     let id = id.unwrap();
 
     // Fetch created annotation
-    let mut cmd = Command::cargo_bin("hypothesis")?;
+    let mut cmd = Command::cargo_bin("hypothesis-client")?;
     cmd.env("HYPOTHESIS_NAME", &username)
         .env("HYPOTHESIS_KEY", &key)
         .arg("annotations")
@@ -53,7 +53,7 @@
         );
 
     // Delete annotation
-    let mut cmd = Command::cargo_bin("hypothesis")?;
+    let mut cmd = Command::cargo_bin("hypothesis-client")?;
     cmd.env("HYPOTHESIS_NAME", &username)
         .env("HYPOTHESIS_KEY", &key)
         .arg("annotations")
@@ -77,7 +77,7 @@
     let id = id.unwrap();
 
     // Update annotation
-    let mut cmd = Command::cargo_bin("hypothesis")?;
+    let mut cmd = Command::cargo_bin("hypothesis-client")?;
     cmd.env("HYPOTHESIS_NAME", &username)
         .env("HYPOTHESIS_KEY", &key)
         .arg("annotations")
@@ -88,7 +88,7 @@
         .stdout(predicate::str::starts_with("Updated").and(predicate::str::contains(&id)));
 
     // Fetch updated annotation
-    let mut cmd = Command::cargo_bin("hypothesis")?;
+    let mut cmd = Command::cargo_bin("hypothesis-client")?;
     cmd.env("HYPOTHESIS_NAME", &username)
         .env("HYPOTHESIS_KEY", &key)
         .arg("annotations")
@@ -98,7 +98,7 @@
         .stdout(predicate::str::contains(&id).and(predicate::str::contains("test text 2")));
 
     // Delete annotation
-    let mut cmd = Command::cargo_bin("hypothesis")?;
+    let mut cmd = Command::cargo_bin("hypothesis-client")?;
     cmd.env("HYPOTHESIS_NAME", &username)
         .env("HYPOTHESIS_KEY", &key)
         .arg("annotations")
@@ -121,7 +121,7 @@
 
     let duration = time::Duration::from_millis(500);
     thread::sleep(duration);
-    let mut cmd = Command::cargo_bin("hypothesis")?;
+    let mut cmd = Command::cargo_bin("hypothesis-client")?;
     let output = cmd
         .env("HYPOTHESIS_NAME", &username)
         .env("HYPOTHESIS_KEY", &key)
@@ -139,7 +139,7 @@
     }
     assert_eq!(count, 4);
     for id in ids {
-        let mut cmd = Command::cargo_bin("hypothesis")?;
+        let mut cmd = Command::cargo_bin("hypothesis-client")?;
         cmd.env("HYPOTHESIS_NAME", &username)
             .env("HYPOTHESIS_KEY", &key)
             .arg("annotations")
@@ -157,7 +157,7 @@
     username: &str,
     key: &str,
 ) -> color_eyre::Result<String> {
-    let mut cmd = Command::cargo_bin("hypothesis")?;
+    let mut cmd = Command::cargo_bin("hypothesis-client")?;
     let output = cmd
         .env("HYPOTHESIS_NAME", username)
         .env("HYPOTHESIS_KEY", key)
@@ -184,7 +184,7 @@
     let group_id = group_id.unwrap();
 
     // Fetch created group
-    let mut cmd = Command::cargo_bin("hypothesis")?;
+    let mut cmd = Command::cargo_bin("hypothesis-client")?;
     cmd.env("HYPOTHESIS_NAME", &username)
         .env("HYPOTHESIS_KEY", &key)
         .arg("groups")
@@ -194,7 +194,7 @@
         .stdout(predicate::str::contains(&group_id).and(predicate::str::contains("test_name")));
 
     // Leave group
-    let mut cmd = Command::cargo_bin("hypothesis")?;
+    let mut cmd = Command::cargo_bin("hypothesis-client")?;
     cmd.env("HYPOTHESIS_NAME", &username)
         .env("HYPOTHESIS_KEY", &key)
         .arg("groups")
@@ -219,7 +219,7 @@
     let group_id = group_id.unwrap();
 
     // Update group
-    let mut cmd = Command::cargo_bin("hypothesis")?;
+    let mut cmd = Command::cargo_bin("hypothesis-client")?;
     cmd.env("HYPOTHESIS_NAME", &username)
         .env("HYPOTHESIS_KEY", &key)
         .arg("groups")
@@ -234,7 +234,7 @@
         )));
 
     // Check that update worked
-    let mut cmd = Command::cargo_bin("hypothesis")?;
+    let mut cmd = Command::cargo_bin("hypothesis-client")?;
     cmd.env("HYPOTHESIS_NAME", &username)
         .env("HYPOTHESIS_KEY", &key)
         .arg("groups")
@@ -244,7 +244,7 @@
         .stdout(predicate::str::contains(&group_id).and(predicate::str::contains("test_group_2")));
 
     // Leave group
-    let mut cmd = Command::cargo_bin("hypothesis")?;
+    let mut cmd = Command::cargo_bin("hypothesis-client")?;
     cmd.env("HYPOTHESIS_NAME", &username)
         .env("HYPOTHESIS_KEY", &key)
         .arg("groups")
