From cc3674ea93a83a7a191f5c3cb047c4f74dd60dcd 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: Accept multiple arguments to `nix flake update` Fixes: https://git.lix.systems/lix-project/lix/issues/194 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); -- cgit v1.2.3