klish.xsd 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://clish.sourceforge.net/XMLSchema" targetNamespace="http://clish.sourceforge.net/XMLSchema">
  3. <xs:annotation>
  4. <xs:appinfo>XML schema for klish configuration files</xs:appinfo>
  5. <xs:documentation xml:lang="en">
  6. The klish utility uses XML files for configuration. This schema
  7. allows to validate klish XML files. To check XML files use the
  8. following command:
  9. 'xmllint --schema /path/to/klish.xsd --noout *.xml'
  10. </xs:documentation>
  11. <xs:documentation xml:lang="ru">
  12. Утилита klish использует формат XML для своих конфигурационных
  13. файлов. Схема позволяет проверить эти конфигурационные XML файлы
  14. на правильность. Следующая команда выполнит проверку:
  15. 'xmllint --schema /path/to/klish.xsd --noout *.xml'
  16. </xs:documentation>
  17. </xs:annotation>
  18. <xs:element name="KLISH" type="klish_t"/>
  19. <xs:element name="PLUGIN" type="plugin_t"/>
  20. <xs:element name="HOTKEY" type="hotkey_t"/>
  21. <xs:element name="ACTION" type="action_t"/>
  22. <xs:element name="ENTRY" type="entry_t"/>
  23. <xs:element name="VIEW" type="view_t"/> <!-- Wrapper -->
  24. <xs:element name="NSPACE" type="nspace_t"/> <!-- Wrapper -->
  25. <xs:element name="COMMAND" type="command_t"/> <!-- Wrapper -->
  26. <xs:element name="SUBCOMMAND" type="param_t"/> <!-- Wrapper -->
  27. <xs:element name="FILTER" type="command_t"/> <!-- Wrapper -->
  28. <xs:element name="COND" type="command_t"/> <!-- Wrapper -->
  29. <xs:element name="COMPL" type="command_t"/> <!-- Wrapper -->
  30. <xs:element name="HELP" type="command_t"/> <!-- Wrapper -->
  31. <xs:element name="PTYPE" type="ptype_t"/> <!-- Wrapper -->
  32. <xs:element name="PARAM" type="param_t"/> <!-- Wrapper -->
  33. <xs:element name="SWITCH" type="param_t"/> <!-- Wrapper -->
  34. <xs:element name="MULTI" type="param_t"/> <!-- Wrapper -->
  35. <!--
  36. *******************************************************
  37. * <KLISH> is a top level container.
  38. ********************************************************
  39. -->
  40. <xs:group name="klish_group_t">
  41. <xs:choice>
  42. <xs:element ref="PLUGIN" minOccurs="0" maxOccurs="unbounded"/>
  43. <xs:element ref="HOTKEY" minOccurs="0" maxOccurs="unbounded"/>
  44. <xs:element ref="ENTRY" minOccurs="0" maxOccurs="unbounded"/>
  45. <xs:element ref="PTYPE" minOccurs="0" maxOccurs="unbounded"/>
  46. <xs:element ref="VIEW" minOccurs="0" maxOccurs="unbounded"/>
  47. </xs:choice>
  48. </xs:group>
  49. <xs:complexType name="klish_t">
  50. <xs:annotation>
  51. <xs:documentation xml:lang="en">
  52. 'KLISH' is the top level container.
  53. </xs:documentation>
  54. <xs:documentation xml:lang="ru">
  55. Тег 'KLISH' - контейнер верхнего уровня. Все остальные
  56. теги должны быть вложенными.
  57. </xs:documentation>
  58. </xs:annotation>
  59. <!-- Any order of tags and any number -->
  60. <xs:sequence>
  61. <xs:group ref="klish_group_t" minOccurs="0" maxOccurs="unbounded"/>
  62. </xs:sequence>
  63. </xs:complexType>
  64. <!--
  65. *******************************************************
  66. * <PLUGIN> is used to dynamically load plugins.
  67. * Plugin contains symbols that can be used for ACTIONs.
  68. *
  69. * name - Plugin name. If "file" attribute is not specified then plugin's
  70. * filename is autogenerated as "kplugin-<name>.so".
  71. *
  72. * [id] - Internal plugin name for references. Can be the same as "name".
  73. *
  74. * [file] - File name to use if standard autogenerated filename (using "name"
  75. * field) is not appropriate.
  76. *
  77. * The content of PLUGIN tag can be used as a config file for this plugin.
  78. * Parsing of this content must be implemented within plugin's init.
  79. *
  80. ********************************************************
  81. -->
  82. <xs:complexType name="plugin_t">
  83. <xs:annotation>
  84. <xs:documentation xml:lang="en">
  85. Load plugin with symbols (functions).
  86. </xs:documentation>
  87. <xs:documentation xml:lang="ru">
  88. Загружает плугин для использования определяемых в нем
  89. символов (функций).
  90. </xs:documentation>
  91. </xs:annotation>
  92. <xs:simpleContent>
  93. <xs:extension base="xs:string">
  94. <xs:attribute name="name" type="xs:string" use="required"/>
  95. <xs:attribute name="id" type="xs:string" use="optional"/>
  96. <xs:attribute name="file" type="xs:string" use="optional"/>
  97. </xs:extension>
  98. </xs:simpleContent>
  99. </xs:complexType>
  100. <!--
  101. *******************************************************
  102. * <HOTKEY> is used to define hotkey actions
  103. *
  104. * key - Hot-key
  105. *
  106. * cmd - Text string defines command to execute on pressing hot-key. It's like
  107. * a common user CLI input. This string will be interpreted by CLI engine.
  108. *
  109. ********************************************************
  110. -->
  111. <xs:complexType name="hotkey_t">
  112. <xs:attribute name="key" type="xs:string" use="required"/>
  113. <xs:attribute name="cmd" type="xs:string" use="required"/>
  114. </xs:complexType>
  115. <!--
  116. ********************************************************
  117. * <ACTION> specifies the action to be taken for
  118. * a command.
  119. *
  120. * In addition the optional 'sym' attribute can specify
  121. * the name of an internal command which will be invoked
  122. * to handle script.
  123. *
  124. * [sym="<symbol>"] - specify the name of an internally registered
  125. * function (symbol). The content of the ACTION tag is
  126. * taken as the arguments to this function. Plugins can define
  127. * these symbols. The "<symbol>" can be defined as "sym@plugin" i.e.
  128. * parental plugin can be defined explicitly.
  129. *
  130. * [lock="<name>"] - Named lock. It will use special lockfile while
  131. * action execution.
  132. *
  133. * [interrupt="true/false"] - The boolean field that specify that action can be
  134. * be interrupted by Ctrl^C. Default is false. Ignored for non-interactive
  135. * actions.
  136. *
  137. * [interactive="true/false"] - Is action interactive.
  138. *
  139. * [exec_on="fail/success/always/never"] - ACTION's execution depends on
  140. * return code of previous elements of ACTION chain. If the
  141. * condition is not met then ACTION will not be executed. The "always"
  142. * value means that ACTION will be always executed and chain return
  143. * code will be ignored. Default is "success".
  144. *
  145. * [update_retcode="true/false"] - The chain return value can be updated
  146. * by current ACTION's return code or ACTION's return code can be ignored.
  147. * Default is "true".
  148. *
  149. * [permanent="true/false"] - The klish can be invoked with dry-run option. In
  150. * this case all ACTIONs will be not actually executed but will always
  151. * return success. But some actions like navigation is necessary to be
  152. * executed in any case. Permanent flag will inform engine to always
  153. * execute ACTION.
  154. *
  155. * [sync="true/false"] - Common behaviour is to fork() process before ACTION
  156. * execution. But ACTION may be executed in-place (without fork()) if sync
  157. * flag is set to true. It's not recommended to use sync ACTIONs widely.
  158. * It's usefull for small fast functions only.
  159. *
  160. ********************************************************
  161. -->
  162. <xs:simpleType name="action_cond_t">
  163. <xs:restriction base="xs:string">
  164. <xs:enumeration value="fail"/>
  165. <xs:enumeration value="success"/>
  166. <xs:enumeration value="always"/>
  167. <xs:enumeration value="never"/>
  168. </xs:restriction>
  169. </xs:simpleType>
  170. <xs:complexType name="action_t">
  171. <xs:simpleContent>
  172. <xs:extension base="xs:string">
  173. <xs:attribute name="sym" type="xs:string" use="optional"/>
  174. <xs:attribute name="lock" type="xs:string" use="optional"/>
  175. <xs:attribute name="interrupt" type="xs:boolean" use="optional" default="false"/>
  176. <xs:attribute name="interactive" type="xs:boolean" use="optional" default="false"/>
  177. <xs:attribute name="exec_on" type="action_cond_t" use="optional" default="success"/>
  178. <xs:attribute name="update_retcode" type="xs:boolean" use="optional" default="true"/>
  179. <xs:attribute name="permanent" type="xs:boolean" use="optional" default="false"/>
  180. <xs:attribute name="sync" type="xs:boolean" use="optional" default="false"/>
  181. </xs:extension>
  182. </xs:simpleContent>
  183. </xs:complexType>
  184. <!--
  185. *******************************************************
  186. * <ENTRY> This tag is used to define wide class of elements.
  187. *
  188. * name - A text name for entry.
  189. *
  190. * [help] - A text string which describes the purpose of the entry.
  191. *
  192. * [container="true/false"] - If entry is container. Container entry can't
  193. * have parsable argument i.e. only container's children can be considered
  194. * as a candidates to be a appropriate instance for parsed argument.
  195. * For example VIEW is a container. It just structurizes commands but
  196. * are not commands itself. Another example of container is a SWITCH.
  197. * It describes parsing of child elements but has no special keyword
  198. * while user typing.
  199. *
  200. * [mode] - Entry mode. It can be "sequence", "switch", "empty". Default is
  201. * "sequence".
  202. *
  203. * [purpose] - Purpose of entry. It can be "common", "ptype", "prompt", "cond",
  204. * "completion", "help". Default is "common". Another "purposes" are
  205. * processed in a special ways.
  206. *
  207. * [min="<num>"] - Min number of entry occurence while user input parsing.
  208. * Default is 1.
  209. *
  210. * [max="<num>"] - Max number of entry occurence while user input parsing.
  211. * Default is 1.
  212. *
  213. * [ref="<reference>"] - Entry can reference another entry.
  214. *
  215. * [value="<val>"] - defines the user's value for subcommand. If this option
  216. * is defined the entered parameter will be compared to this
  217. * value instead the "name" field. If this field is defined
  218. * the mode of PARAM will be forced to "subcommand". The
  219. * feature is implemented to support subcommands with the
  220. * same names.
  221. *
  222. * [restore="true/false"] - Restore (or not) hierarchy level of executed
  223. * entry. Default is "false".
  224. *
  225. * [order="true/false"] - If order="true" then user can't enter previously declared
  226. * optional parameters after current validated parameter.
  227. * The allowed values is "true" or "false". It's false by default.
  228. *
  229. * [filter="true/false"] - Developer can define 'filter' command to filter stdout
  230. * of piped ("|") commands. Filter can't contain 'sync' ACTIONs. It will be
  231. * always fork()-ed. Only filters can be on the right hand to pipe "|".
  232. * Consider filters as a special type of commands.
  233. *
  234. ********************************************************
  235. -->
  236. <xs:simpleType name="entry_mode_t">
  237. <xs:restriction base="xs:string">
  238. <xs:enumeration value="sequence"/>
  239. <xs:enumeration value="switch"/>
  240. <xs:enumeration value="empty"/>
  241. </xs:restriction>
  242. </xs:simpleType>
  243. <xs:simpleType name="entry_purpose_t">
  244. <xs:restriction base="xs:string">
  245. <xs:enumeration value="common"/>
  246. <xs:enumeration value="ptype"/>
  247. <xs:enumeration value="prompt"/>
  248. <xs:enumeration value="cond"/>
  249. <xs:enumeration value="completion"/>
  250. <xs:enumeration value="help"/>
  251. </xs:restriction>
  252. </xs:simpleType>
  253. <xs:group name="entry_group_t">
  254. <xs:choice>
  255. <xs:element ref="HOTKEY" minOccurs="0" maxOccurs="unbounded"/>
  256. <xs:element ref="ACTION" minOccurs="0" maxOccurs="unbounded"/>
  257. <xs:element ref="ENTRY" minOccurs="0" maxOccurs="unbounded"/>
  258. <xs:element ref="PTYPE" minOccurs="0" maxOccurs="unbounded"/>
  259. <xs:element ref="VIEW" minOccurs="0" maxOccurs="unbounded"/>
  260. <xs:element ref="NSPACE" minOccurs="0" maxOccurs="unbounded"/>
  261. <xs:element ref="COMMAND" minOccurs="0" maxOccurs="unbounded"/>
  262. <xs:element ref="FILTER" minOccurs="0" maxOccurs="unbounded"/>
  263. <xs:element ref="PARAM" minOccurs="0" maxOccurs="unbounded"/>
  264. <xs:element ref="COND" minOccurs="0" maxOccurs="unbounded"/>
  265. <xs:element ref="COMPL" minOccurs="0" maxOccurs="unbounded"/>
  266. <xs:element ref="HELP" minOccurs="0" maxOccurs="unbounded"/>
  267. <xs:element ref="SWITCH" minOccurs="0" maxOccurs="unbounded"/>
  268. <xs:element ref="SUBCOMMAND" minOccurs="0" maxOccurs="unbounded"/>
  269. <xs:element ref="MULTI" minOccurs="0" maxOccurs="unbounded"/>
  270. </xs:choice>
  271. </xs:group>
  272. <xs:complexType name="entry_t">
  273. <!-- Any order of tags and any number -->
  274. <xs:sequence>
  275. <xs:group ref="entry_group_t" minOccurs="0" maxOccurs="unbounded"/>
  276. </xs:sequence>
  277. <xs:attribute name="name" type="xs:string" use="required"/>
  278. <xs:attribute name="help" type="xs:string" use="optional"/>
  279. <xs:attribute name="container" type="xs:boolean" use="optional" default="false"/>
  280. <xs:attribute name="mode" type="entry_mode_t" use="optional" default="switch"/>
  281. <xs:attribute name="purpose" type="entry_purpose_t" use="optional" default="common"/>
  282. <xs:attribute name="min" type="xs:string" use="optional" default="1"/>
  283. <xs:attribute name="max" type="xs:string" use="optional" default="1"/>
  284. <xs:attribute name="ref" type="xs:string" use="optional"/>
  285. <xs:attribute name="value" type="xs:string" use="optional"/>
  286. <xs:attribute name="restore" type="xs:boolean" use="optional" default="false"/>
  287. <xs:attribute name="order" type="xs:boolean" use="optional" default="false"/>
  288. <xs:attribute name="filter" type="xs:boolean" use="optional" default="false"/>
  289. </xs:complexType>
  290. <!--
  291. *******************************************************
  292. * <PTYPE> is used to define the syntax for a parameter type.
  293. *
  294. * name="<string>" - A textual name for this type. This name can be used to
  295. * reference this type within a PARAM's ptype attribute.
  296. *
  297. * [help="<string>"] - Help string.
  298. *
  299. ********************************************************
  300. -->
  301. <xs:group name="ptype_group_t">
  302. <xs:choice>
  303. <xs:element ref="ACTION" minOccurs="0" maxOccurs="unbounded"/>
  304. <xs:element ref="ENTRY" minOccurs="0" maxOccurs="unbounded"/>
  305. <xs:element ref="NSPACE" minOccurs="0" maxOccurs="unbounded"/>
  306. <xs:element ref="COND" minOccurs="0" maxOccurs="unbounded"/>
  307. <xs:element ref="COMPL" minOccurs="0" maxOccurs="unbounded"/>
  308. <xs:element ref="HELP" minOccurs="0" maxOccurs="unbounded"/>
  309. </xs:choice>
  310. </xs:group>
  311. <xs:complexType name="ptype_t">
  312. <xs:sequence>
  313. <xs:group ref="ptype_group_t" minOccurs="0" maxOccurs="unbounded"/>
  314. </xs:sequence>
  315. <xs:attribute name="name" type="xs:string" use="required"/>
  316. <xs:attribute name="help" type="xs:string" use="optional"/>
  317. </xs:complexType>
  318. <!--
  319. *******************************************************
  320. * <VIEW> defines the contents of a specific CLI view.
  321. *
  322. * name - a textual name for the view
  323. *
  324. * prompt - a textual definition of the prompt to be
  325. * used whilst in this view.
  326. * NB. The prompt may contain environment
  327. * or dynamic variables which are expanded
  328. * before display.
  329. *
  330. * [access] - access rights
  331. *
  332. ********************************************************
  333. -->
  334. <xs:complexType name="view_t">
  335. <xs:sequence>
  336. <xs:element ref="NSPACE" minOccurs="0" maxOccurs="unbounded"/>
  337. <xs:element ref="COMMAND" minOccurs="0" maxOccurs="unbounded"/>
  338. <xs:element ref="HOTKEY" minOccurs="0" maxOccurs="unbounded"/>
  339. <xs:element ref="ENTRY" minOccurs="0" maxOccurs="unbounded"/>
  340. </xs:sequence>
  341. <xs:attribute name="name" type="xs:string" use="required"/>
  342. <xs:attribute name="prompt" type="xs:string" use="optional"/>
  343. <xs:attribute name="access" type="xs:string" use="optional"/>
  344. </xs:complexType>
  345. <!--
  346. *******************************************************
  347. * <PARAM> This tag is used to define a parameter for a command.
  348. *
  349. * name - a textual name for this parameter.
  350. *
  351. * help - a textual string which describes the purpose of the
  352. * parameter.
  353. *
  354. * ptype - Reference to a PTYPE name. This parameter will be
  355. * validated against the syntax specified for that type.
  356. * The special value of "" indicates the parameter is a boolean flag.
  357. * The verbatim presence of the texual name on the command line
  358. * simply controls the conditional variable expansion for this
  359. * parameter.
  360. *
  361. * [mode] - Parameter mode. It can be "common", "switch", "subcommand", "multi".
  362. *
  363. * [prefix] - defines the prefix for an optional parameter. A prefix
  364. * with this value on the command line will signify the presence
  365. * of an additional argument which will be validated as the
  366. * value of this parameter.
  367. *
  368. * [optional] - Specify whether parameter is optional. The allowed values
  369. * is "true" or "false". It's false by default.
  370. *
  371. * [order] - Used only together with "optional=true" field.
  372. * If order="true" then user can't enter previously declared
  373. * optional parameters after current validated parameter.
  374. * The allowed values is "true" or "false". It's false by default.
  375. *
  376. * [default] - defines a default value for a parameter. Any parameters
  377. * at the end of command line which have default values need
  378. * not explicitly be entered.
  379. *
  380. * [value] - defines the user's value for subcommand. If this option
  381. * is defined the entered parameter will be compared to this
  382. * value instead the "name" field. If this field is defined
  383. * the mode of PARAM will be forced to "subcommand". The
  384. * feature is implemented to support subcommands with the
  385. * same names.
  386. *
  387. * [hidden] - define the visibility of the parameter while ${__line}
  388. * and ${__params} auto variables expanding. The allowed values
  389. * is "true" and "false".
  390. *
  391. * [test] - define the condition (see the description of 'test'
  392. * utility) to process this parameter.
  393. *
  394. * [access] - access rights
  395. *
  396. ********************************************************
  397. -->
  398. <xs:group name="param_group_t">
  399. <xs:choice>
  400. <xs:element ref="PARAM"/>
  401. <xs:element ref="ENTRY"/>
  402. </xs:choice>
  403. </xs:group>
  404. <xs:complexType name="param_t">
  405. <!-- Any order of tags and any number -->
  406. <xs:sequence>
  407. <xs:group ref="param_group_t" minOccurs="0" maxOccurs="unbounded"/>
  408. </xs:sequence>
  409. <xs:attribute name="name" type="xs:string" use="required"/>
  410. <xs:attribute name="help" type="xs:string" use="required"/>
  411. <xs:attribute name="ptype" type="xs:string" use="required"/>
  412. <xs:attribute name="mode" type="entry_mode_t" use="optional" default="sequence"/>
  413. <xs:attribute name="order" type="xs:boolean" use="optional" default="false"/>
  414. <xs:attribute name="value" type="xs:string" use="optional"/>
  415. </xs:complexType>
  416. <!--
  417. *******************************************************
  418. * <COMMAND> is used to define a command within the CLI.
  419. *
  420. * name="<string>" - A textual name for this command. (This may contain
  421. * spaces e.g. "display acl")
  422. *
  423. * help="<string>" - Help for command.
  424. *
  425. * [view] - defines the view which will be transitioned to, on
  426. * successful execution of any <ACTION> tag. By default the
  427. * current view stays in scope.
  428. *
  429. * [viewid] - defined the new value of the ${VIEWID} variable to
  430. * be used if a transition to a new view occurs. By default
  431. * the viewid will retain it's current value.
  432. *
  433. * [access] - defines the user group/level to which execution of this
  434. * command is restricted. By default there is no restriction.
  435. * The exact interpretation of this field is dependant on the
  436. * client of libclish but for example the clish and tclish
  437. * applications map this to the UNIX user groups.
  438. *
  439. * [escape_chars] - defines the characters which will be escaped (e.g. \$) before
  440. * being expanded as a variable. By default the following
  441. * characters will be escaped `|$<>&()#
  442. *
  443. * [args] - defines a parameter name to be used to gather the rest of the
  444. * command line after the formally defined parameters
  445. * (PARAM elements). The formatting of this parameter is a raw
  446. * string containing as many words as there are on the rest of the
  447. * command line.
  448. *
  449. * [args_help] - a textual string which describes the purpose of the 'args'
  450. * parameter. If the "args" attribute is given then this MUST be
  451. * given also.
  452. *
  453. ********************************************************
  454. -->
  455. <xs:complexType name="command_t">
  456. <xs:sequence>
  457. <!-- Any order of PARAM tags and any number -->
  458. <xs:group ref="param_group_t" minOccurs="0" maxOccurs="unbounded"/>
  459. <xs:element ref="ACTION" minOccurs="0" maxOccurs="unbounded"/>
  460. <xs:element ref="COMMAND" minOccurs="0" maxOccurs="unbounded"/>
  461. </xs:sequence>
  462. <xs:attribute name="name" type="xs:string" use="required"/>
  463. <xs:attribute name="help" type="xs:string" use="required"/>
  464. <xs:attribute name="ref" type="xs:string" use="optional"/>
  465. <xs:attribute name="view" type="xs:string" use="optional"/>
  466. <xs:attribute name="viewid" type="xs:string" use="optional"/>
  467. <xs:attribute name="access" type="xs:string" use="optional"/>
  468. <xs:attribute name="args" type="xs:string" use="optional"/>
  469. <xs:attribute name="args_help" type="xs:string" use="optional"/>
  470. <xs:attribute name="escape_chars" type="xs:string" use="optional"/>
  471. </xs:complexType>
  472. <!--
  473. ********************************************************
  474. * <OVERVIEW> specifies a textual description of the shell.
  475. *
  476. * This should provide instructions about key bindings and
  477. * escape sequences which can be used in the CLI.
  478. *
  479. ********************************************************
  480. -->
  481. <xs:simpleType name="overview_t">
  482. <xs:restriction base="xs:string">
  483. <xs:whiteSpace value="preserve"/>
  484. </xs:restriction>
  485. </xs:simpleType>
  486. <!--
  487. ********************************************************
  488. * <DETAIL> specifies a textual description.
  489. *
  490. * This may be used within the scope of a <COMMAND>
  491. * element, in which case it would typically contain
  492. * detailed usage instructions including examples.
  493. *
  494. * This may also be used within the scope of a <STARTUP>
  495. * element, in which case the text is used as the banner
  496. * details which are displayed on shell startup. This is
  497. * shown before any specified <ACTION> is executed.
  498. *
  499. * This text may also be used in the production of user manuals.
  500. ********************************************************
  501. -->
  502. <xs:simpleType name="detail_t">
  503. <xs:restriction base="xs:string">
  504. <xs:whiteSpace value="preserve"/>
  505. </xs:restriction>
  506. </xs:simpleType>
  507. <!--
  508. *******************************************************
  509. * <NSPACE> import commands from specific view to current view.
  510. *
  511. * ref - the view to import commands from
  512. *
  513. * [prefix] - the prefix for imported commands
  514. *
  515. * [prefix_help] - the help for namespace prefix
  516. *
  517. * [help] - a boolean flag to use imported
  518. * commands while help
  519. *
  520. * [completion] - a boolean flag to use imported
  521. * commands while completion
  522. *
  523. * [context_help] - a boolean flag to use imported
  524. * commands while context help
  525. *
  526. * [inherit] - a boolean flag to inherit nested
  527. * namespace commands recursively
  528. *
  529. * [access] - access rights
  530. *
  531. ********************************************************
  532. -->
  533. <xs:complexType name="nspace_t">
  534. <xs:attribute name="ref" type="xs:string" use="required"/>
  535. <xs:attribute name="prefix" type="xs:string" use="optional"/>
  536. <xs:attribute name="prefix_help" type="xs:string" use="optional"/>
  537. <xs:attribute name="help" type="xs:boolean" use="optional" default="false"/>
  538. <xs:attribute name="completion" type="xs:boolean" use="optional" default="true"/>
  539. <xs:attribute name="context_help" type="xs:boolean" use="optional" default="false"/>
  540. <xs:attribute name="inherit" type="xs:boolean" use="optional" default="true"/>
  541. <xs:attribute name="access" type="xs:string" use="optional"/>
  542. </xs:complexType>
  543. <!--
  544. *******************************************************
  545. * <VAR> Specify the variable.
  546. *
  547. *
  548. *
  549. ********************************************************
  550. -->
  551. <xs:complexType name="var_t">
  552. <xs:sequence>
  553. <xs:element ref="ACTION" minOccurs="0" maxOccurs="unbounded"/>
  554. </xs:sequence>
  555. <xs:attribute name="name" type="xs:string" use="required"/>
  556. <xs:attribute name="help" type="xs:string" use="optional"/>
  557. <xs:attribute name="value" type="xs:string" use="optional"/>
  558. <xs:attribute name="dynamic" type="xs:boolean" use="optional" default="false"/>
  559. </xs:complexType>
  560. <!--
  561. *******************************************************
  562. * <WATCHDOG> is used to recover system after errors.
  563. *
  564. ********************************************************
  565. -->
  566. <xs:complexType name="wdog_t">
  567. <xs:sequence>
  568. <xs:element ref="ACTION" minOccurs="1" maxOccurs="unbounded"/>
  569. </xs:sequence>
  570. </xs:complexType>
  571. <!--
  572. *******************************************************
  573. * <HOOK> is used to redefine internal hooks
  574. *
  575. * name - The name of internal hook (init, fini, access, log).
  576. *
  577. * [builtin] - specify the name of an internally registered
  578. * function.
  579. *
  580. ********************************************************
  581. -->
  582. <xs:simpleType name="hook_list_e">
  583. <xs:restriction base="xs:string">
  584. <xs:enumeration value="init"/>
  585. <xs:enumeration value="fini"/>
  586. <xs:enumeration value="access"/>
  587. <xs:enumeration value="log"/>
  588. </xs:restriction>
  589. </xs:simpleType>
  590. <xs:complexType name="hook_t">
  591. <xs:attribute name="name" type="hook_list_e"/>
  592. <xs:attribute name="builtin" type="xs:string" use="optional"/>
  593. </xs:complexType>
  594. </xs:schema>