_ember-cli 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. #compdef ember
  2. local curcontext="$curcontext" state line ret=1
  3. _arguments -C -A "--version" -A "--help" \
  4. '(- 1 *)--help' \
  5. '(- 1 *)--version' \
  6. '1: :->cmds' \
  7. '*:: :->args' && ret=0
  8. case $state in
  9. cmds)
  10. _values "ember command" \
  11. "addon[Generates a new folder structure for building an addon, complete with test harness]" \
  12. "asset-sizes[Shows the sizes of your asset files]" \
  13. "build[Builds your app and places it into the output path (dist/ by default)]" \
  14. "destroy[Destroys code generated by generate command]" \
  15. "generate[Generates new code from blueprints]" \
  16. "help[Outputs the usage instructions for all commands or the provided command]" \
  17. "init[Creates a new ember-cli project in the current folder]" \
  18. "install[Installs an ember-cli addon from npm]" \
  19. "new[Creates a new directory and runs ember init in it]" \
  20. "serve[Builds and serves your app, rebuilding on file changes]" \
  21. "test[Runs your app's test suite]" \
  22. "version[outputs ember-cli version]"
  23. ret=0
  24. ;;
  25. args)
  26. case $line[1] in
  27. help)
  28. _values 'commands' \
  29. 'addon' \
  30. 'asset-sizes' \
  31. 'build' \
  32. 'destroy' \
  33. 'generate' \
  34. 'help' \
  35. 'init' \
  36. 'install' \
  37. 'new' \
  38. 'serve' \
  39. 'test' \
  40. 'vesion' && ret=0
  41. ;;
  42. addon)
  43. _arguments \
  44. '(--blueprint)--blueprint=-' \
  45. '(--directory)--directory=-' \
  46. '(--dry-run)--dry-run' \
  47. '(--skip-bower)--skip-bower' \
  48. '(--skip-git)--skip-git' \
  49. '(--skip-npm)--skip-npm' \
  50. '(--verbose)--verbose'
  51. ;;
  52. asset-sizes)
  53. _arguments \
  54. '(--output-path)--output-path=-'
  55. ;;
  56. build)
  57. _arguments \
  58. '(--environment)--environment=-' \
  59. '(--output-path)--output-path=-' \
  60. '(--output-path)--suppress-sizes' \
  61. '(--watch)--watch' \
  62. '(--watcher)--watcher=-' \
  63. '(-dev)-dev' \
  64. '(-prod)-prod'
  65. ;;
  66. destroy|generate)
  67. _values 'arguments' \
  68. '(--classic)--classic' \
  69. '(--dry-run)--dry-run' \
  70. '(--dummy)--dummy' \
  71. '(--in-repo-addon)--in-repo-addon-=' \
  72. '(--pod)--pod' \
  73. '(--verbose)--verbose' && ret=0
  74. _values 'blueprints' \
  75. 'acceptance-test' \
  76. 'adapter' \
  77. 'adapter-test' \
  78. 'component' \
  79. 'component-addon' \
  80. 'component-test' \
  81. 'controller' \
  82. 'controller-test' \
  83. 'helper' \
  84. 'helper-addon' \
  85. 'helper-test' \
  86. 'initializer' \
  87. 'initializer-addon' \
  88. 'initializer-test' \
  89. 'instance-initializer' \
  90. 'instance-initializer-addon' \
  91. 'instance-initializer-test' \
  92. 'mixin' \
  93. 'mixin-test' \
  94. 'model' \
  95. 'model-test' \
  96. 'resource' \
  97. 'route' \
  98. 'route-addon' \
  99. 'route-test' \
  100. 'serializer' \
  101. 'serializer-test' \
  102. 'service' \
  103. 'service-test' \
  104. 'template' \
  105. 'test-helper' \
  106. 'transform' \
  107. 'transform-test' \
  108. 'util' \
  109. 'util-test' \
  110. 'view' \
  111. 'view-test' \
  112. 'addon' \
  113. 'addon-import' \
  114. 'app' \
  115. 'blueprint' \
  116. 'http-mock' \
  117. 'http-proxy' \
  118. 'in-repo-addon' \
  119. 'lib' \
  120. 'server' \
  121. 'vendor-shim' && ret=0
  122. ;;
  123. init)
  124. _arguments \
  125. '(--blueprint)--blueprint=-' \
  126. '(--name)--name=-' \
  127. '(--dry-run)--dry-run' \
  128. '(--skip-bower)--skip-bower' \
  129. '(--skip-npm)--skip-npm' \
  130. '(--verbose)--verbose'
  131. ;;
  132. install)
  133. _arguments \
  134. '(--save-dev)--save-dev' \
  135. '(--save)--save'
  136. ;;
  137. new)
  138. _arguments \
  139. '(--blueprint)--blueprint=-' \
  140. '(--directory)--directory=-' \
  141. '(--dry-run)--dry-run' \
  142. '(--skip-bower)--skip-bower' \
  143. '(--skip-git)--skip-git' \
  144. '(--skip-npm)--skip-npm' \
  145. '(--verbose)--verbose'
  146. ;;
  147. serve)
  148. _arguments \
  149. '(--port)--port=-[To use a port different than 4200. Pass 0 to automatically pick an available port.]' \
  150. '(--host)--host=-[Listens on all interfaces by default]' \
  151. '(--proxy)--proxy=-' \
  152. '(--secure-proxy)--secure-proxy[Set to false to proxy self-signed SSL certificates]' \
  153. '(--transparent-proxy)--transparent-proxy[Set to false to omit x-forwarded-* headers when proxying]' \
  154. '(--watcher)--watcher=-' \
  155. '(--live-reload)--live-reload' \
  156. '(--live-reload-host)--live-reload-host=-[Defaults to host]' \
  157. '(--live-reload-base-url)--live-reload-base-url=-[Defaults to baseURL]' \
  158. '(--live-reload-port)--live-reload-port=-[Defaults to port number within \[49152...65535\]]' \
  159. '(--environment)--environment=-' \
  160. '(--output-path)--output-path=-' \
  161. '(--ssl)--ssl' \
  162. '(--ssl-key)--ssl-key=-' \
  163. '(--ssl-cert)--ssl-cert=-'
  164. ;;
  165. test)
  166. _arguments \
  167. '(--environment)--environment=-' \
  168. '(--config-file)--config-file=-' \
  169. '(--server)--server' \
  170. '(--host)--host=-' \
  171. '(--test-port)--test-port=-[The test port to use when running with --server.]' \
  172. '(--filter)--filter=-[A string to filter tests to run]' \
  173. '(--module)--module=-[The name of a test module to run]' \
  174. '(--watcher)--watcher=-' \
  175. '(--launch)--launch=-[A comma separated list of browsers to launch for tests.]' \
  176. '(--reporter)--reporter=-[Test reporter to use \[tap|dot|xunit\] (default: tap)]' \
  177. '(--silent)--silent[Suppress any output except for the test report]' \
  178. '(--test-page)--test-page=-[Test page to invoke]' \
  179. '(--path)--path=-[Reuse an existing build at given path.]' \
  180. '(--query)--query=-[A query string to append to the test page URL.]'
  181. ;;
  182. esac
  183. ;;
  184. esac
  185. return ret