diff --git a/docs/cli/run.md b/docs/cli/run.md index be25e4cc4..9acd26035 100644 --- a/docs/cli/run.md +++ b/docs/cli/run.md @@ -73,6 +73,7 @@ Configure with `jobs` config or `MISE_JOBS` env var ### `-r --raw` Read/write directly to stdin/stdout/stderr instead of by line +Redactions are not applied with this option Configure with `raw` config or `MISE_RAW` env var ### `--no-timings` diff --git a/docs/cli/tasks/run.md b/docs/cli/tasks/run.md index 7e71d67cc..7a32e3013 100644 --- a/docs/cli/tasks/run.md +++ b/docs/cli/tasks/run.md @@ -87,6 +87,7 @@ Configure with `jobs` config or `MISE_JOBS` env var ### `-r --raw` Read/write directly to stdin/stdout/stderr instead of by line +Redactions are not applied with this option Configure with `raw` config or `MISE_RAW` env var ### `--no-timings` diff --git a/docs/tasks/running-tasks.md b/docs/tasks/running-tasks.md index f2f56d83a..2a9b8177d 100644 --- a/docs/tasks/running-tasks.md +++ b/docs/tasks/running-tasks.md @@ -18,7 +18,7 @@ label. By printing line-by-line we avoid interleaving output from parallel execu To just print stdout/stderr directly, use `--interleave`, the `task_output` setting, or `MISE_TASK_OUTPUT=interleave`. Stdin is not read by default. To enable this, set `raw = true` on the task that needs it. This will prevent -it running in parallel with any other task-a RWMutex will get a write lock in this case. +it running in parallel with any other task-a RWMutex will get a write lock in this case. This also prevents redactions applied to the output. Extra arguments will be passed to the task, for example, if we want to run in release mode: diff --git a/mise.usage.kdl b/mise.usage.kdl index 8e941ad82..77b8a5567 100644 --- a/mise.usage.kdl +++ b/mise.usage.kdl @@ -602,7 +602,7 @@ cmd run help="Run task(s)" { flag "-j --jobs" help="Number of tasks to run in parallel\n[default: 4]\nConfigure with `jobs` config or `MISE_JOBS` env var" { arg } - flag "-r --raw" help="Read/write directly to stdin/stdout/stderr instead of by line\nConfigure with `raw` config or `MISE_RAW` env var" + flag "-r --raw" help="Read/write directly to stdin/stdout/stderr instead of by line\nRedactions are not applied with this option\nConfigure with `raw` config or `MISE_RAW` env var" flag --timings help="Shows elapsed time after each task completes" hide=#true { long_help "Shows elapsed time after each task completes\n\nDefault to always show with `MISE_TASK_TIMINGS=1`" } @@ -843,7 +843,7 @@ cmd tasks help="Manage tasks" { flag "-j --jobs" help="Number of tasks to run in parallel\n[default: 4]\nConfigure with `jobs` config or `MISE_JOBS` env var" { arg } - flag "-r --raw" help="Read/write directly to stdin/stdout/stderr instead of by line\nConfigure with `raw` config or `MISE_RAW` env var" + flag "-r --raw" help="Read/write directly to stdin/stdout/stderr instead of by line\nRedactions are not applied with this option\nConfigure with `raw` config or `MISE_RAW` env var" flag --timings help="Shows elapsed time after each task completes" hide=#true { long_help "Shows elapsed time after each task completes\n\nDefault to always show with `MISE_TASK_TIMINGS=1`" } diff --git a/src/cli/run.rs b/src/cli/run.rs index bda87e113..d1acd4442 100644 --- a/src/cli/run.rs +++ b/src/cli/run.rs @@ -144,6 +144,7 @@ pub struct Run { pub jobs: Option, /// Read/write directly to stdin/stdout/stderr instead of by line + /// Redactions are not applied with this option /// Configure with `raw` config or `MISE_RAW` env var #[clap(long, short, verbatim_doc_comment)] pub raw: bool, @@ -629,11 +630,19 @@ impl Run { let config = Config::get(); let program = program.to_executable(); let redactions = config.redactions(); + let raw = self.raw(Some(task)); let mut cmd = CmdLineRunner::new(program.clone()) .args(args) .envs(env) .redact(redactions.deref().clone()) - .raw(self.raw(Some(task))); + .raw(raw); + if raw && !redactions.is_empty() { + hint!( + "raw_redactions", + "--raw will prevent mise from being able to use redactions", + "" + ); + } let output = self.output(Some(task)); cmd.with_pass_signals(); match output { @@ -697,7 +706,7 @@ impl Run { cmd = cmd.stdout(Stdio::null()).stderr(Stdio::null()); } TaskOutput::Quiet | TaskOutput::Interleave => { - if redactions.is_empty() { + if raw || redactions.is_empty() { cmd = cmd .stdin(Stdio::inherit()) .stdout(Stdio::inherit()) diff --git a/xtasks/fig/src/mise.ts b/xtasks/fig/src/mise.ts index 9fe62b1dc..eb7b707c0 100644 --- a/xtasks/fig/src/mise.ts +++ b/xtasks/fig/src/mise.ts @@ -1767,7 +1767,7 @@ const completionSpec: Fig.Spec = { { name: ["-r", "--raw"], description: - "Read/write directly to stdin/stdout/stderr instead of by line\nConfigure with `raw` config or `MISE_RAW` env var", + "Read/write directly to stdin/stdout/stderr instead of by line\nRedactions are not applied with this option\nConfigure with `raw` config or `MISE_RAW` env var", isRepeatable: false, }, { @@ -2411,7 +2411,7 @@ const completionSpec: Fig.Spec = { { name: ["-r", "--raw"], description: - "Read/write directly to stdin/stdout/stderr instead of by line\nConfigure with `raw` config or `MISE_RAW` env var", + "Read/write directly to stdin/stdout/stderr instead of by line\nRedactions are not applied with this option\nConfigure with `raw` config or `MISE_RAW` env var", isRepeatable: false, }, {