-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn on unknown settings when the first positional is an argument #10701
Warn on unknown settings when the first positional is an argument #10701
Conversation
Does this also affect |
This comment was marked as resolved.
This comment was marked as resolved.
894bfdf
to
a53fd51
Compare
OK, I updated the tests to test both clis and ensure that only one line of "unknown setting" is output. Here's what I found while investigating this:
You can actually reproduce this "silence" on the old cli with this:
|
Before: $ nix-instantiate --option foobar baz --expr '{}'
warning: unknown setting 'foobar'
$ nix-instantiate '{}' --option foobar baz --expr
$ nix eval --expr '{}' --option foobar baz
{ } After: $ nix-instantiate --option foobar baz --expr '{}'
warning: unknown setting 'foobar'
$ nix-instantiate '{}' --option foobar baz --expr
warning: unknown setting 'foobar'
$ nix eval --expr '{}' --option foobar baz
warning: unknown setting 'foobar'
{ } |
a53fd51
to
572fd4c
Compare
572fd4c
to
39a2696
Compare
Upstream change: NixOS/nix#10701 Change-Id: Icf271df57ec529dd8c64667d1ef9f6dbf02d33d3
Motivation
We should warn when unknown settings are passed on the command line.
Context
While debugging an unrelated issue, I noticed that one of the flags I was passing wasn't valid for that version, but Nix never warned me of this fact. When I tested a similar invocation with the legacy interface, I was immediately warned about this unknown setting.
Priorities and Process
Add 馃憤 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.