klish.xsd 24 KB

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