Compare commits

...

2 commits

View file

@ -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);
@ -132,6 +134,15 @@ struct CmdFlakeLock : FlakeCommand
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. */
removeFlag("no-write-lock-file");
}