diff options
Diffstat (limited to 'src/libutil/args.cc')
-rw-r--r-- | src/libutil/args.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libutil/args.cc b/src/libutil/args.cc index 8db293762..02d559540 100644 --- a/src/libutil/args.cc +++ b/src/libutil/args.cc @@ -162,7 +162,7 @@ bool Args::processFlag(Strings::iterator & pos, Strings::iterator end) if (auto prefix = needsCompletion(*pos)) { for (auto & [name, flag] : longFlags) { if (!hiddenCategories.count(flag->category) - && hasPrefix(name, std::string(*prefix, 2))) + && name.starts_with(std::string(*prefix, 2))) { if (auto & f = flag->experimentalFeature) flagExperimentalFeatures.insert(*f); @@ -274,7 +274,7 @@ nlohmann::json Args::toJSON() static void hashTypeCompleter(size_t index, std::string_view prefix) { for (auto & type : hashTypes) - if (hasPrefix(type, prefix)) + if (type.starts_with(prefix)) completions->add(type); } @@ -370,7 +370,7 @@ MultiCommand::MultiCommand(const Commands & commands_) }}, .completer = {[&](size_t, std::string_view prefix) { for (auto & [name, command] : commands) - if (hasPrefix(name, prefix)) + if (name.starts_with(prefix)) completions->add(name); }} }); |