Accept multiple arguments to nix flake update
Fixes: https://git.lix.systems/lix-project/lix/issues/194 Change-Id: Ia7bd4f7640384be9827dbb7e2c594f0aa5f1aff8
This commit is contained in:
parent
c55e93ca23
commit
cc3674ea93
1 changed files with 7 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue