nested.json 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. {
  2. "doc": {
  3. "help": "This is example UI with nested commands. It can be used to learn how UIs with nested commands are built in CLAP and how to interact with them in programs' code and on the commandline. It takes no operands. This description is taken from 'doc' field.",
  4. "usage": [
  5. "--help",
  6. "--version",
  7. "[--verbose | --quiet] <mode> [opts...]"
  8. ],
  9. "examples": [
  10. {
  11. "line": "--verbose foo --alpha",
  12. "desc": "do stuff"
  13. },
  14. {
  15. "line": "foo --quiet bary -gd",
  16. "desc": "do moar stuff"
  17. },
  18. {
  19. "line": "help --verbose | help --help",
  20. "desc": "display detailed help message"
  21. },
  22. {
  23. "line": "help --verbose -- [operand...] | help --help -- [operand...]",
  24. "desc": "display detailed help mesasge about chosen element"
  25. }
  26. ]
  27. },
  28. "options": {
  29. "global": [
  30. {
  31. "short": "h",
  32. "long": "help",
  33. "help": "display help message"
  34. },
  35. {
  36. "short": "v",
  37. "long": "verbose",
  38. "conflicts": ["--quiet"],
  39. "help": "display verbose output"
  40. },
  41. {
  42. "short": "q",
  43. "long": "quiet",
  44. "conflicts": ["--verbose"],
  45. "help": "be silent"
  46. }
  47. ],
  48. "local": [
  49. {
  50. "long": "version",
  51. "conflicts": ["--help"],
  52. "help": "display CLAP version"
  53. }
  54. ]
  55. },
  56. "commands": {
  57. "foo": {
  58. "doc": {
  59. "help": "This is child mode with name 'foo'."
  60. },
  61. "options": {
  62. "local": [
  63. {
  64. "short": "a",
  65. "long": "alpha",
  66. "help": "first letter of Greek alphabet"
  67. },
  68. {
  69. "short": "b",
  70. "long": "beta",
  71. "arguments": ["int"],
  72. "help": "second letter of Greek alphabet"
  73. }
  74. ]
  75. },
  76. "commands": {
  77. "bary": {
  78. "doc": {"help": "This is child-child mode with name 'bary'. It has some pretty long description. Not that this description (or summary? or whatever...) will tell you anything interesting, it's here only to stress the help screen builder with a description containing many words so the line-breaking can be tested. And some more words, just to make sure it is long."},
  79. "options": {
  80. "local": [
  81. {
  82. "short": "g",
  83. "long": "gamma",
  84. "help": "third letter of Greek alphabet"
  85. },
  86. {
  87. "short": "d",
  88. "long": "delta",
  89. "arguments": ["int"],
  90. "help": "fourth letter of Greek alphabet"
  91. }
  92. ]
  93. },
  94. "commands": {
  95. "baz": {
  96. "doc": {"help": "This is child-child-child mode with name 'baz'."},
  97. "options": {
  98. "local": [
  99. {
  100. "short": "e",
  101. "long": "epsilon",
  102. "help": "fifth letter of Greek alphabet"
  103. },
  104. {
  105. "short": "z",
  106. "long": "zeta",
  107. "arguments": ["int"],
  108. "help": "sixth letter of Greek alphabet"
  109. }
  110. ]
  111. }
  112. }
  113. }
  114. },
  115. "bax": {
  116. "doc": {"help": "This is child-child mode with name 'bax'."},
  117. "options": {
  118. "local": [
  119. {
  120. "long": "eta",
  121. "help": "seventh letter of Greek alphabet"
  122. },
  123. {
  124. "long": "theta",
  125. "help": "eighth letter of Greek alphabet"
  126. }
  127. ]
  128. }
  129. }
  130. }
  131. }
  132. },
  133. "operands": {"no": [0, 0]}
  134. }