aboutsummaryrefslogtreecommitdiff
path: root/src/nix/main.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-16 23:01:18 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-04-03 11:48:21 -0400
commit4a0b893d5e5d5cbf2f39e52d1651bcff8b4943a9 (patch)
tree2b2d23d51f1477be4d35472ce342349426b747ae /src/nix/main.cc
parentf3a6de6ba983141cabed200cefbf46c791c1d48a (diff)
Stuctured command stability
Prior to this, there was an ad-hoc whitelist in `main.cc`. Now, every command states its stability. In a future PR, we will adjust the manual to take advantage of this new information in the JSON. (It will be easier to do that once we have some experimental feature docs to link too; see #5930 and #7798.)
Diffstat (limited to 'src/nix/main.cc')
-rw-r--r--src/nix/main.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc
index c2e1dda74..4d4164333 100644
--- a/src/nix/main.cc
+++ b/src/nix/main.cc
@@ -423,10 +423,8 @@ void mainWrapped(int argc, char * * argv)
if (!args.command)
throw UsageError("no subcommand specified");
- if (args.command->first != "repl"
- && args.command->first != "doctor"
- && args.command->first != "upgrade-nix")
- experimentalFeatureSettings.require(Xp::NixCommand);
+ experimentalFeatureSettings.require(
+ args.command->second->experimentalFeature());
if (args.useNet && !haveInternet()) {
warn("you don't have Internet access; disabling some network-dependent features");