build: drop the need to import macros from Clap

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu 2023-01-06 16:45:47 +00:00 committed by Bo Chen
parent 998fb48ff2
commit 0389190c64
7 changed files with 9 additions and 21 deletions

View File

@ -6,7 +6,7 @@ edition = "2021"
build = "build.rs" build = "build.rs"
[dependencies] [dependencies]
clap = { version = "4.0.29", features = ["wrap_help","cargo"] } clap = { version = "4.0.29", features = ["wrap_help"] }
dirs = "4.0.0" dirs = "4.0.0"
serde = { version = "1.0.151", features = ["rc", "derive"] } serde = { version = "1.0.151", features = ["rc", "derive"] }
serde_json = "1.0.89" serde_json = "1.0.89"

View File

@ -5,8 +5,6 @@
// Custom harness to run performance tests // Custom harness to run performance tests
extern crate test_infra; extern crate test_infra;
#[macro_use(crate_authors)]
extern crate clap;
mod performance_tests; mod performance_tests;
@ -631,7 +629,7 @@ fn date() -> String {
fn main() { fn main() {
let cmd_arguments = ClapCommand::new("performance-metrics") let cmd_arguments = ClapCommand::new("performance-metrics")
.version(env!("GIT_HUMAN_READABLE")) .version(env!("GIT_HUMAN_READABLE"))
.author(crate_authors!()) .author(env!("CARGO_PKG_AUTHORS"))
.about("Generate the performance metrics data for Cloud Hypervisor") .about("Generate the performance metrics data for Cloud Hypervisor")
.arg( .arg(
Arg::new("test-filter") Arg::new("test-filter")

View File

@ -3,9 +3,6 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// //
#[macro_use(crate_authors)]
extern crate clap;
use api_client::simple_api_command; use api_client::simple_api_command;
use api_client::simple_api_command_with_fds; use api_client::simple_api_command_with_fds;
use api_client::simple_api_full_command; use api_client::simple_api_full_command;
@ -506,7 +503,7 @@ fn do_command(matches: &ArgMatches) -> Result<(), Error> {
fn main() { fn main() {
let app = Command::new("ch-remote") let app = Command::new("ch-remote")
.author(crate_authors!()) .author(env!("CARGO_PKG_AUTHORS"))
.subcommand_required(true) .subcommand_required(true)
.about("Remotely control a cloud-hypervisor VMM.") .about("Remotely control a cloud-hypervisor VMM.")
.arg( .arg(

View File

@ -3,8 +3,6 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// //
#[macro_use(crate_authors)]
extern crate clap;
#[macro_use] #[macro_use]
extern crate event_monitor; extern crate event_monitor;
@ -130,7 +128,7 @@ fn create_app(default_vcpus: String, default_memory: String, default_rng: String
// 'BUILT_VERSION' is set by the build script 'build.rs' at // 'BUILT_VERSION' is set by the build script 'build.rs' at
// compile time // compile time
.version(env!("BUILT_VERSION")) .version(env!("BUILT_VERSION"))
.author(crate_authors!()) .author(env!("CARGO_PKG_AUTHORS"))
.about("Launch a cloud-hypervisor VMM.") .about("Launch a cloud-hypervisor VMM.")
.group(ArgGroup::new("vm-config").multiple(true)) .group(ArgGroup::new("vm-config").multiple(true))
.group(ArgGroup::new("vmm-config").multiple(true)) .group(ArgGroup::new("vmm-config").multiple(true))

View File

@ -6,7 +6,7 @@ edition = "2021"
[dependencies] [dependencies]
block_util = { path = "../block_util" } block_util = { path = "../block_util" }
clap = { version = "4.0.29", features = ["wrap_help","cargo"] } clap = { version = "4.0.29", features = ["wrap_help"] }
env_logger = "0.10.0" env_logger = "0.10.0"
epoll = "4.3.1" epoll = "4.3.1"
libc = "0.2.139" libc = "0.2.139"

View File

@ -8,8 +8,6 @@
// //
// SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause) // SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause)
#[macro_use(crate_version, crate_authors)]
extern crate clap;
extern crate vhost_user_block; extern crate vhost_user_block;
use clap::{Arg, Command}; use clap::{Arg, Command};
@ -19,8 +17,8 @@ fn main() {
env_logger::init(); env_logger::init();
let cmd_arguments = Command::new("vhost-user-blk backend") let cmd_arguments = Command::new("vhost-user-blk backend")
.version(crate_version!()) .version(env!("CARGO_PKG_VERSION"))
.author(crate_authors!()) .author(env!("CARGO_PKG_AUTHORS"))
.about("Launch a vhost-user-blk backend.") .about("Launch a vhost-user-blk backend.")
.arg( .arg(
Arg::new("block-backend") Arg::new("block-backend")

View File

@ -6,9 +6,6 @@
// //
// SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause) // SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause)
#[macro_use(crate_version, crate_authors)]
extern crate clap;
use clap::{Arg, Command}; use clap::{Arg, Command};
use vhost_user_net::start_net_backend; use vhost_user_net::start_net_backend;
@ -16,8 +13,8 @@ fn main() {
env_logger::init(); env_logger::init();
let cmd_arguments = Command::new("vhost-user-net backend") let cmd_arguments = Command::new("vhost-user-net backend")
.version(crate_version!()) .version(env!("CARGO_PKG_VERSION"))
.author(crate_authors!()) .author(env!("CARGO_PKG_AUTHORS"))
.about("Launch a vhost-user-net backend.") .about("Launch a vhost-user-net backend.")
.arg( .arg(
Arg::new("net-backend") Arg::new("net-backend")