diff options
author | Nikodem RabuliĆski <nikodem@rabulinski.com> | 2024-05-17 21:50:38 +0200 |
---|---|---|
committer | jade <lix@jade.fyi> | 2024-06-03 21:50:33 +0000 |
commit | cc3674ea93a83a7a191f5c3cb047c4f74dd60dcd (patch) | |
tree | 065aebaefd7624ad0de55817ec47a60134ab5a3e /src/nix | |
parent | c55e93ca23eae608f2ff80e940f35f5daa6b4f7f (diff) |
Accept multiple arguments to `nix flake update`
Fixes: https://git.lix.systems/lix-project/lix/issues/194
Change-Id: Ia7bd4f7640384be9827dbb7e2c594f0aa5f1aff8
Diffstat (limited to 'src/nix')
-rw-r--r-- | src/nix/flake.cc | 12 |
1 files 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<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); |