From f58bfaa3487ef821466e35fbd2bb073732e889dd Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 17 Dec 2025 11:54:20 -0600 Subject: T8061: add get_completion_env request Return help strings and values in the form used by bash completion. --- src/vyconf_client.ml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/vyconf_client.ml') diff --git a/src/vyconf_client.ml b/src/vyconf_client.ml index 8a8dc46..6b6c6f1 100644 --- a/src/vyconf_client.ml +++ b/src/vyconf_client.ml @@ -245,3 +245,12 @@ let get_path_type client path = | Success -> unwrap resp.output |> Lwt.return | Fail -> Error (Option.value resp.error ~default:"") |> Lwt.return | _ -> Error (Option.value resp.error ~default:"") |> Lwt.return + +let get_completion_env client path = + let req = Get_completion_env {path=path; legacy_format=true;} in + let%lwt resp = do_request client req in + match resp.status with + | Success -> unwrap resp.output |> Lwt.return + (* legacy getCompletionEnv is silent on error *) + | Fail -> Error "" |> Lwt.return + | _ -> Error (Option.value resp.error ~default:"") |> Lwt.return -- cgit v1.2.3