From bc2c1a032a4aad1d5c3f5047d51f86bf8370b163 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 12 Sep 2017 21:08:25 +0700 Subject: Add support for completionHelp tag to the schema. --- data/schemata/interface_definition.rnc | 20 +++++++++++++++- data/schemata/interface_definition.rng | 42 +++++++++++++++++++++++++++++++++- 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 +# Copyright (C) 2014. 2017 VyOS maintainers and contributors # # 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. foo bar baz), +# as a configuration path (e.g. interfaces ethernet), +# or as a path to a script file that generates the list (e.g. +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 @@ @@ -134,6 +137,9 @@ + + + @@ -157,6 +163,11 @@ + + + + + @@ -227,4 +238,33 @@ + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3