mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-01-31 23:46:48 +02:00
Accept multiple inputs in nix flake update
This commit is contained in:
parent
d83008c3a7
commit
9f11b1b0c4
1 changed files with 12 additions and 10 deletions
|
@ -88,17 +88,19 @@ public:
|
||||||
expectArgs({
|
expectArgs({
|
||||||
.label="inputs",
|
.label="inputs",
|
||||||
.optional=true,
|
.optional=true,
|
||||||
.handler={[&](std::string inputToUpdate){
|
.handler={[&](std::vector<std::string> inputsToUpdate){
|
||||||
InputPath inputPath;
|
for (auto inputToUpdate : inputsToUpdate) {
|
||||||
try {
|
InputPath inputPath;
|
||||||
inputPath = flake::parseInputPath(inputToUpdate);
|
try {
|
||||||
} catch (Error & e) {
|
inputPath = flake::parseInputPath(inputToUpdate);
|
||||||
warn("Invalid flake input '%s'. To update a specific flake, use 'nix flake update --flake %s' instead.", inputToUpdate, inputToUpdate);
|
} catch (Error & e) {
|
||||||
throw 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) {
|
.completer = {[&](AddCompletions & completions, size_t, std::string_view prefix) {
|
||||||
completeFlakeInputPath(completions, getEvalState(), getFlakeRefsForCompletion(), prefix);
|
completeFlakeInputPath(completions, getEvalState(), getFlakeRefsForCompletion(), prefix);
|
||||||
|
|
Loading…
Reference in a new issue