summaryrefslogtreecommitdiff
path: root/src/vytree.mli
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2017-01-12 20:23:52 +0700
committerDaniil Baturin <daniil@baturin.org>2017-01-12 20:23:52 +0700
commit26fc59887e8c596dad4e67d350b26c5e908be259 (patch)
tree83fb63fb0de514a0772a90cfbdac27c125cfd3fd /src/vytree.mli
parentf947b3e8e7b9db2fcab250ce6d8050b650130cec (diff)
downloadvyconf-26fc59887e8c596dad4e67d350b26c5e908be259.tar.gz
vyconf-26fc59887e8c596dad4e67d350b26c5e908be259.zip
T245: improve handling of nodes with duplicate names.
Two tag nodes with the same name ("ethernet eth0 {...} ethernet eth0 {...}") is an error. Two leaf nodes with the same name, however, are not an error. Values of the next nodes are merged into the first one, while all other data (comment and inactive and ephemeral properties are inherited from the first node. This mimics the old syntax of multi nodes, so a person who uses the old syntax out of habit in a handwritten config will get the result they expect.
Diffstat (limited to 'src/vytree.mli')
-rw-r--r--src/vytree.mli2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vytree.mli b/src/vytree.mli
index 02d8edf..9bc8844 100644
--- a/src/vytree.mli
+++ b/src/vytree.mli
@@ -23,7 +23,7 @@ val insert : ?position:position -> 'a t -> string list -> 'a -> 'a t
val insert_multi_level : 'a -> 'a t -> string list -> string list -> 'a -> 'a t
-val merge_children : 'a t -> 'a t
+val merge_children : ('a -> 'a -> 'a) -> 'a t -> 'a t
val delete : 'a t -> string list -> 'a t