mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2026-02-02 15:45:11 +01:00
feat: add build information
This commit is contained in:
parent
e8e759a719
commit
0177086dcc
3 changed files with 14 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ edition = "2021"
|
||||||
|
|
||||||
# for crates.io
|
# for crates.io
|
||||||
description = "Terminal command correction, alternative to thefuck written in Rust"
|
description = "Terminal command correction, alternative to thefuck written in Rust"
|
||||||
|
homepage = "https://codeberg.org/iff/pay-respects"
|
||||||
repository = "https://github.com/iffse/pay-respects"
|
repository = "https://github.com/iffse/pay-respects"
|
||||||
keywords = ["cli", "terminal", "utility", "shell"]
|
keywords = ["cli", "terminal", "utility", "shell"]
|
||||||
categories = ["command-line-utilities"]
|
categories = ["command-line-utilities"]
|
||||||
|
|
|
||||||
12
src/args.rs
12
src/args.rs
|
|
@ -13,6 +13,9 @@ pub fn handle_args() {
|
||||||
"-h" | "--help" => {
|
"-h" | "--help" => {
|
||||||
print_help();
|
print_help();
|
||||||
}
|
}
|
||||||
|
"-v" | "--version" => {
|
||||||
|
print_version();
|
||||||
|
}
|
||||||
"-a" | "--alias" => {
|
"-a" | "--alias" => {
|
||||||
if args.len() > index + 1 {
|
if args.len() > index + 1 {
|
||||||
if args[index + 1].starts_with('-') {
|
if args[index + 1].starts_with('-') {
|
||||||
|
|
@ -57,3 +60,12 @@ fn print_help() {
|
||||||
);
|
);
|
||||||
std::process::exit(0);
|
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);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,6 @@ fn main() {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"{}\n{}",
|
"{}\n{}",
|
||||||
t!("contribute"),
|
t!("contribute"),
|
||||||
"https://github.com/iffse/pay-respects"
|
option_env!("CARGO_PKG_REPOSITORY").unwrap_or("https://github.com/iffse/pay-respects/")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue