Compare commits

...

2 commits

View file

@ -87,11 +87,13 @@ public:
expectArgs({ expectArgs({
.label="inputs", .label="inputs",
.optional=true, .optional=true,
.handler={[&](std::string inputToUpdate){ .handler={[&](std::vector<std::string> inputsToUpdate) {
auto inputPath = flake::parseInputPath(inputToUpdate); for (const auto & inputToUpdate : inputsToUpdate) {
if (lockFlags.inputUpdates.contains(inputPath)) auto inputPath = flake::parseInputPath(inputToUpdate);
warn("Input '%s' was specified multiple times. You may have done this by accident."); if (lockFlags.inputUpdates.contains(inputPath))
lockFlags.inputUpdates.insert(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);
@ -132,6 +134,15 @@ struct CmdFlakeLock : FlakeCommand
CmdFlakeLock() CmdFlakeLock()
{ {
addFlag({
.longName="update-input",
.description="Replaced with `nix flake update input...`",
.labels={"input-path"},
.handler={[&](std::string inputToUpdate){
throw UsageError("`nix flake lock --update-input %1%` has been replaced by `nix flake update %1%`", inputToUpdate);
}}
});
/* Remove flags that don't make sense. */ /* Remove flags that don't make sense. */
removeFlag("no-write-lock-file"); removeFlag("no-write-lock-file");
} }