From 4879178a81d1d03ff52e2bd31d8e55b8548d78c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikodem=20Rabuli=C5=84ski?= Date: Fri, 17 May 2024 21:50:38 +0200 Subject: [PATCH] Accept multiple arguments to `nix flake update` Change-Id: Ia7bd4f7640384be9827dbb7e2c594f0aa5f1aff8 --- src/nix/flake.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/nix/flake.cc b/src/nix/flake.cc index 7b5d8096a..1648c56d0 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 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);