_mix 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #compdef mix
  2. #autoload
  3. # Elixir mix zsh completion
  4. local -a _1st_arguments
  5. _1st_arguments=(
  6. 'app.start:Start all registered apps'
  7. 'archive:List all archives'
  8. 'archive.build:Archive this project into a .ez file'
  9. 'archive.install:Install an archive locally'
  10. 'archive.uninstall:Uninstall archives'
  11. 'clean:Delete generated application files'
  12. 'cmd:Executes the given command'
  13. 'compile:Compile source files'
  14. 'compile.protocols:Consolidates all protocols in all paths'
  15. 'deps:List dependencies and their status'
  16. "deps.clean:Remove the given dependencies' files"
  17. 'deps.compile:Compile dependencies'
  18. 'deps.get:Get all out of date dependencies'
  19. 'deps.unlock:Unlock the given dependencies'
  20. 'deps.update:Update the given dependencies'
  21. 'do:Executes the tasks separated by comma'
  22. 'escript.build:Builds an escript for the project'
  23. 'help:Print help information for tasks'
  24. 'hex:Print hex help information'
  25. 'hex.config:Read or update hex config'
  26. 'hex.docs:Publish docs for package'
  27. 'hex.info:Print hex information'
  28. 'hex.key:Hex API key tasks'
  29. 'hex.outdated:Shows outdated hex deps for the current project'
  30. 'hex.owner:Hex package ownership tasks'
  31. 'hex.publish:Publish a new package version'
  32. 'hex.search:Search for package names'
  33. 'hex.user:Hex user tasks'
  34. 'loadconfig:Loads and persists the given configuration'
  35. 'local:List local tasks'
  36. 'local.hex:Install hex locally'
  37. 'local.rebar:Install rebar locally'
  38. 'new:Create a new Elixir project'
  39. 'phoenix.digest:Digests and compress static files'
  40. 'phoenix.gen.channel:Generates a Phoenix channel'
  41. 'phoenix.gen.html:Generates controller, model and views for an HTML based resource'
  42. 'phoenix.gen.json:Generates a controller and model for a JSON based resource'
  43. 'phoenix.gen.model:Generates an Ecto model'
  44. 'phoenix.gen.secret:Generates a secret'
  45. 'phoenix.new:Create a new Phoenix application'
  46. 'phoenix.routes:Prints all routes'
  47. 'phoenix.server:Starts applications and their servers'
  48. 'run:Run the given file or expression'
  49. "test:Run a project's tests"
  50. '--help:Describe available tasks'
  51. '--version:Prints the Elixir version information'
  52. )
  53. __task_list ()
  54. {
  55. local expl
  56. declare -a tasks
  57. tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server run test)
  58. _wanted tasks expl 'help' compadd $tasks
  59. }
  60. local expl
  61. local curcontext="$curcontext" state line
  62. typeset -A opt_args
  63. _arguments -C \
  64. ':command:->command' \
  65. '*::options:->options'
  66. case $state in
  67. (command)
  68. _describe -t commands "mix subcommand" _1st_arguments
  69. return
  70. ;;
  71. (options)
  72. case $line[1] in
  73. (help)
  74. _arguments ':feature:__task_list'
  75. ;;
  76. (test)
  77. _files
  78. ;;
  79. esac
  80. ;;
  81. esac