Reject --profile / -P within .mlrrc files (#358)

Per maintainer feedback on the PR: profiles are selected on the mlr
command line, not from within a .mlrrc file, so --profile / -P inside a
.mlrrc file is now a parse error -- the same way --prepipe is rejected
there -- rather than being silently ignored.

Adds a unit test, a should-fail regression case, and a docs bullet.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
John Kerl 2026-07-14 16:39:29 -04:00
parent 3a0abd3378
commit 0fbba5ce66
10 changed files with 39 additions and 0 deletions

View file

@ -128,6 +128,9 @@ Semantics:
* Since `--profile` selects a section of your `.mlrrc`, it can't be combined with `--norc`, or
with `MLRRC=__none__` in the environment -- that's a fatal error.
* Profiles are selected on the `mlr` command line, not from within a `.mlrrc` file: putting
`--profile` (or `-P`) inside a `.mlrrc` file is a parse error, just as `--prepipe` is.
## Where to put your .mlrrc
If the environment variable `MLRRC` is set:

View file

@ -96,6 +96,9 @@ Semantics:
* Since `--profile` selects a section of your `.mlrrc`, it can't be combined with `--norc`, or
with `MLRRC=__none__` in the environment -- that's a fatal error.
* Profiles are selected on the `mlr` command line, not from within a `.mlrrc` file: putting
`--profile` (or `-P`) inside a `.mlrrc` file is a parse error, just as `--prepipe` is.
## Where to put your .mlrrc
If the environment variable `MLRRC` is set: