diff options
author | Naïm Favier <n@monade.li> | 2022-06-20 04:15:38 +0200 |
---|---|---|
committer | Naïm Favier <n@monade.li> | 2022-07-11 15:13:51 +0200 |
commit | 711b2e1f48316d80853635408c518e3562a1fa37 (patch) | |
tree | dcb298bf9a252344e8e7dd947a5d029e4e6e131d /src/libcmd/command.hh | |
parent | d6d0e781bbade76f6ea3f310cb36973f4013826d (diff) |
Fix flake input completion for `InstallablesCommand`s
Defers completion of flake inputs until the whole command line is parsed
so that we know what flakes we need to complete the inputs of.
Previously, `nix build flake --update-input <Tab>` always behaved like
`nix build . --update-input <Tab>`.
Diffstat (limited to 'src/libcmd/command.hh')
-rw-r--r-- | src/libcmd/command.hh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcmd/command.hh b/src/libcmd/command.hh index cab379b84..ffa8e784f 100644 --- a/src/libcmd/command.hh +++ b/src/libcmd/command.hh @@ -77,12 +77,16 @@ struct MixFlakeOptions : virtual Args, EvalCommand { flake::LockFlags lockFlags; + std::optional<std::string> needsFlakeInputCompletion = {}; + MixFlakeOptions(); virtual std::vector<std::string> getFlakesForCompletion() { return {}; } void completeFlakeInput(std::string_view prefix); + + void completionHook() override; }; struct SourceExprCommand : virtual Args, MixFlakeOptions |