diff --git a/src/cli.rs b/src/cli.rs index 77c09dda..09050b4a 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -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), diff --git a/src/cli/version.rs b/src/cli/version.rs new file mode 100644 index 00000000..068caaf2 --- /dev/null +++ b/src/cli/version.rs @@ -0,0 +1,5 @@ +use crate::{cli::GlobalArgs, version::VERSION}; + +pub fn main(_global: GlobalArgs) { + println!("{VERSION}"); +}