diff --git a/Cargo.toml b/Cargo.toml index 91520e4..4fdf24d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "bmputil" +description = "Black Magic Probe Firmware Manager" version = "0.1.0" edition = "2021" @@ -15,7 +16,7 @@ default = ["detect-backtrace", "vendored"] [dependencies] anstyle = "1.0.2" -clap = { version = "4.0", default-features = false, features = ["std", "color", "help", "usage", "unicode", "wrap_help", "unstable-styles"] } +clap = { version = "4.0", default-features = false, features = ["std", "color", "help", "usage", "unicode", "wrap_help", "unstable-styles", "cargo"] } env_logger = "0.10" dfu-core = { version = "0.6.0", features = ["std"] } dfu-libusb = "0.5.1" diff --git a/src/main.rs b/src/main.rs index 511ff97..f5da435 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,9 +13,8 @@ use std::str::FromStr; use std::time::Duration; use anstyle; -use clap::ArgAction; +use clap::{ArgAction, Command, Arg, ArgMatches, crate_version, crate_description, crate_name}; use clap::builder::styling::Styles; -use clap::{Command, Arg, ArgMatches}; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; use indicatif::{ProgressBar, ProgressStyle}; use log::{debug, warn, error}; @@ -293,7 +292,7 @@ fn main() .parse_default_env() .init(); - let mut parser = Command::new("Black Magic Probe Firmware Manager"); + let mut parser = Command::new(crate_name!()); if cfg!(windows) { parser = parser .arg(Arg::new("windows-wdi-install-mode") @@ -306,6 +305,8 @@ fn main() ); } parser = parser + .about(crate_description!()) + .version(crate_version!()) .styles(style()) .disable_colored_help(false) .arg_required_else_help(true)