From 0cf94292e457d7ec5667ca94df4484c61b1c6f10 Mon Sep 17 00:00:00 2001 From: Delapouite Date: Thu, 9 Feb 2017 10:18:13 +0100 Subject: [PATCH] Add command completer for types to declare-option --- src/commands.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/commands.cc b/src/commands.cc index b12742f4..39529217 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1317,7 +1317,12 @@ const CommandDesc declare_option_cmd = { }, CommandFlags::None, CommandHelper{}, - CommandCompleter{}, + make_completer( + [](const Context& context, CompletionFlags flags, + const String& prefix, ByteCount cursor_pos) -> Completions { + auto c = {"int", "bool", "str", "regex", "int-list", "str-list", "completions", "line-flags", "range-faces"}; + return { 0_byte, cursor_pos, complete(prefix, cursor_pos, c) }; + }), [](const ParametersParser& parser, Context& context, const ShellContext&) { Option* opt = nullptr;