Skip to content

Commit 7b301cc

Browse files
committed
feat: add --version and -v flags
1 parent b3bda9b commit 7b301cc

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.1.11] - 2026-02-20
6+
7+
### Added
8+
9+
- `--version` and `-v` flags to display current version
10+
511
## [0.1.10] - 2026-02-20
612

713
### Fixed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resolver = "2"
44

55
[package]
66
name = "xwlm"
7-
version = "0.1.10"
7+
version = "0.1.11"
88
edition = "2024"
99
description = "A TUI for managing Wayland monitor configurations (Hyprland, Sway, River)"
1010
license = "MIT"

src/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ mod config;
33
mod setup;
44
mod ui;
55

6+
use std::env;
67
use std::sync::mpsc::{self, Receiver};
78

89
use color_eyre::eyre::Result;
@@ -11,7 +12,16 @@ use xwlm_cfg::Compositor;
1112

1213
use crate::{app::App, config::AppConfig};
1314

15+
const VERSION: &str = env!("CARGO_PKG_VERSION");
16+
1417
fn main() -> Result<()> {
18+
let args: Vec<String> = env::args().collect();
19+
20+
if args.iter().any(|a| a == "--version" || a == "-v") {
21+
println!("xwlm {}", VERSION);
22+
return Ok(());
23+
}
24+
1525
color_eyre::install()?;
1626

1727
let compositor = xwlm_cfg::detect();

0 commit comments

Comments
 (0)