aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2021-12-22 12:37:59 +0100
committerNaïm Favier <n@monade.li>2021-12-22 16:17:01 +0100
commit1da1b2b345ccf32220a2628622ee8b170d9d521a (patch)
tree800a607ba075453c97525994a510fa1e1e4c6efc /src/nix
parent6e6e998930f0d7361d64644eb37d9134e74e8501 (diff)
Don't insert spaces when completing attribute paths
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/main.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc
index 60b0aa410..759118fd5 100644
--- a/src/nix/main.cc
+++ b/src/nix/main.cc
@@ -310,7 +310,14 @@ void mainWrapped(int argc, char * * argv)
Finally printCompletions([&]()
{
if (completions) {
- std::cout << (pathCompletions ? "filenames\n" : "no-filenames\n");
+ switch (completionType) {
+ case ctNormal:
+ std::cout << "normal\n"; break;
+ case ctFilenames:
+ std::cout << "filenames\n"; break;
+ case ctAttrs:
+ std::cout << "attrs\n"; break;
+ }
for (auto & s : *completions)
std::cout << s.completion << "\t" << s.description << "\n";
}