Skip to content

Commit

Permalink
misc: Add missing crate metadata and enable it for help and version
Browse files Browse the repository at this point in the history
  • Loading branch information
amyspark authored and esden committed Aug 25, 2023
1 parent 5b0c955 commit e5fc6b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "bmputil"
description = "Black Magic Probe Firmware Manager"
version = "0.1.0"
edition = "2021"

Expand All @@ -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"
Expand Down
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit e5fc6b8

Please sign in to comment.