Add shell completion for --override-input

This commit is contained in:
Naïm Favier 2022-02-19 18:36:02 +01:00
parent 7f5cf87d56
commit 7ddcb39206
No known key found for this signature in database
GPG key ID: 49B07322580B7EE2

View file

@ -98,6 +98,14 @@ MixFlakeOptions::MixFlakeOptions()
lockFlags.inputOverrides.insert_or_assign(
flake::parseInputPath(inputPath),
parseFlakeRef(flakeRef, absPath("."), true));
}},
.completer = {[&](size_t n, std::string_view prefix) {
if (n == 0) {
if (auto flakeRef = getFlakeRefForCompletion())
completeFlakeInputPath(getEvalState(), *flakeRef, prefix);
} else if (n == 1) {
completeFlakeRef(getEvalState()->store, prefix);
}
}}
});