1
0

klish.xsd 24 KB

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