Pi66

walrs
pywal but if its Fast-Minimal-Simple
git clone https://git.pi66.xyz/walrs

← back to log

use argh instead of clap and removing auto complete

author: pixel2175
date: 2025-05-31 20:28
hash: 55fb8e3f768dc0598f490a368294ef9e36a4dc0f

Diffstat:

M

src/main.rs
10 ++++++++++++++++++++++++++++++
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/src/main.rs b/src/main.rs
index 450c1a9..447e2dc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -87,6 +87,9 @@ struct Arg {
         description = "set quit mode (no output)"
     )]
     quit: bool,
+
+    #[argh(switch, short = 'v', long = "version", description = "version ")]
+    version: bool,
 }

 fn image_path(image: Option<String>, send: bool) -> String {
@@ -161,6 +164,13 @@ fn main() {
         }
         None => "kmeans".to_string(),
     };
+    if arg.version {
+        info(
+            "Version",
+            &format!("walrs {}", env!("CARGO_PKG_VERSION")),
+            !arg.quit,
+        );
+    }

     if arg.reload_nowal {
         reload(!arg.quit, true);