refactor(arg): rename arg_jobs to arg_parallel

This commit is contained in:
Weihang Lo 2023-08-18 10:50:40 +01:00
parent 5155d3f7dc
commit ba209d6abd
No known key found for this signature in database
GPG Key ID: D7DBF189825E82E7
13 changed files with 15 additions and 15 deletions

View File

@ -42,7 +42,7 @@ pub fn cli() -> Command {
"Benchmark all targets", "Benchmark all targets",
) )
.arg_features() .arg_features()
.arg_jobs_without_keep_going() .arg_jobs()
.arg(flag("keep-going", "Use `--no-fail-fast` instead").hide(true)) // See rust-lang/cargo#11702 .arg(flag("keep-going", "Use `--no-fail-fast` instead").hide(true)) // See rust-lang/cargo#11702
.arg_profile("Build artifacts with the specified profile") .arg_profile("Build artifacts with the specified profile")
.arg_target_triple("Build for the target triple") .arg_target_triple("Build for the target triple")

View File

@ -31,7 +31,7 @@ pub fn cli() -> Command {
.arg_features() .arg_features()
.arg_release("Build artifacts in release mode, with optimizations") .arg_release("Build artifacts in release mode, with optimizations")
.arg_profile("Build artifacts with the specified profile") .arg_profile("Build artifacts with the specified profile")
.arg_jobs() .arg_parallel()
.arg_target_triple("Build for the target triple") .arg_target_triple("Build for the target triple")
.arg_target_dir() .arg_target_dir()
.arg( .arg(

View File

@ -29,7 +29,7 @@ pub fn cli() -> Command {
"Check all targets", "Check all targets",
) )
.arg_features() .arg_features()
.arg_jobs() .arg_parallel()
.arg_release("Check artifacts in release mode, with optimizations") .arg_release("Check artifacts in release mode, with optimizations")
.arg_profile("Check artifacts with the specified profile") .arg_profile("Check artifacts with the specified profile")
.arg_target_triple("Check for the target triple") .arg_target_triple("Check for the target triple")

View File

@ -32,7 +32,7 @@ pub fn cli() -> Command {
"Document only the specified example", "Document only the specified example",
"Document all examples", "Document all examples",
) )
.arg_jobs() .arg_parallel()
.arg_release("Build artifacts in release mode, with optimizations") .arg_release("Build artifacts in release mode, with optimizations")
.arg_profile("Build artifacts with the specified profile") .arg_profile("Build artifacts with the specified profile")
.arg_target_triple("Build for the target triple") .arg_target_triple("Build for the target triple")

View File

@ -47,7 +47,7 @@ pub fn cli() -> Command {
"Fix all targets (default)", "Fix all targets (default)",
) )
.arg_features() .arg_features()
.arg_jobs() .arg_parallel()
.arg_release("Fix artifacts in release mode, with optimizations") .arg_release("Fix artifacts in release mode, with optimizations")
.arg_profile("Build artifacts with the specified profile") .arg_profile("Build artifacts with the specified profile")
.arg_target_triple("Fix for the target triple") .arg_target_triple("Fix for the target triple")

View File

@ -75,7 +75,7 @@ pub fn cli() -> Command {
"Install all examples", "Install all examples",
) )
.arg_features() .arg_features()
.arg_jobs() .arg_parallel()
.arg(flag( .arg(flag(
"debug", "debug",
"Build in debug mode (with the 'dev' profile) instead of release mode", "Build in debug mode (with the 'dev' profile) instead of release mode",

View File

@ -33,7 +33,7 @@ pub fn cli() -> Command {
.arg_features() .arg_features()
.arg_target_triple("Build for the target triple") .arg_target_triple("Build for the target triple")
.arg_target_dir() .arg_target_dir()
.arg_jobs() .arg_parallel()
.arg_manifest_path() .arg_manifest_path()
.after_help("Run `cargo help package` for more detailed information.\n") .after_help("Run `cargo help package` for more detailed information.\n")
} }

View File

@ -20,7 +20,7 @@ pub fn cli() -> Command {
.arg_quiet() .arg_quiet()
.arg_package("Package to publish") .arg_package("Package to publish")
.arg_features() .arg_features()
.arg_jobs() .arg_parallel()
.arg_target_triple("Build for the target triple") .arg_target_triple("Build for the target triple")
.arg_target_dir() .arg_target_dir()
.arg_manifest_path() .arg_manifest_path()

View File

@ -30,7 +30,7 @@ pub fn cli() -> Command {
"Name of the example target to run", "Name of the example target to run",
) )
.arg_features() .arg_features()
.arg_jobs() .arg_parallel()
.arg_release("Build artifacts in release mode, with optimizations") .arg_release("Build artifacts in release mode, with optimizations")
.arg_profile("Build artifacts with the specified profile") .arg_profile("Build artifacts with the specified profile")
.arg_target_triple("Build for the target triple") .arg_target_triple("Build for the target triple")

View File

@ -44,7 +44,7 @@ pub fn cli() -> Command {
"Build all targets", "Build all targets",
) )
.arg_features() .arg_features()
.arg_jobs() .arg_parallel()
.arg_release("Build artifacts in release mode, with optimizations") .arg_release("Build artifacts in release mode, with optimizations")
.arg_profile("Build artifacts with the specified profile") .arg_profile("Build artifacts with the specified profile")
.arg_target_triple("Target triple which compiles will be for") .arg_target_triple("Target triple which compiles will be for")

View File

@ -32,7 +32,7 @@ pub fn cli() -> Command {
"Build all targets", "Build all targets",
) )
.arg_features() .arg_features()
.arg_jobs() .arg_parallel()
.arg_release("Build artifacts in release mode, with optimizations") .arg_release("Build artifacts in release mode, with optimizations")
.arg_profile("Build artifacts with the specified profile") .arg_profile("Build artifacts with the specified profile")
.arg_target_triple("Build for the target triple") .arg_target_triple("Build for the target triple")

View File

@ -48,7 +48,7 @@ pub fn cli() -> Command {
"Test all targets (does not include doctests)", "Test all targets (does not include doctests)",
) )
.arg_features() .arg_features()
.arg_jobs_without_keep_going() .arg_jobs()
.arg(flag("keep-going", "Use `--no-fail-fast` instead").hide(true)) // See rust-lang/cargo#11702 .arg(flag("keep-going", "Use `--no-fail-fast` instead").hide(true)) // See rust-lang/cargo#11702
.arg_release("Build artifacts in release mode, with optimizations") .arg_release("Build artifacts in release mode, with optimizations")
.arg_profile("Build artifacts with the specified profile") .arg_profile("Build artifacts with the specified profile")

View File

@ -82,8 +82,8 @@ pub trait CommandExt: Sized {
) )
} }
fn arg_jobs(self) -> Self { fn arg_parallel(self) -> Self {
self.arg_jobs_without_keep_going()._arg( self.arg_jobs()._arg(
flag( flag(
"keep-going", "keep-going",
"Do not abort the build as soon as there is an error (unstable)", "Do not abort the build as soon as there is an error (unstable)",
@ -92,7 +92,7 @@ pub trait CommandExt: Sized {
) )
} }
fn arg_jobs_without_keep_going(self) -> Self { fn arg_jobs(self) -> Self {
self._arg( self._arg(
opt("jobs", "Number of parallel jobs, defaults to # of CPUs.") opt("jobs", "Number of parallel jobs, defaults to # of CPUs.")
.short('j') .short('j')