Skip to content

Commit 36811f2

Browse files
Adopt clap's crate_name macro
1 parent 244c10f commit 36811f2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/cli.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use super::static_urls::*;
1818
use super::tanzu_cli::tanzu_subcommands;
1919
use crate::config::PreFlightSettings;
2020
use crate::output::TableStyle;
21-
use clap::{Arg, ArgAction, ArgGroup, Command, crate_version, value_parser};
21+
use clap::{Arg, ArgAction, ArgGroup, Command, crate_name, crate_version, value_parser};
2222
use rabbitmq_http_client::commons::{
2323
BindingDestinationType, ChannelUseMode, ExchangeType, MessageTransferAcknowledgementMode,
2424
PolicyTarget, QueueType, SupportedProtocol,
@@ -413,10 +413,10 @@ pub fn parser(pre_flight_settings: PreFlightSettings) -> Command {
413413
vhost_limits_group,
414414
];
415415

416-
Command::new("rabbitmqadmin")
416+
Command::new(crate_name!())
417417
.version(crate_version!())
418418
.author("The RabbitMQ Core Team")
419-
.about(format!("rabbitmqadmin gen 2, version: {}", crate_version!()))
419+
.about(format!("{} gen 2, version: {}", crate_name!(), crate_version!()))
420420
.long_about(format!(
421421
"RabbitMQ CLI that uses the HTTP API. Version: {}",
422422
crate_version!()

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#![allow(clippy::unnecessary_unwrap)]
1616
#![allow(clippy::collapsible_if)]
1717

18-
use clap::{ArgMatches, crate_version};
18+
use clap::{ArgMatches, crate_name, crate_version};
1919
use errors::CommandRunError;
2020
use reqwest::{Identity, tls::Version as TlsVersion};
2121
use std::path::{Path, PathBuf};
@@ -185,7 +185,7 @@ fn build_http_client(
185185
cli: &ArgMatches,
186186
common_settings: &SharedSettings,
187187
) -> Result<HTTPClient, CommandRunError> {
188-
let user_agent = format!("rabbitmqadmin-ng {}", crate_version!());
188+
let user_agent = format!("{} {}", crate_name!(), crate_version!());
189189
if should_use_tls(common_settings) {
190190
let _ = CryptoProvider::install_default(rustls::crypto::aws_lc_rs::default_provider());
191191

0 commit comments

Comments
 (0)