Skip to content

Commit

Permalink
chore: tidy cli deps and about
Browse files Browse the repository at this point in the history
Signed-off-by: tison <wander4096@gmail.com>
  • Loading branch information
tisonkun committed Aug 16, 2024
1 parent 1823bc8 commit c4d7067
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rust-version = "1.76.0"
[workspace.dependencies]
anyhow = "1.0"
build-data = "0.2"
clap = { version = "4.5", features = ["derive", "string", "cargo"] }
clap = { version = "4.5", features = ["derive"] }
const_format = { version = "0.2" }
hawkeye-fmt = { version = "5.8.0", path = "fmt" }
log = { version = "0.4", features = ["kv_unstable_serde", "serde"] }
Expand Down
7 changes: 4 additions & 3 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// Copyright 2024 - 2024, tison <wander4096@gmail.com> and the HawkEye contributors
// SPDX-License-Identifier: Apache-2.0

use clap::crate_description;
use clap::FromArgMatches;
use clap::Subcommand;
use env_logger::Env;
Expand All @@ -28,10 +27,12 @@ pub mod version;
fn main() {
env_logger::init_from_env(Env::new().default_filter_or("info"));

let build_info = version::build_info();
let command = clap::Command::new("hawkeye")
.subcommand_required(true)
.version(version::version())
.about(crate_description!());
.about(build_info.description)
.version(build_info.version)
.long_version(version::version());
let command = SubCommand::augment_subcommands(command);
let args = command.get_matches();
match SubCommand::from_arg_matches(&args) {
Expand Down
2 changes: 2 additions & 0 deletions cli/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub struct BuildInfo {
pub commit: &'static str,
pub commit_short: &'static str,
pub clean: bool,
pub description: &'static str,
pub source_time: &'static str,
pub build_time: &'static str,
pub rustc: &'static str,
Expand All @@ -38,6 +39,7 @@ pub const fn build_info() -> BuildInfo {
commit: build::COMMIT_HASH,
commit_short: build::SHORT_COMMIT,
clean: build::GIT_CLEAN,
description: build::PKG_DESCRIPTION,
source_time: env!("SOURCE_TIMESTAMP"),
build_time: env!("BUILD_TIMESTAMP"),
rustc: build::RUST_VERSION,
Expand Down

0 comments on commit c4d7067

Please sign in to comment.