Add shell completion for --override-flake

Requires moving the MixEvalArgs class from libexpr to libcmd because
that's where completeFlakeRef is.
This commit is contained in:
Naïm Favier
2022-03-07 12:01:54 +01:00
parent 55c6906701
commit da7d8daa77
2 changed files with 4 additions and 0 deletions
@@ -7,6 +7,7 @@
#include "registry.hh"
#include "flake/flakeref.hh"
#include "store-api.hh"
#include "command.hh"
namespace nix {
@@ -59,6 +60,9 @@ MixEvalArgs::MixEvalArgs()
fetchers::Attrs extraAttrs;
if (to.subdir != "") extraAttrs["dir"] = to.subdir;
fetchers::overrideRegistry(from.input, to.input, extraAttrs);
}},
.completer = {[&](size_t, std::string_view prefix) {
completeFlakeRef(openStore(), prefix);
}}
});