summaryrefslogtreecommitdiff
path: root/src/config_tree.mli
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-02-17 23:15:57 +0700
committerDaniil Baturin <daniil@baturin.org>2018-02-17 23:15:57 +0700
commitbfa93363f3e8533ef352cad38c2adfa21dbc28a3 (patch)
tree4c5786f9688f018d5cbead2588c409802d9dbc31 /src/config_tree.mli
parentd4ee9b96e02e1413cc19ce638aec07408468ca30 (diff)
downloadvyconf-bfa93363f3e8533ef352cad38c2adfa21dbc28a3.tar.gz
vyconf-bfa93363f3e8533ef352cad38c2adfa21dbc28a3.zip
Add Config_tree.render_at_level function for correct rendering of configs for human consumption.
The idea of the correct (for subsequent parsing) and familiar for all other purposes rendering: * When rendering the entire config, do not render the invisible "root" node, only render its children. * When rendering config at specified path, do not include any nodes that are within the path (e.g. if path "system login" exists, "show system" request output should start with "login {", not "system { login { ...").
Diffstat (limited to 'src/config_tree.mli')
-rw-r--r--src/config_tree.mli12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/config_tree.mli b/src/config_tree.mli
index f724df1..f72eda9 100644
--- a/src/config_tree.mli
+++ b/src/config_tree.mli
@@ -56,10 +56,20 @@ val is_ephemeral : t -> string list -> bool
*)
val render :
?indent:int ->
- ?reftree:Reference_tree.t ->
+ ?reftree:(Reference_tree.t option)->
?cmp:(string -> string -> int) ->
?showephemeral:bool ->
?showinactive:bool ->
t ->
string
+val render_at_level :
+ ?indent:int ->
+ ?reftree:(Reference_tree.t option)->
+ ?cmp:(string -> string -> int) ->
+ ?showephemeral:bool ->
+ ?showinactive:bool ->
+ t ->
+ string list ->
+ string
+