diff options
Diffstat (limited to 'src/nix/flake.cc')
-rw-r--r-- | src/nix/flake.cc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/nix/flake.cc b/src/nix/flake.cc index 7b5d8096a..d24f746f8 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -87,11 +87,13 @@ public: expectArgs({ .label="inputs", .optional=true, - .handler={[&](std::string inputToUpdate){ - auto inputPath = flake::parseInputPath(inputToUpdate); - if (lockFlags.inputUpdates.contains(inputPath)) - warn("Input '%s' was specified multiple times. You may have done this by accident."); - lockFlags.inputUpdates.insert(inputPath); + .handler={[&](std::vector<std::string> inputsToUpdate) { + for (const auto & inputToUpdate : inputsToUpdate) { + auto inputPath = flake::parseInputPath(inputToUpdate); + if (lockFlags.inputUpdates.contains(inputPath)) + warn("Input '%s' was specified multiple times. You may have done this by accident.", inputToUpdate); + lockFlags.inputUpdates.insert(inputPath); + } }}, .completer = {[&](AddCompletions & completions, size_t, std::string_view prefix) { completeFlakeInputPath(completions, getEvalState(), getFlakeRefsForCompletion(), prefix); @@ -132,6 +134,15 @@ struct CmdFlakeLock : FlakeCommand CmdFlakeLock() { + addFlag({ + .longName="update-input", + .description="Replaced with `nix flake update input...`", + .labels={"input-path"}, + .handler={[&](std::string inputToUpdate){ + throw UsageError("`nix flake lock --update-input %1%` has been replaced by `nix flake update %1%`", inputToUpdate); + }} + }); + /* Remove flags that don't make sense. */ removeFlag("no-write-lock-file"); } |