From d673a6a9f3dec704324164d39bf4c60e1459dc5f Mon Sep 17 00:00:00 2001 From: Felix Zeller Date: Sat, 12 Oct 2024 13:47:22 -0700 Subject: [PATCH] add --version -v flag fix #177 --- src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.rs b/src/main.rs index d4894ba5..7c967db0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -817,8 +817,15 @@ async fn jump_to_specific( commands::jump(client, root_dir, settings, Some(day)).await } +use std::env; + #[tokio::main] async fn main() { + if env::args().any(|arg| arg == "--version" || arg == "-v") { + println!("markdown-oxide v{}", env!("CARGO_PKG_VERSION")); + return; + } + let stdin = tokio::io::stdin(); let stdout = tokio::io::stdout();