diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-12-09 15:30:10 -0600 |
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2025-12-17 19:03:38 -0600 |
| commit | 28b6ac04aaef995656eaabb2c9a279a79e657687 (patch) | |
| tree | f10db931d15eeb8a7fbce2c9e619a6c0032a8aad /src/vyconf_cli_compat.ml | |
| parent | a2775407f2b69f9e0b5030bcac691463abbede06 (diff) | |
| download | vyconf-28b6ac04aaef995656eaabb2c9a279a79e657687.tar.gz vyconf-28b6ac04aaef995656eaabb2c9a279a79e657687.zip | |
T8061: add get_path_type request
Get the potential node type of a path, preliminary to any validation of
values.
Diffstat (limited to 'src/vyconf_cli_compat.ml')
| -rw-r--r-- | src/vyconf_cli_compat.ml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vyconf_cli_compat.ml b/src/vyconf_cli_compat.ml index ae0d378..c86ca2c 100644 --- a/src/vyconf_cli_compat.ml +++ b/src/vyconf_cli_compat.ml @@ -11,6 +11,7 @@ type op_t = | OpSessionChanged | OpConfigUnsaved | OpReferencePathExists + | OpGetPathType let op_of_arg s = match s with @@ -23,6 +24,7 @@ let op_of_arg s = | "sessionChanged" -> OpSessionChanged | "sessionUnsaved" -> OpConfigUnsaved | "validateTmplPath" -> OpReferencePathExists + | "getNodeType" -> OpGetPathType | _ -> failwith (Printf.sprintf "Unknown operation %s" s) let in_cli_config_session () = @@ -94,6 +96,7 @@ let main op path = | OpSessionChanged -> session_changed c | OpConfigUnsaved -> config_unsaved c None | OpReferencePathExists -> reference_path_exists c path + | OpGetPathType -> get_path_type c path end | Error e -> Error e |> Lwt.return in @@ -131,7 +134,7 @@ let () = with Failure msg -> let () = print_endline msg in exit 1 in match op, path_list with - | OpSetEditLevel, [] | OpReferencePathExists, [] -> + | OpSetEditLevel, [] | OpReferencePathExists, [] | OpGetPathType, [] -> let () = print_endline "Must specify config path" in exit 1 | _, _ -> let result = Lwt_main.run (main op path_list) in exit result |
