mirror of https://github.com/rust-lang/cargo
refactor: Resolve clap deprecations
This commit is contained in:
parent
96948f7a24
commit
69ba69f908
|
@ -3,7 +3,6 @@ use cargo::ops::{self, TestOptions};
|
|||
|
||||
pub fn cli() -> Command {
|
||||
subcommand("bench")
|
||||
.trailing_var_arg(true)
|
||||
.about("Execute all benchmarks of a local package")
|
||||
.arg_quiet()
|
||||
.arg(
|
||||
|
@ -14,7 +13,8 @@ pub fn cli() -> Command {
|
|||
.arg(
|
||||
Arg::new("args")
|
||||
.help("Arguments for the bench binary")
|
||||
.num_args(0..),
|
||||
.num_args(0..)
|
||||
.trailing_var_arg(true),
|
||||
)
|
||||
.arg_targets_all(
|
||||
"Benchmark only this package's library",
|
||||
|
|
|
@ -8,13 +8,13 @@ pub fn cli() -> Command {
|
|||
subcommand("run")
|
||||
// subcommand aliases are handled in aliased_command()
|
||||
// .alias("r")
|
||||
.trailing_var_arg(true)
|
||||
.about("Run a binary or example of the local package")
|
||||
.arg_quiet()
|
||||
.arg(
|
||||
Arg::new("args")
|
||||
.value_parser(value_parser!(std::ffi::OsString))
|
||||
.num_args(0..),
|
||||
.num_args(0..)
|
||||
.trailing_var_arg(true),
|
||||
)
|
||||
.arg_targets_bin_example(
|
||||
"Name of the bin target to run",
|
||||
|
|
|
@ -7,10 +7,14 @@ const CRATE_TYPE_ARG_NAME: &str = "crate-type";
|
|||
|
||||
pub fn cli() -> Command {
|
||||
subcommand("rustc")
|
||||
.trailing_var_arg(true)
|
||||
.about("Compile a package, and pass extra options to the compiler")
|
||||
.arg_quiet()
|
||||
.arg(Arg::new("args").num_args(0..).help("Rustc flags"))
|
||||
.arg(
|
||||
Arg::new("args")
|
||||
.num_args(0..)
|
||||
.help("Rustc flags")
|
||||
.trailing_var_arg(true),
|
||||
)
|
||||
.arg_package("Package to build")
|
||||
.arg_jobs()
|
||||
.arg_targets_all(
|
||||
|
|
|
@ -4,10 +4,9 @@ use crate::command_prelude::*;
|
|||
|
||||
pub fn cli() -> Command {
|
||||
subcommand("rustdoc")
|
||||
.trailing_var_arg(true)
|
||||
.about("Build a package's documentation, using specified custom flags.")
|
||||
.arg_quiet()
|
||||
.arg(Arg::new("args").num_args(0..))
|
||||
.arg(Arg::new("args").num_args(0..).trailing_var_arg(true))
|
||||
.arg(flag(
|
||||
"open",
|
||||
"Opens the docs in a browser after the operation",
|
||||
|
|
|
@ -5,7 +5,6 @@ pub fn cli() -> Command {
|
|||
subcommand("test")
|
||||
// Subcommand aliases are handled in `aliased_command()`.
|
||||
// .alias("t")
|
||||
.trailing_var_arg(true)
|
||||
.about("Execute all unit and integration tests and build examples of a local package")
|
||||
.arg(
|
||||
Arg::new("TESTNAME")
|
||||
|
@ -15,7 +14,8 @@ pub fn cli() -> Command {
|
|||
.arg(
|
||||
Arg::new("args")
|
||||
.help("Arguments for the test binary")
|
||||
.num_args(0..),
|
||||
.num_args(0..)
|
||||
.trailing_var_arg(true),
|
||||
)
|
||||
.arg(
|
||||
flag(
|
||||
|
|
Loading…
Reference in New Issue