Skip to content

Commit 6e61730

Browse files
denelonCopilot
andcommitted
Add CLI arguments for UserMessages settings overrides
- Add --ignore-user-messages, --ignore-pre-action-messages, and --ignore-post-action-messages CLI arguments to the spec - Define precedence: CLI arguments override settings - Clarify distinction from --disable-interactivity (suppresses prompt only vs. suppresses message entirely) - Update Copilot instructions: when adding settings, always consider corresponding CLI arguments (and vice versa) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 114d763 commit 6e61730

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

.github/instructions/specs.instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ A complete specification should address all areas the feature touches. For WinGe
7474
- **COM API**`Microsoft.Management.Deployment` interfaces and WinRT projections
7575
- **PowerShell cmdlets**`Install-WinGetPackage`, `Update-WinGetPackage`, `Uninstall-WinGetPackage`, `Repair-WinGetPackage`, `Find-WinGetPackage`, `Show-WinGetPackage`
7676
- **Settings** — User settings in `settings.json` (see `doc/Settings.md`)
77+
- **CLI arguments** — When adding a new setting, also consider a corresponding CLI argument (and vice versa). Settings define defaults; arguments provide per-invocation overrides.
7778
- **Manifest schema** — JSON schema files in `schemas/JSON/manifests/`
7879
- **Validation** — The winget-pkgs community repository validation pipeline
7980
- **WinGet Configuration / DSC** — Declarative configuration flows

doc/specs/#3483 - UserMessages.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,27 @@ The following table shows what is displayed on **clients that support `UserMessa
201201

202202
On **older clients** that do not support `UserMessages`, only `InstallationNotes` is relevant and `disableInstallNotes` controls it as it does today.
203203

204+
### CLI Arguments
205+
206+
Corresponding CLI arguments are provided so users can override the settings on a per-invocation basis.
207+
208+
| Argument | Applies to | Description |
209+
|----------|-----------|-------------|
210+
| `--ignore-user-messages` | `install`, `upgrade`, `uninstall`, `repair`, `import` | Suppresses all `UserMessages` (both pre- and post-action) for this invocation. Pre-action prompts are skipped and the operation proceeds. |
211+
| `--ignore-pre-action-messages` | `install`, `upgrade`, `uninstall`, `repair`, `import` | Suppresses pre-action messages and their prompts for this invocation. Post-action messages are still shown. |
212+
| `--ignore-post-action-messages` | `install`, `upgrade`, `uninstall`, `repair`, `import` | Suppresses post-action messages for this invocation. Pre-action messages and prompts are still shown. |
213+
214+
**Precedence:** CLI arguments override settings. If a user has `userMessages.disablePreActionMessages` set to `false` in settings but passes `--ignore-pre-action-messages`, the pre-action messages are suppressed for that invocation.
215+
216+
**Relationship to `--disable-interactivity`:** The `--disable-interactivity` flag suppresses the **prompt** on pre-action messages but still displays the message text. The `--ignore-pre-action-messages` flag suppresses both the message and the prompt entirely.
217+
218+
Example usage:
219+
220+
```
221+
winget upgrade --all --ignore-pre-action-messages
222+
winget install Publisher.ExampleApp --ignore-user-messages
223+
```
224+
204225
### COM API
205226

206227
The COM API must surface `UserMessages` in a structured manner for programmatic consumers.

0 commit comments

Comments
 (0)