add proper version string
This commit is contained in:
+2
-1
@@ -4,11 +4,12 @@ use clap::{Arg, ArgMatches, Command};
|
||||
use path_absolutize::Absolutize;
|
||||
|
||||
use crate::action::*;
|
||||
use crate::core::get_version_string;
|
||||
|
||||
fn get_arg_parser() -> Command {
|
||||
Command::new("pacdef")
|
||||
.about("declarative package manager for Arch Linux")
|
||||
.version("1.0.0-alpha")
|
||||
.version(get_version_string())
|
||||
.subcommand_required(true)
|
||||
.arg_required_else_help(true)
|
||||
.subcommand(Command::new(CLEAN).about("remove unmanaged packages"))
|
||||
|
||||
+11
-1
@@ -136,7 +136,7 @@ impl Pacdef {
|
||||
}
|
||||
|
||||
fn show_version(self) {
|
||||
println!("pacdef, version: {}", env!("CARGO_PKG_VERSION"));
|
||||
println!("{}", get_version_string());
|
||||
}
|
||||
|
||||
fn show_unmanaged_packages(mut self) {
|
||||
@@ -289,3 +289,13 @@ fn show_error(error: anyhow::Error, backend: Box<dyn Backend>) {
|
||||
None => println!("WARNING: skipping backend '{section}': {error}"),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) const fn get_version_string() -> &'static str {
|
||||
concat!(
|
||||
"pacdef, version: ",
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
" (",
|
||||
env!("GIT_HASH"),
|
||||
")",
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user