summaryrefslogtreecommitdiff
path: root/data/schemata
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2017-09-12 21:08:25 +0700
committerDaniil Baturin <daniil@baturin.org>2017-09-12 21:08:25 +0700
commitbc2c1a032a4aad1d5c3f5047d51f86bf8370b163 (patch)
tree91b809e6a1f5e377054e0b543159d122f0b645f6 /data/schemata
parentd498690d867f84c6c48f6e93cbd0a0c0c2909e4f (diff)
downloadvyconf-bc2c1a032a4aad1d5c3f5047d51f86bf8370b163.tar.gz
vyconf-bc2c1a032a4aad1d5c3f5047d51f86bf8370b163.zip
Add support for completionHelp tag to the schema.
Diffstat (limited to 'data/schemata')
-rw-r--r--data/schemata/interface_definition.rnc20
-rw-r--r--data/schemata/interface_definition.rng42
2 files changed, 60 insertions, 2 deletions
diff --git a/data/schemata/interface_definition.rnc b/data/schemata/interface_definition.rnc
index 3b3fa1e..48aae57 100644
--- a/data/schemata/interface_definition.rnc
+++ b/data/schemata/interface_definition.rnc
@@ -1,6 +1,6 @@
# interface_definition.rnc: VyConf reference tree XML grammar
#
-# Copyright (C) 2014 VyOS Development Group <maintainers@vyos.net>
+# Copyright (C) 2014. 2017 VyOS maintainers and contributors <maintainers@vyos.net>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -75,18 +75,23 @@ children = element children
# "valueless" means it can have no values at all.
# "hidden" means node visibility can be toggled, eg 'dangerous' commands,
# "secret" allows a node to hide its value from unprivileged users.
+#
+# "priority" is used to influence node processing order for nodes
+# with exact same dependencies and in compatibility modes.
properties = element properties
{
help? &
constraint? &
valueHelp* &
(element constraintErrorMessage { text })? &
+ completionHelp* &
# These are meaningful only for leaf nodes
(element valueless { empty })? &
(element multi { empty })? &
(element hidden { empty })? &
(element secret { empty })? &
+ (element priority { text })? &
# These are meaningful only for tag nodes
(element keepChildOrder { empty })?
@@ -134,3 +139,16 @@ valueHelp = element valueHelp
element format { text } &
element description { text }
}
+
+# completionHelp tags contain information about allowed values of a node that is used for generating
+# tab completion in the CLI frontend and drop-down lists in GUI frontends
+# It is only meaninful for leaf nodes
+# Allowed values can be given as a fixed list of values (e.g. <list>foo bar baz</list>),
+# as a configuration path (e.g. <path>interfaces ethernet</path>),
+# or as a path to a script file that generates the list (e.g. <script>/usr/lib/foo/list-things</script>
+completionHelp = element completionHelp
+{
+ (element list { text })* &
+ (element path { text })* &
+ (element script { text })*
+}
diff --git a/data/schemata/interface_definition.rng b/data/schemata/interface_definition.rng
index 8aa3ed5..d1bd9a7 100644
--- a/data/schemata/interface_definition.rng
+++ b/data/schemata/interface_definition.rng
@@ -3,7 +3,7 @@
<!--
interface_definition.rnc: VyConf reference tree XML grammar
- Copyright (C) 2014 VyOS Development Group <maintainers@vyos.net>
+ Copyright (C) 2014. 2017 VyOS maintainers and contributors <maintainers@vyos.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -116,6 +116,9 @@
"valueless" means it can have no values at all.
"hidden" means node visibility can be toggled, eg 'dangerous' commands,
"secret" allows a node to hide its value from unprivileged users.
+
+ "priority" is used to influence node processing order for nodes
+ with exact same dependencies and in compatibility modes.
-->
<define name="properties">
<element name="properties">
@@ -134,6 +137,9 @@
<text/>
</element>
</optional>
+ <zeroOrMore>
+ <ref name="completionHelp"/>
+ </zeroOrMore>
<optional>
<!-- These are meaningful only for leaf nodes -->
<group>
@@ -158,6 +164,11 @@
</element>
</optional>
<optional>
+ <element name="priority">
+ <text/>
+ </element>
+ </optional>
+ <optional>
<!-- These are meaningful only for tag nodes -->
<group>
<element name="keepChildOrder">
@@ -227,4 +238,33 @@
</interleave>
</element>
</define>
+ <!--
+ completionHelp tags contain information about allowed values of a node that is used for generating
+ tab completion in the CLI frontend and drop-down lists in GUI frontends
+ It is only meaninful for leaf nodes
+ Allowed values can be given as a fixed list of values (e.g. <list>foo bar baz</list>),
+ as a configuration path (e.g. <path>interfaces ethernet</path>),
+ or as a path to a script file that generates the list (e.g. <script>/usr/lib/foo/list-things</script>
+ -->
+ <define name="completionHelp">
+ <element name="completionHelp">
+ <interleave>
+ <zeroOrMore>
+ <element name="list">
+ <text/>
+ </element>
+ </zeroOrMore>
+ <zeroOrMore>
+ <element name="path">
+ <text/>
+ </element>
+ </zeroOrMore>
+ <zeroOrMore>
+ <element name="script">
+ <text/>
+ </element>
+ </zeroOrMore>
+ </interleave>
+ </element>
+ </define>
</grammar>