cli: add version subcommand
This commit is contained in:
parent
5d02ffdfd2
commit
8b30a4dbac
2 changed files with 9 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ mod seat_test;
|
||||||
mod set_log_level;
|
mod set_log_level;
|
||||||
mod tree;
|
mod tree;
|
||||||
mod unlock;
|
mod unlock;
|
||||||
|
mod version;
|
||||||
mod xwayland;
|
mod xwayland;
|
||||||
|
|
||||||
use {
|
use {
|
||||||
|
|
@ -93,6 +94,8 @@ pub enum Cmd {
|
||||||
Clients(ClientsArgs),
|
Clients(ClientsArgs),
|
||||||
/// Inspect the surface tree.
|
/// Inspect the surface tree.
|
||||||
Tree(TreeArgs),
|
Tree(TreeArgs),
|
||||||
|
/// Prints the Jay version and exits.
|
||||||
|
Version,
|
||||||
#[cfg(feature = "it")]
|
#[cfg(feature = "it")]
|
||||||
RunTests,
|
RunTests,
|
||||||
}
|
}
|
||||||
|
|
@ -256,6 +259,7 @@ pub fn main() {
|
||||||
Cmd::ColorManagement(a) => color_management::main(cli.global, a),
|
Cmd::ColorManagement(a) => color_management::main(cli.global, a),
|
||||||
Cmd::Clients(a) => clients::main(cli.global, a),
|
Cmd::Clients(a) => clients::main(cli.global, a),
|
||||||
Cmd::Tree(a) => tree::main(cli.global, a),
|
Cmd::Tree(a) => tree::main(cli.global, a),
|
||||||
|
Cmd::Version => version::main(cli.global),
|
||||||
#[cfg(feature = "it")]
|
#[cfg(feature = "it")]
|
||||||
Cmd::RunTests => crate::it::run_tests(),
|
Cmd::RunTests => crate::it::run_tests(),
|
||||||
Cmd::Reexec(a) => reexec::main(cli.global, a),
|
Cmd::Reexec(a) => reexec::main(cli.global, a),
|
||||||
|
|
|
||||||
5
src/cli/version.rs
Normal file
5
src/cli/version.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
use crate::{cli::GlobalArgs, version::VERSION};
|
||||||
|
|
||||||
|
pub fn main(_global: GlobalArgs) {
|
||||||
|
println!("{VERSION}");
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue