1
0
Fork 0
forked from wry/wry

Merge pull request #508 from mahkoh/jorth/version-arg

cli: add version subcommand
This commit is contained in:
mahkoh 2025-07-17 09:47:17 +02:00 committed by GitHub
commit fb5c50467b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -16,6 +16,7 @@ mod seat_test;
mod set_log_level;
mod tree;
mod unlock;
mod version;
mod xwayland;
use {
@ -93,6 +94,8 @@ pub enum Cmd {
Clients(ClientsArgs),
/// Inspect the surface tree.
Tree(TreeArgs),
/// Prints the Jay version and exits.
Version,
#[cfg(feature = "it")]
RunTests,
}
@ -256,6 +259,7 @@ pub fn main() {
Cmd::ColorManagement(a) => color_management::main(cli.global, a),
Cmd::Clients(a) => clients::main(cli.global, a),
Cmd::Tree(a) => tree::main(cli.global, a),
Cmd::Version => version::main(cli.global),
#[cfg(feature = "it")]
Cmd::RunTests => crate::it::run_tests(),
Cmd::Reexec(a) => reexec::main(cli.global, a),

5
src/cli/version.rs Normal file
View file

@ -0,0 +1,5 @@
use crate::{cli::GlobalArgs, version::VERSION};
pub fn main(_global: GlobalArgs) {
println!("{VERSION}");
}