summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2024-01-23 12:19:12 +1100
committerGitHub <noreply@github.com>2024-01-23 02:19:12 +0100
commitf2b0424df66c073f2129868d5d06a4e94930b1cb (patch)
tree8b54e9432c150df6c4234cc8baab637075fc0c49
parent71551c80a1c7ea2cc75cf82c5871212559709789 (diff)
refactor: set removal version for `--jobs` flag (#22028)
For removal in Deno v2. I'm uncertain of the output format but used #21452 as a guide. Towards #22021
-rw-r--r--cli/args/flags.rs6
-rw-r--r--cli/tests/testdata/test/short-pass-jobs-flag-warning.out4
2 files changed, 6 insertions, 4 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs
index 3810d77a3..200e498c0 100644
--- a/cli/args/flags.rs
+++ b/cli/args/flags.rs
@@ -2181,7 +2181,7 @@ Directory arguments are expanded to all contained files matching the glob
Arg::new("jobs")
.short('j')
.long("jobs")
- .help("deprecated: Number of parallel workers, defaults to number of available CPUs when no value is provided. Defaults to 1 when the option is not present.")
+ .help("deprecated: The `--jobs` flag is deprecated and will be removed in Deno 2.0. Use the `--parallel` flag with possibly the `DENO_JOBS` environment variable instead.")
.hide(true)
.num_args(0..=1)
.value_parser(value_parser!(NonZeroUsize)),
@@ -3697,8 +3697,8 @@ fn test_parse(flags: &mut Flags, matches: &mut ArgMatches) {
// deprecated though so it's not worth changing the code to use the log
// crate here and this is only done for testing anyway.
eprintln!(
- "{}",
- crate::colors::yellow("Warning: --jobs flag is deprecated. Use the --parallel flag with possibly the 'DENO_JOBS' environment variable."),
+ "⚠️ {}",
+ crate::colors::yellow("The `--jobs` flag is deprecated and will be removed in Deno 2.0.\nUse the `--parallel` flag with possibly the `DENO_JOBS` environment variable instead.\nLearn more at: https://docs.deno.com/runtime/manual/basics/env_variables"),
);
if let Some(value) = matches.remove_one::<NonZeroUsize>("jobs") {
Some(value)
diff --git a/cli/tests/testdata/test/short-pass-jobs-flag-warning.out b/cli/tests/testdata/test/short-pass-jobs-flag-warning.out
index 8a2f7fe5d..0d9e1fd9b 100644
--- a/cli/tests/testdata/test/short-pass-jobs-flag-warning.out
+++ b/cli/tests/testdata/test/short-pass-jobs-flag-warning.out
@@ -1,4 +1,6 @@
-Warning: --jobs flag is deprecated. Use the --parallel flag with possibly the 'DENO_JOBS' environment variable.
+⚠️ The `--jobs` flag is deprecated and will be removed in Deno 2.0.
+Use the `--parallel` flag with possibly the `DENO_JOBS` environment variable instead.
+Learn more at: https://docs.deno.com/runtime/manual/basics/env_variables
Check [WILDCARD]/test/short-pass.ts
./test/short-pass.ts => test ... ok ([WILDCARD])