Skip to content

fix: apply --silent flag to global settings to suppress output#8720

Merged
jdx merged 3 commits intojdx:mainfrom
nkakouros:nkakouros/fix/silent
Mar 23, 2026
Merged

fix: apply --silent flag to global settings to suppress output#8720
jdx merged 3 commits intojdx:mainfrom
nkakouros:nkakouros/fix/silent

Conversation

@nkakouros
Copy link
Copy Markdown
Contributor

The global --silent CLI flag was never written to Settings, meaning mise --silent run foo would suppress task stdout/stderr but still show mise's own info/warn messages. This made --silent strictly weaker than --quiet for non-task output, opposite to what the help text promises.

Now --silent also sets quiet=true in Settings (raising log level to "error"), making it a proper superset of --quiet: it suppresses both mise messages AND task output.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an inconsistency in the behavior of the global --silent CLI flag. Previously, it only suppressed task output but not mise's internal messages, making it less effective than intended. The changes ensure that --silent now correctly silences all output from mise and tasks, aligning its functionality with the help text and making it a comprehensive suppression option.

Highlights

  • Fixing --silent CLI flag behavior: The --silent global CLI flag now correctly suppresses both mise's own info/warn messages and task output, making it a proper superset of --quiet as intended.
  • Updated settings application logic: Modified the Settings struct to ensure that when --silent is used, it explicitly sets the quiet setting to true, thereby raising the log level to 'error' and suppressing mise's internal output.
  • Added end-to-end tests: A new end-to-end test file was introduced to verify the correct behavior of --quiet, --silent, -q, and run -S flags for task output suppression.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly implements the logic to make the global --silent flag also imply --quiet, suppressing mise's own output in addition to task output. The change in src/config/settings.rs is clear and correct.

However, the new end-to-end test in e2e/tasks/test_task_quiet_silent_flags is not functional as written because the assertion helpers are used incorrectly. I've provided a review comment with a suggestion to fix the test and also strengthen it to more robustly verify the intended behavior.

Comment thread e2e/tasks/test_task_quiet_silent_flags Outdated
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 23, 2026

Greptile Summary

This PR fixes a bug where the global --silent CLI flag had no effect on Settings, making it weaker than --quiet for suppressing mise's own output. The fix is two targeted lines in apply_cli_settings: --silent now sets both quiet=true (raising the log level to "error", suppressing info/warn messages) and silent=true (propagated to silent_bool() to suppress task stdout/stderr).

Key changes:

  • src/config/settings.rs: --silent now writes both quiet and silent into Settings, matching the documented superset behaviour.
  • e2e/tasks/test_task_quiet_silent_flags: New test covering --quiet, --silent, -q, and run -S; uses the project's standard assert/assert_empty inline-command pattern (the earlier fragile echo '$output' indirection flagged in review has been removed).

Context on correctness: For mise --silent run hello (with explicit run subcommand), the run subcommand's own silent field is not populated from the global flag — only Settings::get().silent is consulted by silent_bool(). Before this fix Settings::get().silent was always false here, so task output was not suppressed. The fix is the correct and necessary path.

Confidence Score: 5/5

  • Safe to merge — minimal, targeted fix with correct logic and new e2e coverage.
  • The change is two lines of idiomatic Rust in a well-understood settings-propagation function, the new test covers the four relevant flag combinations, and prior review concerns about test fragility have been fully addressed. No regressions are plausible given the additive nature of the change.
  • No files require special attention.

Important Files Changed

Filename Overview
src/config/settings.rs Adds the missing propagation of the global --silent CLI flag into Settings: sets quiet=true (to raise log level to "error" and suppress mise info messages) and silent=true (to suppress task stdout/stderr via silent_bool()). The fix is minimal and correct.
e2e/tasks/test_task_quiet_silent_flags New e2e test covering --quiet, --silent, -q, and run -S flag combinations. Uses assert (exact equality) for --quiet and assert_empty for --silent, following the project's established patterns. Prior fragile echo '$output' indirection has been removed.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["mise --silent run foo"] --> B["apply_cli_settings(cli)"]
    B --> C{"cli.quiet || cli.silent?"}
    C -- "yes (new: silent now matches)" --> D["s.quiet = Some(true)"]
    D --> E["Settings: log_level = 'error'\n(suppress mise info/warn messages)"]
    B --> F{"cli.silent?"}
    F -- "yes (new)" --> G["s.silent = Some(true)"]
    G --> H["Settings::get().silent = true"]
    H --> I["silent_bool() = true"]
    I --> J["TaskOutput::Silent\n(suppress task stdout/stderr)"]
    E --> K["✅ No mise messages"]
    J --> L["✅ No task output"]

    style D fill:#c8f7c5
    style G fill:#c8f7c5
    style K fill:#c8f7c5
    style L fill:#c8f7c5
Loading

Reviews (3): Last reviewed commit: "[autofix.ci] apply automated fixes" | Re-trigger Greptile

The global --silent CLI flag was never written to Settings, meaning
`mise --silent run foo` would suppress task stdout/stderr but still
show mise's own info/warn messages. This made --silent strictly weaker
than --quiet for non-task output, opposite to what the help text promises.

Now --silent also sets quiet=true in Settings (raising log level to
"error"), making it a proper superset of --quiet: it suppresses both
mise messages AND task output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread e2e/tasks/test_task_quiet_silent_flags Outdated
Comment thread e2e/tasks/test_task_quiet_silent_flags Outdated
@nkakouros nkakouros force-pushed the nkakouros/fix/silent branch from fc492d1 to db22492 Compare March 23, 2026 01:45
@jdx jdx merged commit 45e3578 into jdx:main Mar 23, 2026
34 checks passed
mise-en-dev added a commit that referenced this pull request Mar 23, 2026
### 🐛 Bug Fixes

- **(env)** improve hook-env watch_files tracking and early-exits by
@rpendleton in [#8716](#8716)
- **(install)** create runtime symlinks in system/shared install
directories by @jdx in [#8722](#8722)
- apply --silent flag to global settings to suppress output by
@nkakouros in [#8720](#8720)

### 📦️ Dependency Updates

- ignore RUSTSEC-2026-0066 astral-tokio-tar advisory by @jdx in
[#8723](#8723)

### 📦 Registry

- add acli by @ggoggam in [#8721](#8721)

### New Contributors

- @rpendleton made their first contribution in
[#8716](#8716)
- @ggoggam made their first contribution in
[#8721](#8721)

## 📦 Aqua Registry Updates

#### Updated Packages (1)

- [`astral-sh/ty`](https://github.com/astral-sh/ty)
@nkakouros nkakouros deleted the nkakouros/fix/silent branch March 23, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants