mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +02:00
Merge pull request #10073 from olmokramer/nix-flake-update-multiple-inputs
Accept multiple inputs in `nix flake update`
This commit is contained in:
commit
8a9eec375c
2 changed files with 22 additions and 10 deletions
|
@ -88,17 +88,19 @@ public:
|
|||
expectArgs({
|
||||
.label="inputs",
|
||||
.optional=true,
|
||||
.handler={[&](std::string inputToUpdate){
|
||||
InputPath inputPath;
|
||||
try {
|
||||
inputPath = flake::parseInputPath(inputToUpdate);
|
||||
} catch (Error & e) {
|
||||
warn("Invalid flake input '%s'. To update a specific flake, use 'nix flake update --flake %s' instead.", inputToUpdate, inputToUpdate);
|
||||
throw e;
|
||||
.handler={[&](std::vector<std::string> inputsToUpdate){
|
||||
for (auto inputToUpdate : inputsToUpdate) {
|
||||
InputPath inputPath;
|
||||
try {
|
||||
inputPath = flake::parseInputPath(inputToUpdate);
|
||||
} catch (Error & e) {
|
||||
warn("Invalid flake input '%s'. To update a specific flake, use 'nix flake update --flake %s' instead.", inputToUpdate, inputToUpdate);
|
||||
throw e;
|
||||
}
|
||||
if (lockFlags.inputUpdates.contains(inputPath))
|
||||
warn("Input '%s' was specified multiple times. You may have done this by accident.");
|
||||
lockFlags.inputUpdates.insert(inputPath);
|
||||
}
|
||||
if (lockFlags.inputUpdates.contains(inputPath))
|
||||
warn("Input '%s' was specified multiple times. You may have done this by accident.");
|
||||
lockFlags.inputUpdates.insert(inputPath);
|
||||
}},
|
||||
.completer = {[&](AddCompletions & completions, size_t, std::string_view prefix) {
|
||||
completeFlakeInputPath(completions, getEvalState(), getFlakeRefsForCompletion(), prefix);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue