diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-12-17 11:54:20 -0600 |
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2025-12-17 21:29:58 -0600 |
| commit | f58bfaa3487ef821466e35fbd2bb073732e889dd (patch) | |
| tree | c1c340dc190d2595cc1e1ec8447f163ce56610b2 /src/vyconf_client.ml | |
| parent | 28b6ac04aaef995656eaabb2c9a279a79e657687 (diff) | |
| download | vyconf-f58bfaa3487ef821466e35fbd2bb073732e889dd.tar.gz vyconf-f58bfaa3487ef821466e35fbd2bb073732e889dd.zip | |
T8061: add get_completion_env request
Return help strings and values in the form used by bash completion.
Diffstat (limited to 'src/vyconf_client.ml')
| -rw-r--r-- | src/vyconf_client.ml | 9 |
1 files changed, 9 insertions, 0 deletions
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 |
