aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/args.cc
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/libutil/args.cc
parent6e6e998930f0d7361d64644eb37d9134e74e8501 (diff)
Don't insert spaces when completing attribute paths
Diffstat (limited to 'src/libutil/args.cc')
-rw-r--r--src/libutil/args.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/args.cc b/src/libutil/args.cc
index 9df279faf..a739d6b4e 100644
--- a/src/libutil/args.cc
+++ b/src/libutil/args.cc
@@ -39,7 +39,7 @@ void Completions::add(std::string completion, std::string description)
bool Completion::operator<(const Completion & other) const
{ return completion < other.completion || (completion == other.completion && description < other.description); }
-bool pathCompletions = false;
+CompletionType completionType = ctNormal;
std::shared_ptr<Completions> completions;
std::string completionMarker = "___COMPLETE___";
@@ -277,7 +277,7 @@ Args::Flag Args::Flag::mkHashTypeOptFlag(std::string && longName, std::optional<
static void _completePath(std::string_view prefix, bool onlyDirs)
{
- pathCompletions = true;
+ completionType = ctFilenames;
glob_t globbuf;
int flags = GLOB_NOESCAPE | GLOB_TILDE;
#ifdef GLOB_ONLYDIR