From d0a3b5dd64d68bb07b6351d02b8b1d383dd8fbf4 Mon Sep 17 00:00:00 2001 From: Zynh0722 Date: Wed, 31 Jan 2024 18:07:58 -0800 Subject: [PATCH] happy path first --- src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index bd24daa..230bc2f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,12 +29,12 @@ fn become_wm(conn: &C, screen: &Screen) -> anyhow::Result<()> { fn handle_args() { let mut args = std::env::args().skip(1); if let Some(arg) = args.next() { - if arg != "-v" { - eprintln!("usage: rswm [-v]"); - exit(1); - } else { + if arg == "-v" { println!("rswm-{}", env!("CARGO_PKG_VERSION")); exit(0); + } else { + eprintln!("usage: rswm [-v]"); + exit(1); } } }