feat: add build information

This commit is contained in:
iff 2024-11-16 15:54:42 +01:00
parent e8e759a719
commit 0177086dcc
3 changed files with 14 additions and 1 deletions

View file

@ -13,6 +13,9 @@ pub fn handle_args() {
"-h" | "--help" => {
print_help();
}
"-v" | "--version" => {
print_version();
}
"-a" | "--alias" => {
if args.len() > index + 1 {
if args[index + 1].starts_with('-') {
@ -57,3 +60,12 @@ fn print_help() {
);
std::process::exit(0);
}
fn print_version() {
println!("version: {}", option_env!("CARGO_PKG_VERSION").unwrap_or("unknown"));
println!("compile features:");
#[cfg(feature = "runtime-rules")] {
println!(" - runtime-rules");
}
std::process::exit(0);
}

View file

@ -90,6 +90,6 @@ fn main() {
eprintln!(
"{}\n{}",
t!("contribute"),
"https://github.com/iffse/pay-respects"
option_env!("CARGO_PKG_REPOSITORY").unwrap_or("https://github.com/iffse/pay-respects/")
);
}