0
|
1 <?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
|
3 <!--
|
|
4 This is the RNG file for validating Console_CommandLine xml definitions.
|
|
5
|
|
6 Author : David JEAN LOUIS
|
|
7 Licence : MIT License
|
|
8 Version : CVS: $Id$
|
|
9 -->
|
|
10
|
|
11 <grammar xmlns="http://relaxng.org/ns/structure/1.0"
|
|
12 datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
13
|
|
14 <!-- structure -->
|
|
15 <start>
|
|
16 <ref name="ref_command"/>
|
|
17 </start>
|
|
18
|
|
19 <!-- Command node -->
|
|
20 <define name="ref_command_subcommand_common">
|
|
21 <interleave>
|
|
22 <optional>
|
|
23 <element name="name">
|
|
24 <text/>
|
|
25 </element>
|
|
26 </optional>
|
|
27 <optional>
|
|
28 <element name="description">
|
|
29 <text/>
|
|
30 </element>
|
|
31 </optional>
|
|
32 <optional>
|
|
33 <element name="version">
|
|
34 <text/>
|
|
35 </element>
|
|
36 </optional>
|
|
37 <optional>
|
|
38 <element name="add_help_option">
|
|
39 <ref name="ref_bool_choices"/>
|
|
40 </element>
|
|
41 </optional>
|
|
42 <optional>
|
|
43 <element name="add_version_option">
|
|
44 <ref name="ref_bool_choices"/>
|
|
45 </element>
|
|
46 </optional>
|
|
47 <optional>
|
|
48 <element name="force_posix">
|
|
49 <ref name="ref_bool_choices"/>
|
|
50 </element>
|
|
51 </optional>
|
|
52 <optional>
|
|
53 <ref name="ref_messages_common"/>
|
|
54 </optional>
|
|
55 <zeroOrMore>
|
|
56 <ref name="ref_option"/>
|
|
57 </zeroOrMore>
|
|
58 <zeroOrMore>
|
|
59 <ref name="ref_argument"/>
|
|
60 </zeroOrMore>
|
|
61 <zeroOrMore>
|
|
62 <ref name="ref_subcommand"/>
|
|
63 </zeroOrMore>
|
|
64 </interleave>
|
|
65 </define>
|
|
66
|
|
67 <!-- command element -->
|
|
68
|
|
69 <define name="ref_command">
|
|
70 <element name="command">
|
|
71 <interleave>
|
|
72 <ref name="ref_command_subcommand_common"/>
|
|
73 </interleave>
|
|
74 </element>
|
|
75 </define>
|
|
76
|
|
77 <!-- subcommand element -->
|
|
78
|
|
79 <define name="ref_subcommand">
|
|
80 <element name="command">
|
|
81 <interleave>
|
|
82 <ref name="ref_command_subcommand_common"/>
|
|
83 <optional>
|
|
84 <element name="aliases">
|
|
85 <zeroOrMore>
|
|
86 <element name="alias">
|
|
87 <text/>
|
|
88 </element>
|
|
89 </zeroOrMore>
|
|
90 </element>
|
|
91 </optional>
|
|
92 </interleave>
|
|
93 </element>
|
|
94 </define>
|
|
95
|
|
96 <!-- custom messages common element -->
|
|
97
|
|
98 <define name="ref_messages_common">
|
|
99 <element name="messages">
|
|
100 <oneOrMore>
|
|
101 <element name="message">
|
|
102 <attribute name="name">
|
|
103 <data type="string"/>
|
|
104 </attribute>
|
|
105 <text/>
|
|
106 </element>
|
|
107 </oneOrMore>
|
|
108 </element>
|
|
109 </define>
|
|
110
|
|
111 <!-- options and arguments common elements -->
|
|
112
|
|
113 <define name="ref_option_argument_common">
|
|
114 <interleave>
|
|
115 <optional>
|
|
116 <element name="description">
|
|
117 <text/>
|
|
118 </element>
|
|
119 </optional>
|
|
120 <optional>
|
|
121 <element name="help_name">
|
|
122 <text/>
|
|
123 </element>
|
|
124 </optional>
|
|
125 <optional>
|
|
126 <element name="default">
|
|
127 <text/>
|
|
128 </element>
|
|
129 </optional>
|
|
130 <optional>
|
|
131 <ref name="ref_messages_common"/>
|
|
132 </optional>
|
|
133 </interleave>
|
|
134 </define>
|
|
135
|
|
136 <!-- Option node -->
|
|
137 <define name="ref_option">
|
|
138 <element name="option">
|
|
139 <attribute name="name">
|
|
140 <data type="string"/>
|
|
141 </attribute>
|
|
142 <interleave>
|
|
143 <optional>
|
|
144 <element name="short_name">
|
|
145 <text/>
|
|
146 </element>
|
|
147 </optional>
|
|
148 <optional>
|
|
149 <element name="long_name">
|
|
150 <text/>
|
|
151 </element>
|
|
152 </optional>
|
|
153 <ref name="ref_option_argument_common"/>
|
|
154 <optional>
|
|
155 <element name="action">
|
|
156 <text/>
|
|
157 </element>
|
|
158 </optional>
|
|
159 <optional>
|
|
160 <element name="choices">
|
|
161 <zeroOrMore>
|
|
162 <element name="choice">
|
|
163 <text/>
|
|
164 </element>
|
|
165 </zeroOrMore>
|
|
166 </element>
|
|
167 </optional>
|
|
168 <optional>
|
|
169 <element name="add_list_option">
|
|
170 <ref name="ref_bool_choices"/>
|
|
171 </element>
|
|
172 </optional>
|
|
173 </interleave>
|
|
174 </element>
|
|
175 </define>
|
|
176
|
|
177 <!-- Argument node -->
|
|
178 <define name="ref_argument">
|
|
179 <element name="argument">
|
|
180 <attribute name="name">
|
|
181 <data type="string"/>
|
|
182 </attribute>
|
|
183 <interleave>
|
|
184 <ref name="ref_option_argument_common"/>
|
|
185 <optional>
|
|
186 <element name="multiple">
|
|
187 <ref name="ref_bool_choices"/>
|
|
188 </element>
|
|
189 </optional>
|
|
190 <optional>
|
|
191 <element name="optional">
|
|
192 <ref name="ref_bool_choices"/>
|
|
193 </element>
|
|
194 </optional>
|
|
195 <optional>
|
|
196 <element name="choices">
|
|
197 <zeroOrMore>
|
|
198 <element name="choice">
|
|
199 <text/>
|
|
200 </element>
|
|
201 </zeroOrMore>
|
|
202 </element>
|
|
203 </optional>
|
|
204 </interleave>
|
|
205 </element>
|
|
206 </define>
|
|
207
|
|
208 <!-- boolean choices -->
|
|
209 <define name="ref_bool_choices">
|
|
210 <choice>
|
|
211 <data type="token">
|
|
212 <param name="pattern">[Tt][Rr][Uu][Ee]</param>
|
|
213 </data>
|
|
214 <data type="token">
|
|
215 <param name="pattern">[On][Nn]</param>
|
|
216 </data>
|
|
217 <data type="token">
|
|
218 <param name="pattern">[Yy][Ee][Ss]</param>
|
|
219 </data>
|
|
220 <value>1</value>
|
|
221 <data type="token">
|
|
222 <param name="pattern">[Ff][Aa][Ll][Ss][Ee]</param>
|
|
223 </data>
|
|
224 <data type="token">
|
|
225 <param name="pattern">[Of][Ff][Ff]</param>
|
|
226 </data>
|
|
227 <data type="token">
|
|
228 <param name="pattern">[Nn][Oo]</param>
|
|
229 </data>
|
|
230 <value>0</value>
|
|
231 </choice>
|
|
232 </define>
|
|
233
|
|
234 </grammar>
|