Skip to content
Snippets Groups Projects
Commit c87833a2 authored by Andre Maroneze's avatar Andre Maroneze Committed by Julien Signoles
Browse files

[Kernel] fix -autocomplete to avoid displaying 'Input C files' option

parent 1f3fc9c6
No related branches found
No related tags found
No related merge requests found
...@@ -174,24 +174,29 @@ let run_list_all_plugin_options () = ...@@ -174,24 +174,29 @@ let run_list_all_plugin_options () =
generate 2 strings *) generate 2 strings *)
let strings_of_typed_parameter tp = let strings_of_typed_parameter tp =
let name = tp.Typed_parameter.name in let name = tp.Typed_parameter.name in
match tp.Typed_parameter.accessor with (* special case due to the "cmdline hack" related to
| Typed_parameter.Bool (_, opt_neg) -> the "Input C files" option: if it does not start
begin with '-', ignore it *)
match opt_neg with if String.get name 0 <> '-' then []
| None -> [(name, "bool")] else
| Some neg -> [(name, "bool"); (neg, "bool")] match tp.Typed_parameter.accessor with
end | Typed_parameter.Bool (_, opt_neg) ->
| Int (_, frange) -> begin
let (min, max) = frange () in match opt_neg with
if min = min_int && max = max_int then [(name, "int")] | None -> [(name, "bool")]
else [(name, Format.asprintf "int (%d, %d)" min max)] | Some neg -> [(name, "bool"); (neg, "bool")]
| String (_, fvalues) -> end
let values = fvalues () in | Int (_, frange) ->
if values = [] then [(name, "string")] let (min, max) = frange () in
else if min = min_int && max = max_int then [(name, "int")]
[(name, Format.asprintf "string (%a)" else [(name, Format.asprintf "int (%d, %d)" min max)]
(Pretty_utils.pp_list ~sep:", " | String (_, fvalues) ->
Format.pp_print_string) values)] let values = fvalues () in
if values = [] then [(name, "string")]
else
[(name, Format.asprintf "string (%a)"
(Pretty_utils.pp_list ~sep:", "
Format.pp_print_string) values)]
in in
let group_options = let group_options =
List.flatten List.flatten
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment