mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Print git version in clap too
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ async-channel = { version = "2.1.1", optional = true }
|
|||||||
async-io = { version = "1.13.0", optional = true }
|
async-io = { version = "1.13.0", optional = true }
|
||||||
bitflags = "2.4.2"
|
bitflags = "2.4.2"
|
||||||
calloop = { version = "0.12.4", features = ["executor", "futures-io"] }
|
calloop = { version = "0.12.4", features = ["executor", "futures-io"] }
|
||||||
clap = { version = "4.4.18", features = ["derive"] }
|
clap = { version = "4.4.18", features = ["derive", "string"] }
|
||||||
directories = "5.0.1"
|
directories = "5.0.1"
|
||||||
futures-util = { version = "0.3.30", default-features = false, features = ["std", "io"] }
|
futures-util = { version = "0.3.30", default-features = false, features = ["std", "io"] }
|
||||||
git-version = "0.3.9"
|
git-version = "0.3.9"
|
||||||
|
|||||||
+10
-6
@@ -49,7 +49,7 @@ use crate::ipc::client::handle_msg;
|
|||||||
use crate::utils::{cause_panic, REMOVE_ENV_RUST_BACKTRACE, REMOVE_ENV_RUST_LIB_BACKTRACE};
|
use crate::utils::{cause_panic, REMOVE_ENV_RUST_BACKTRACE, REMOVE_ENV_RUST_LIB_BACKTRACE};
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[command(author, version, about, long_about = None)]
|
#[command(author, version = version(), about, long_about = None)]
|
||||||
#[command(args_conflicts_with_subcommands = true)]
|
#[command(args_conflicts_with_subcommands = true)]
|
||||||
#[command(subcommand_value_name = "SUBCOMMAND")]
|
#[command(subcommand_value_name = "SUBCOMMAND")]
|
||||||
#[command(subcommand_help_heading = "Subcommands")]
|
#[command(subcommand_help_heading = "Subcommands")]
|
||||||
@@ -151,11 +151,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info!(
|
info!("starting version {}", &version());
|
||||||
"starting version {} ({})",
|
|
||||||
env!("CARGO_PKG_VERSION"),
|
|
||||||
git_version!(fallback = "unknown commit"),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Load the config.
|
// Load the config.
|
||||||
let path = cli.config.or_else(default_config_path);
|
let path = cli.config.or_else(default_config_path);
|
||||||
@@ -257,6 +253,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn version() -> String {
|
||||||
|
format!(
|
||||||
|
"{} ({})",
|
||||||
|
env!("CARGO_PKG_VERSION"),
|
||||||
|
git_version!(fallback = "unknown commit"),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
fn import_env_to_systemd() {
|
fn import_env_to_systemd() {
|
||||||
let rv = Command::new("/bin/sh")
|
let rv = Command::new("/bin/sh")
|
||||||
.args([
|
.args([
|
||||||
|
|||||||
Reference in New Issue
Block a user