add a way to print version

This commit is contained in:
OldWorldOrdr 2023-04-01 23:46:08 -04:00
parent 145eb3dde3
commit 5a5e086bb7

View File

@ -202,6 +202,12 @@ fn get_info(
}
fn main() {
// parse arguements
if std::env::args().any(|arg| arg.starts_with("-v") || arg.starts_with("--v")) {
println!("pfetch-rs {}", env!("CARGO_PKG_VERSION"));
std::process::exit(0);
}
// source file specified by env: PF_SOURCE
if let Ok(filepath) = dotenvy::var("PF_SOURCE") {
dotenvy::from_path(filepath).unwrap();